GoodRelationsRestaurants
From Wiki of the E-Business and Web Science Research Group
|
| GoodRelations is a standardized vocabulary for product, price, and company data that can be embedded into existing static and dynamic Web pages. |
|---|
|
Project Main Page |
Contents |
Overview
On this page, we describe how GoodRelations can be used to make a restaurant and its offers visibible on the Web of Linked Data.
Patterns
N3
# 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#> .
# Business Entity
foo:company
a gr:BusinessEntity ;
rdfs:seeAlso <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 ;
rdfs:seeAlso <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;
rdfs:seeAlso <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;
rdfs:seeAlso <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;
rdfs:seeAlso <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;
rdfs:seeAlso <http://www.example.com/xyz>;
rdfs:comment "lunch - Quick lunch menues - sandwiches, soups, or pasta"@en.
RDFa
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/> <title>Miller Sandwich Bar Ltd.</title> </head> <body> 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. <div xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns="http://www.w3.org/1999/xhtml" xmlns:gr="http://purl.org/goodrelations/v1#" xmlns:foo="http://www.example.com/xyz#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" class="rdf2rdfa"> <div class="description" about="http://www.example.com/xyz#company" typeof="gr:BusinessEntity"> <div rel="gr:hasPOS" resource="http://www.example.com/xyz#restaurant"></div> <div property="gr:legalName" content="Miller Sandwich Bar Ltd." datatype="xsd:string"></div> <div rel="gr:offers"> <div class="description" about="http://www.example.com/xyz#dinner_offer" typeof="gr:Offering"> <div rel="gr:availableAtOrFrom"> <div class="description" about="http://www.example.com/xyz#restaurant" typeof="gr:LocationOfSalesOrServiceProvisioning"> <div rel="gr:hasOpeningHoursSpecification"> <div class="description" about="http://www.example.com/xyz#saturdays" typeof="gr:OpeningHoursSpecification"> <div property="gr:closes" content="14:00:00" datatype="xsd:time"></div> <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Saturday"></div> <div property="gr:opens" content="08:30:00" datatype="xsd:time"></div> </div> </div> <div rel="gr:hasOpeningHoursSpecification"> <div class="description" about="http://www.example.com/xyz#workdays" typeof="gr:OpeningHoursSpecification"> <div property="gr:closes" content="18:00:00" datatype="xsd:time"></div> <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Friday"></div> <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Thursday"></div> <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Wednesday"></div> <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Tuesday"></div> <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Monday"></div> <div property="gr:opens" content="08:00:00" datatype="xsd:time"></div> </div> </div> <div rel="rdfs:seeAlso" resource="http://www.example.com/xyz"></div> </div> </div> <div property="rdfs:comment" content="The best dinner in town: Various menus, vegetarian, beefy, tofu, you name it - Price range 1200-2500 JPY" xml:lang="en"></div> <div rel="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"></div> <div rel="gr:hasPriceSpecification"> <div class="description" typeof="gr:UnitPriceSpecification"> <div property="gr:hasCurrency" content="JPY" datatype="xsd:string"></div> <div property="gr:hasMaxCurrencyValue" content="2500" datatype="xsd:float"></div> <div property="gr:hasMinCurrencyValue" content="1200" datatype="xsd:float"></div> <div property="gr:hasUnitOfMeasurement" content="C62" datatype="xsd:string"></div> <div property="gr:valueAddedTaxIncluded" content="true" datatype="xsd:boolean"></div> </div> </div> <div rel="gr:includes"> <div class="description" about="http://www.example.com/xyz#dinner" typeof="gr:ProductOrServicesSomeInstancesPlaceholder"> <div property="rdfs:comment" content="Dinner - Various menus, vegetarian, beefy, tofu, you name it" xml:lang="en"></div> <div rel="rdfs:seeAlso" resource="http://www.example.com/xyz"></div> </div> </div> <div rel="rdfs:seeAlso" resource="http://www.example.com/xyz"></div> <div property="gr:validFrom" content="2010-03-30T00:00:00+01:00" datatype="xsd:dateTime"></div> <div property="gr:validThrough" content="2011-04-24T00:00:00+01:00" datatype="xsd:dateTime"></div> </div> </div> <div rel="gr:offers"> <div class="description" about="http://www.example.com/xyz#lunch_offer" typeof="gr:Offering"> <div rel="gr:availableAtOrFrom" resource="http://www.example.com/xyz#restaurant"></div> <div property="rdfs:comment" content="The best lunch sandwiches in town, price range 900-1500 JPY" xml:lang="en"></div> <div rel="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"></div> <div rel="gr:hasPriceSpecification"> <div class="description" typeof="gr:UnitPriceSpecification"> <div property="gr:hasCurrency" content="JPY" datatype="xsd:string"></div> <div property="gr:hasMaxCurrencyValue" content="1500" datatype="xsd:float"></div> <div property="gr:hasMinCurrencyValue" content="900" datatype="xsd:float"></div> <div property="gr:hasUnitOfMeasurement" content="C62" datatype="xsd:string"></div> <div property="gr:valueAddedTaxIncluded" content="true" datatype="xsd:boolean"></div> </div> </div> <div rel="gr:includes"> <div class="description" about="http://www.example.com/xyz#lunch" typeof="gr:ProductOrServicesSomeInstancesPlaceholder"> <div property="rdfs:comment" content="lunch - Quick lunch menues - sandwiches, soups, or pasta" xml:lang="en"></div> <div rel="rdfs:seeAlso" resource="http://www.example.com/xyz"></div> </div> </div> <div rel="rdfs:seeAlso" resource="http://www.example.com/xyz"></div> <div property="gr:validFrom" content="2010-03-30T00:00:00+01:00" datatype="xsd:dateTime"></div> <div property="gr:validThrough" content="2011-04-24T00:00:00+01:00" datatype="xsd:dateTime"></div> </div> </div> <div rel="rdfs:seeAlso" resource="http://www.example.com/xyz"></div> </div> </div> </body> </html>
RDF/XML
<?xml version="1.0"?> <rdf:RDF xmlns:gr="http://purl.org/goodrelations/v1#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foo="http://www.example.com/xyz#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <gr:BusinessEntity rdf:about="http://www.example.com/xyz#company"> <rdfs:seeAlso rdf:resource="http://www.example.com/xyz"/> <gr:legalName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Miller Sandwich Bar Ltd.</gr:legalName> <gr:hasPOS> <gr:LocationOfSalesOrServiceProvisioning rdf:about="http://www.example.com/xyz#restaurant"> <rdfs:seeAlso rdf:resource="http://www.example.com/xyz"/> <gr:hasOpeningHoursSpecification> <gr:OpeningHoursSpecification rdf:about="http://www.example.com/xyz#workdays"> <gr:opens rdf:datatype="http://www.w3.org/2001/XMLSchema#time">08:00:00</gr:opens> <gr:closes rdf:datatype="http://www.w3.org/2001/XMLSchema#time">18:00:00</gr:closes> <gr:hasOpeningHoursDayOfWeek rdf:resource="http://purl.org/goodrelations/v1#Monday"/> <gr:hasOpeningHoursDayOfWeek rdf:resource="http://purl.org/goodrelations/v1#Tuesday"/> <gr:hasOpeningHoursDayOfWeek rdf:resource="http://purl.org/goodrelations/v1#Wednesday"/> <gr:hasOpeningHoursDayOfWeek rdf:resource="http://purl.org/goodrelations/v1#Thursday"/> <gr:hasOpeningHoursDayOfWeek rdf:resource="http://purl.org/goodrelations/v1#Friday"/> </gr:OpeningHoursSpecification> </gr:hasOpeningHoursSpecification> <gr:hasOpeningHoursSpecification> <gr:OpeningHoursSpecification rdf:about="http://www.example.com/xyz#saturdays"> <gr:opens rdf:datatype="http://www.w3.org/2001/XMLSchema#time">08:30:00</gr:opens> <gr:closes rdf:datatype="http://www.w3.org/2001/XMLSchema#time">14:00:00</gr:closes> <gr:hasOpeningHoursDayOfWeek rdf:resource="http://purl.org/goodrelations/v1#Saturday"/> </gr:OpeningHoursSpecification> </gr:hasOpeningHoursSpecification> </gr:LocationOfSalesOrServiceProvisioning> </gr:hasPOS> <gr:offers> <gr:Offering rdf:about="http://www.example.com/xyz#lunch_offer"> <rdfs:seeAlso rdf:resource="http://www.example.com/xyz"/> <rdfs:comment xml:lang="en">The best lunch sandwiches in town, price range 900-1500 JPY</rdfs:comment> <gr:includes> <gr:ProductOrServicesSomeInstancesPlaceholder rdf:about="http://www.example.com/xyz#lunch"> <rdfs:seeAlso rdf:resource="http://www.example.com/xyz"/> <rdfs:comment xml:lang="en">lunch - Quick lunch menues - sandwiches, soups, or pasta</rdfs:comment> </gr:ProductOrServicesSomeInstancesPlaceholder> </gr:includes> <gr:hasBusinessFunction rdf:resource="http://purl.org/goodrelations/v1#Sell"/> <gr:validFrom rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2010-03-30T00:00:00+01:00</gr:validFrom> <gr:validThrough rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2011-04-24T00:00:00+01:00</gr:validThrough> <gr:availableAtOrFrom rdf:resource="http://www.example.com/xyz#restaurant"/> <gr:hasPriceSpecification> <gr:UnitPriceSpecification> <gr:hasCurrency rdf:datatype="http://www.w3.org/2001/XMLSchema#string">JPY</gr:hasCurrency> <gr:hasMinCurrencyValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float">900</gr:hasMinCurrencyValuee> <gr:hasMaxCurrencyValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float">1500</gr:hasMaxCurrencyValuee> <gr:hasUnitOfMeasurement rdf:datatype="http://www.w3.org/2001/XMLSchema#string">C62</gr:hasUnitOfMeasurement> <gr:valueAddedTaxIncluded rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</gr:valueAddedTaxIncluded> </gr:UnitPriceSpecification> </gr:hasPriceSpecification> </gr:Offering> </gr:offers> <gr:offers> <gr:Offering rdf:about="http://www.example.com/xyz#dinner_offer"> <rdfs:seeAlso rdf:resource="http://www.example.com/xyz"/> <rdfs:comment xml:lang="en">The best dinner in town: Various menus, vegetarian, beefy, tofu, you name it - Price range 1200-2500 JPY</rdfs:comment> <gr:includes> <gr:ProductOrServicesSomeInstancesPlaceholder rdf:about="http://www.example.com/xyz#dinner"> <rdfs:seeAlso rdf:resource="http://www.example.com/xyz"/> <rdfs:comment xml:lang="en">Dinner - Various menus, vegetarian, beefy, tofu, you name it</rdfs:comment> </gr:ProductOrServicesSomeInstancesPlaceholder> </gr:includes> <gr:hasBusinessFunction rdf:resource="http://purl.org/goodrelations/v1#Sell"/> <gr:validFrom rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2010-03-30T00:00:00+01:00</gr:validFrom> <gr:validThrough rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2011-04-24T00:00:00+01:00</gr:validThrough> <gr:availableAtOrFrom rdf:resource="http://www.example.com/xyz#restaurant"/> <gr:hasPriceSpecification> <gr:UnitPriceSpecification> <gr:hasCurrency rdf:datatype="http://www.w3.org/2001/XMLSchema#string">JPY</gr:hasCurrency> <gr:hasMinCurrencyValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float">1200</gr:hasMinCurrencyValuee> <gr:hasMaxCurrencyValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float">2500</gr:hasMaxCurrencyValuee> <gr:hasUnitOfMeasurement rdf:datatype="http://www.w3.org/2001/XMLSchema#string">C62</gr:hasUnitOfMeasurement> <gr:valueAddedTaxIncluded rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</gr:valueAddedTaxIncluded> </gr:UnitPriceSpecification> </gr:hasPriceSpecification> </gr:Offering> </gr:offers> </gr:BusinessEntity> </rdf:RDF>
Additional Resources and References
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/#

