Cookbook/Outdoor events

= Guided tours and outdoor events =

This page shows how you can describe guided trips, like canoe tours or guided hiking and backpacking with GoodRelations.

= Overview =

We take the example from http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz. They are offering guided canoe and kayak trips in Bavaria, Germany.

We have to model the following objects:


 * The organizer of the event (gr:BusinessEntity)
 * The location from where the event is being offered (gr:Location or schema:Place)
 * The individual events (tio:Event), in this case a half-day and a full-day trip
 * The tickets for individual boat / passenger choices (canoe vs. kayak, single vs. double vs. triple)
 * The offers to sell those tickets.

We use the following vocabularies in our examples:


 * GoodRelations, http://purl.org/goodrelations/v1#
 * The Tickets Ontology, http://purl.org/tio/ns#
 * schema.org, http://schema.org/
 * FOAF, http://xmlns.com/foaf/0.1/

= Examples in RDFa or Microdata = The following examples are in the human-readable Turtle syntax for RDF. You can easily translate them into RDFa or Microdata with the great RDF Translator tool written by Alex Stolz.

Note: You will have to add the prefix declarations from the next section to the code snippets.

= Prefix Declarations =

@prefix foo:  . @prefix foaf: . @prefix gr:   . @prefix s:    . @prefix tio:  . @prefix xsd:  .

= Organizer / Company = The guided tour is offered by the company called "Kajak Mietservice".

foo:KajakMietService a gr:BusinessEntity; gr:legalName "Kajak Mietservice - im Naturpark fraenkische Schweiz."; foaf:page ; s:address [ a s:PostalAddress; s:streetAddress "Kapellenplatz 6"; s:postalCode "91320"; s:addressLocality "Ebermannstadt, Bavaria, Germany" ]; s:telephone "+49-1123456789"; s:email "contact@example.org".
 * 1) Business entity offering the event:
 * 2) Kajak Mietservice - im Naturpark fraenkische Schweiz
 * 1) optional:

= Locations = The trips are being offered from a parking place called "Parkplatz Doos": foo:ParkplatzDoos a gr:Location; gr:name "Parkplatz Doos"; s:address [ a s:PostalAddress; s:streetAddress "Doos 17"; s:postalCode "91344"; s:addressLocality "Waischenfeld, Bavaria, Germany" ]; s:latitude 49.811638; s:longitude 11.296982.
 * 1) Meeting point for the event: Parkplatz Doos

Note: You can also use schema:Place, which is equivalent to gr:Location.

= Events = We have two event types, a half-day and a full-day trip. They can be modeled as placeholders, i.e. without exact dates give, or materialized for each individual day. We take the simpler route in here, so we have to entities:
 * The half-day trip, "Kurzstrecke Pulvermühle - Doos 9.30 oder 13.30 Uhr"

foo:KajakTourShortTrip a tio:Event ; gr:name "Kajaktour in der Fränkischen Schweiz: Kurzstrecke Pulvermühle"@de; gr:description """Kajak in der Fränkischen Schweiz ermöglicht Dir - selbst bei Temperaturen, die sich normalerweise nicht zum Schwimmen eignen – einen Wasserspaß der Extraklasse. Kurzstrecke Pulvermühle - Doos 9.30 oder 13.30 Uhr"""@de; foaf:depiction ; foaf:page ; tio:takesPlaceAt foo:ParkplatzDoos.
 * 1) Event 1: Kurzstrecke Pulvermühle - Doos 9.30 oder 13.30 Uhr
 * 1) One could model individual event dates using tio:starts and tio:ends, but we skip that for now
 * 2) 	tio:starts "2012-04-01T09:30:00-01:00"^^xsd:dateTime;
 * 3) 	tio:ends "2012-04-01T14:30:00-01:00"^^xsd:dateTime;

foo:KajakTourFullDay a tio:Event ; gr:name "Kajaktour in der Fränkischen Schweiz: Tagestour Doos - Muggendorf - Streitberg"@de; gr:description """Kajak in der Fränkischen Schweiz ermöglicht Dir - selbst bei Temperaturen, die sich normalerweise nicht zum Schwimmen eignen – einen Wasserspaß der Extraklasse. Tagestour Doos - Muggendorf - Streitberg 9.00 bis 11.30 Uhr Abholung aus Muggendorf oder Streitberg ab 15.00 Uhr"""@de; foaf:depiction ; foaf:page ; tio:takesPlaceAt foo:ParkplatzDoos.
 * The full-day trip, "Tagestour Doos - Muggendorf - Streitberg 9.00 bis 11.30 Uhr"
 * 1) Event 2: Tagestour Doos - Muggendorf - Streitberg 9.00 bis 11.30 Uhr
 * 1) One could model individual event dates using tio:starts and tio:ends, but we skip that for now
 * 2) 	tio:starts "2012-04-01T09:00:00-01:00"^^xsd:dateTime;
 * 3) 	tio:ends "2012-04-01T15:00:00-01:00"^^xsd:dateTime;

Note: Instead of tio:Event, you can also use schema:Event with slightly different property names.

= Tickets (Products) = We have five ticket categories:
 * half-day trip in a two-seater kayak
 * half-day trip in a three-seater canoe
 * half-day trip for children as third or fourth passenger in a three-seater canoe
 * full-day trip in a one-seater kayak
 * full-day trip in a two-seater kayak

In Turtle syntax, this looks as follows:

foo:Ticket1 a tio:TicketPlaceholder; gr:name "Kurzstrecke im 2er-Kajak"@de; gr:description "Kurzstrecke im 2er-Kajak"@de; foaf:page ; tio:accessTo foo:KajakTourShortTrip.
 * 1) Ticket 1: Kurzstrecke im 2er-Kajak
 * 1) You can optionally constrain the validity of a ticket, but only using an absolute dateTime range:
 * 2) 	tio:validFrom ;
 * 3) 	tio:validThrough ;

foo:Ticket2 a tio:TicketPlaceholder; gr:name "Kurzstrecke im 3er-Kanu"@de; gr:description "Kurzstrecke im 3er-Kanu"@de; foaf:page ; tio:accessTo foo:KajakTourShortTrip.
 * 1) Ticket 2: Kurzstrecke im 3er-Kanu

foo:Ticket3 a tio:TicketPlaceholder; gr:name "Kind (bis 10 J. als 3. oder 4. Person im Kanu"@de;	gr:description "Kind (bis 10 J. als 3. oder 4. Person im Kanu"@de; foaf:page ; tio:accessTo foo:KajakTourShortTrip.
 * 1) Ticket 3: Kind (bis 10 J. als 3. oder 4. Person im Kanu

foo:Ticket4 a tio:TicketPlaceholder; gr:name "Tagestour im 1er-Kajak"@de; gr:description "Tagestour im 1er-Kajak"@de; foaf:page ; tio:accessTo foo:KajakTourFullDay.
 * 1) Ticket 4: Tagestour im 1er-Kajak

foo:Ticket5 a tio:TicketPlaceholder; gr:name "Tagestour im 2er-Kajak"@de; gr:description "Tagestour im 2er-Kajak"@de; foaf:page ; tio:accessTo foo:KajakTourFullDay.
 * 1) Ticket 5: Tagestour im 2er-Kajak

= Offers = Lastly, we have to define the offers, i.e. the statements that one can buy the tickets. Since we have five different ticket types, we also have five different offers. foo:Offer1 a gr:Offering ; gr:name "Kajaktour in der Fränkischen Schweiz: Kurzstrecke im 2er-Kajak"@de ; gr:description """Kajaktour in der Fränkischen Schweiz: Kurzstrecke Pulvermühle: Kurzstrecke im 2er-Kajak"""@de ; gr:includes foo:Ticket1 ; foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>; gr:hasBusinessFunction gr:Sell ; gr:hasPriceSpecification [ a gr:UnitPriceSpecification ; gr:hasCurrency "EUR"@en ; gr:hasCurrencyValue "14.40"^^xsd:float ; gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ].
 * 1) Validity of the price, i.e. how long you promise to keep the price

foo:Offer2 a gr:Offering ; gr:name "Kajaktour in der Fränkischen Schweiz: Kurzstrecke im 3er-Kanu"@de ; gr:description """Kajaktour in der Fränkischen Schweiz: Kurzstrecke Pulvermühle: Kurzstrecke im 3er-Kanu"""@de ; gr:includes foo:Ticket2 ; foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>; gr:hasBusinessFunction gr:Sell ; gr:hasPriceSpecification [ a gr:UnitPriceSpecification ; gr:hasCurrency "EUR"@en ; gr:hasCurrencyValue "14.40"^^xsd:float ; gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ].
 * 1) Validity of the price, i.e. how long you promise to keep the price

foo:Offer3 a gr:Offering ; gr:name "Kajaktour in der Fränkischen Schweiz: Kind (bis 10 J. als 3. oder 4. Person im Kanu"@de ;   gr:description """Kajaktour in der Fränkischen Schweiz: Kurzstrecke Pulvermühle: Kurzstrecke im 3er-Kanu - Kind (bis 10 J. als 3. oder 4. Person im Kanu"""@de ; gr:includes foo:Ticket3 ; foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>; gr:hasBusinessFunction gr:Sell ; gr:hasPriceSpecification [ a gr:UnitPriceSpecification ; gr:hasCurrency "EUR"@en ; gr:hasCurrencyValue "5.40"^^xsd:float ; gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ].
 * 1) Validity of the price, i.e. how long you promise to keep the price

foo:Offer4 a gr:Offering ; gr:name "Kajaktour in der Fränkischen Schweiz: Tagestour im 1er-Kajak"@de ; gr:description "Kajaktour in der Fränkischen Schweiz: Tagestour im 1er-Kajak"@de ; gr:includes foo:Ticket4 ; foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>; gr:hasBusinessFunction gr:Sell ; gr:hasPriceSpecification [ a gr:UnitPriceSpecification ; gr:hasCurrency "EUR"@en ; gr:hasCurrencyValue "27.00"^^xsd:float ; gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ].
 * 1) Validity of the price, i.e. how long you promise to keep the price

foo:Offer5 a gr:Offering ; gr:name "Kajaktour in der Fränkischen Schweiz: Tagestour im 2er-Kajak"@de ; gr:description "Kajaktour in der Fränkischen Schweiz: Tagestour im 2er-Kajak"@de ; gr:includes foo:Ticket5 ; foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>; gr:hasBusinessFunction gr:Sell ; gr:hasPriceSpecification [ a gr:UnitPriceSpecification ; gr:hasCurrency "EUR"@en ; gr:hasCurrencyValue "22.50"^^xsd:float ; gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ].
 * 1) Validity of the price, i.e. how long you promise to keep the price

Now, we also have to say that the offers are made by the company by pointing from the guide entity to all five offers.

foo:KajakMietService gr:offers foo:Offer1, foo:Offer2, foo:Offer3, foo:Offer4, foo:Offer5.

Now, you should be all set!

= Questions or Suggestions? =

Please post to the GoodRelations mailing list.