Cookbook/Outdoor events

From GoodRelations Wiki
Jump to: navigation, search

Guided tours and outdoor events

The GoodRelations Cookbook
Recipe Guided Tours and Outdoor Events
Description Modeling of guided toors and outdoor events (e.g. canoe trip, hiking, backpacking)
Status mature
Level intermediate
Tags tio, outdoor, events, tours
See also Cookbook/Tickets, Tickets Ontology

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:

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:   <http://example.org/#> .
@prefix foaf:  <http://xmlns.com/foaf/0.1/> .
@prefix gr:    <http://purl.org/goodrelations/v1#> .
@prefix s:     <http://schema.org/> .
@prefix tio:   <http://purl.org/tio/ns#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .

Organizer / Company

The guided tour is offered by the company called "Kajak Mietservice".

# Business entity offering the event:
# Kajak Mietservice - im Naturpark fraenkische Schweiz
foo:KajakMietService a gr:BusinessEntity;
    gr:legalName "Kajak Mietservice - im Naturpark fraenkische Schweiz.";
    foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>;
    s:address [ a s:PostalAddress;
                s:streetAddress "Kapellenplatz 6";
                s:postalCode "91320";
                s:addressLocality "Ebermannstadt, Bavaria, Germany" ];
# optional:
    s:telephone "+49-1123456789";
    s:email "contact@example.org".

Locations

The trips are being offered from a parking place called "Parkplatz Doos":

# Meeting point for the event: 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 .

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"
# Event 1: 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 <http://static.regiondo.de/media/....png>;
    foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>;
# One could model individual event dates using tio:starts and tio:ends, but we skip that for now
#	tio:starts "2012-04-01T09:30:00-01:00"^^xsd:dateTime;
#	tio:ends "2012-04-01T14:30:00-01:00"^^xsd:dateTime;
	tio:takesPlaceAt foo:ParkplatzDoos.
  • The full-day trip, "Tagestour Doos - Muggendorf - Streitberg 9.00 bis 11.30 Uhr"
# Event 2: Tagestour Doos - Muggendorf - Streitberg 9.00 bis 11.30 Uhr
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 <http://static.regiondo.de/media/....png>;
    foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>;
# One could model individual event dates using tio:starts and tio:ends, but we skip that for now
#	tio:starts "2012-04-01T09:00:00-01:00"^^xsd:dateTime;
#	tio:ends "2012-04-01T15:00:00-01:00"^^xsd:dateTime;
	tio:takesPlaceAt foo:ParkplatzDoos.

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:

# Ticket 1: Kurzstrecke im 2er-Kajak
foo:Ticket1 a tio:TicketPlaceholder;
	gr:name "Kurzstrecke im 2er-Kajak"@de;
	gr:description "Kurzstrecke im 2er-Kajak"@de;
    foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>;
# You can optionally constrain the validity of a ticket, but only using an absolute dateTime range:
#	tio:validFrom ;
#	tio:validThrough ;
	tio:accessTo foo:KajakTourShortTrip.

# Ticket 2: Kurzstrecke im 3er-Kanu
foo:Ticket2 a tio:TicketPlaceholder;
	gr:name "Kurzstrecke im 3er-Kanu"@de;
	gr:description "Kurzstrecke im 3er-Kanu"@de;
    foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>;
	tio:accessTo foo:KajakTourShortTrip.

# Ticket 3: Kind (bis 10 J. als 3. oder 4. Person im 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 <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>;
	tio:accessTo foo:KajakTourShortTrip.

# Ticket 4: Tagestour im 1er-Kajak
foo:Ticket4 a tio:TicketPlaceholder;
	gr:name "Tagestour im 1er-Kajak"@de;
	gr:description "Tagestour im 1er-Kajak"@de;
    foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>;
	tio:accessTo foo:KajakTourFullDay.

# Ticket 5: Tagestour im 2er-Kajak
foo:Ticket5 a tio:TicketPlaceholder;
	gr:name "Tagestour im 2er-Kajak"@de;
	gr:description "Tagestour im 2er-Kajak"@de;
    foaf:page <http://www.regiondo.de/kajaktouren-kajaktour-in-der-frankischen-schweiz>;
	tio:accessTo foo:KajakTourFullDay.

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 ;
# Validity of the price, i.e. how long you promise to keep the price
           gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ] .

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 ;
# Validity of the price, i.e. how long you promise to keep the price
           gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ] .

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 ;
# Validity of the price, i.e. how long you promise to keep the price
           gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ] .

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 ;
# Validity of the price, i.e. how long you promise to keep the price
           gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ] .

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 ;
# Validity of the price, i.e. how long you promise to keep the price
           gr:validThrough "2012-04-30T23:59:59"^^xsd:dateTime ] .


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.