This page is still work-in-progress.
On this page, we describe how GoodRelations can be used to make a restaurant and its offers visibible on the Web of Linked Data.
# Example of a restaurant in GoodRelations
# Miller's Sandwich Bar
# With price ranges
# lunch: 900yen - 1500yen, dinner: 1200yen - 2500yen
@prefix foo: <http://www.example.com/xyz#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
# Business Entity
foo:company
a gr:BusinessEntity ;
foaf:page <http://www.example.com/xyz>;
gr:legalName "Miller Sandwich Bar Ltd."^^xsd:string ;
gr:hasPOS foo:restaurant ;
gr:offers foo:lunch_offer;
gr:offers foo:dinner_offer.
# Restaurant
foo:restaurant
a gr:LocationOfSalesOrServiceProvisioning ;
foaf:page <http://www.example.com/xyz>;
gr:hasOpeningHoursSpecification
foo:workdays,
foo:saturdays .
# Opening hours specifications
foo:workdays
a gr:OpeningHoursSpecification ;
gr:opens "08:00:00"^^xsd:time ;
gr:closes "18:00:00"^^xsd:time ;
gr:hasOpeningHoursDayOfWeek
gr:Monday, gr:Tuesday, gr:Wednesday, gr:Thursday, gr:Friday .
foo:saturdays
a gr:OpeningHoursSpecification ;
gr:opens "08:30:00"^^xsd:time ;
gr:closes "14:00:00"^^xsd:time ;
gr:hasOpeningHoursDayOfWeek gr:Saturday .
# Lunch offer
# lunch: 900yen - 1500yen
foo:lunch_offer
a gr:Offering;
foaf:page <http://www.example.com/xyz>;
rdfs:comment "The best lunch sandwiches in town, price range 900-1500 JPY"@en ;
gr:includes foo:lunch ;
gr:hasBusinessFunction gr:Sell ;
gr:validFrom "2010-03-30T00:00:00+01:00"^^xsd:dateTime ;
gr:validThrough "2011-04-24T00:00:00+01:00"^^xsd:dateTime ;
gr:availableAtOrFrom foo:restaurant ;
gr:hasPriceSpecification [
a gr:UnitPriceSpecification;
gr:hasCurrency "JPY"^^xsd:string ;
gr:hasMinCurrencyValue "900"^^xsd:float ;
gr:hasMaxCurrencyValue "1500"^^xsd:float ;
gr:hasUnitOfMeasurement "C62"^^xsd:string ;
gr:valueAddedTaxIncluded "true"^^xsd:boolean .
# you could specificy a validity interval for the price individually, but we skip that in here
].
# Dinner offer
# dinner: 1200yen - 2500yen
foo:dinner_offer
a gr:Offering;
foaf:page <http://www.example.com/xyz>;
rdfs:comment "The best dinner in town: Various menus, vegetarian, beefy, tofu, you name it - Price range 1200-2500 JPY"@en ;
gr:includes foo:dinner ;
gr:hasBusinessFunction gr:Sell ;
gr:validFrom "2010-03-30T00:00:00+01:00"^^xsd:dateTime ;
gr:validThrough "2011-04-24T00:00:00+01:00"^^xsd:dateTime ;
gr:availableAtOrFrom foo:restaurant ;
gr:hasPriceSpecification [
a gr:UnitPriceSpecification;
gr:hasCurrency "JPY"^^xsd:string ;
gr:hasMinCurrencyValue "1200"^^xsd:float ;
gr:hasMaxCurrencyValue "2500"^^xsd:float ;
gr:hasUnitOfMeasurement "C62"^^xsd:string ;
gr:valueAddedTaxIncluded "true"^^xsd:boolean .
# you could specificy a validity interval for the price individually, but we skip that in here
].
# Dinner placeholder
# One could attach more details on the type of lunch, but that may be out of scope for Yahoo
foo:dinner a gr:ProductOrServicesSomeInstancesPlaceholder;
foaf:page <http://www.example.com/xyz>;
rdfs:comment "Dinner - Various menus, vegetarian, beefy, tofu, you name it"@en.
# Lunch placeholder
# One could attach more details on the type of lunch, but that may be out of scope for Yahoo
foo:lunch a gr:ProductOrServicesSomeInstancesPlaceholder;
foaf:page<http://www.example.com/xyz>;
rdfs:comment "lunch - Quick lunch menues - sandwiches, soups, or pasta"@en.
Miller Sandwich Bar Ltd.
Miller Sandwich Bar Ltd.
The best dinner in town: Various menus, vegetarian, beefy, tofu, you name it - Price range 1200-2500 JPY.
The best lunch sandwiches in town, price range 900-1500 JPY.
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
A good starting point is the tool for creating basic descriptions for any business at
http://www.ebusiness-unibw.org/tools/goodrelations-annotator/
The tool only allows choosing from the first two hierarchy levels of eClassOWL, but you could replace the class IDs in the RDF/XML later on in order to make the description more specific.
A restaurant could use the eClassOWL 5.1.4 category 2520 (Food and services) or one of the following more specific classes:
25-20-01-00 - Restaurant (service), [ eclass:C_AKG508003-gen ]
25-20-01-01 - Restaurant with conventional service (service), [ eclass:C_AKG509003-gen ]
25-20-01-02 - Restaurant with self-service (service), [ eclass:C_AKG510003-gen ]
25-20-01-03 - Cafe (service), 25-20-01-03 [ eclass:C_AKG511003-gen ]
25-20-02-01 - Bar (service), [ eclass:C_AKG515003-gen ]
25-20-02-02 - Bar and entertainment restaurant (service) [ eclass:C_AKG516003-gen ]
25-20-02-03 - Disco and dance restaurant (service) [ eclass:C_AKG517003-gen ]
The proper gr:BusinessFunction would be gr:ProvideService, since eClass classifies restaurants as types of services. (When using an ontology that defines particular types of meals, then the proper business function would be "sell".)
A hotel could use the eClassOWL 5.1.4 category 2512 (Travel Management) or, better, one of the following more specific classes:
25-12-13-01 - Hotel (travel management), [ eclass:C_AKG314003-gen ]
25-12-13-02 - Hotel garni (travel management), [ eclass:C_AKG315003-gen ]
25-12-13-03 - Inn (travel management),[ eclass:C_AKG316003-gen ]
25-12-13-04 - Pension (travel management), [ eclass:C_AKG317003-gen ]
The proper gr:BusinessFunction would be gr:ProvideService, too.
eclass: = http://www.ebusiness-unibw.org/ontologies/eclass/5.1.4/#