GoodRelationsRestaurants

From Wiki of the E-Business and Web Science Research Group
Jump to: navigation, search
gr_banner_small.png
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
Vocabulary
Documentation
Developer's Wiki
GoodRelations Cookbook

This page is still work-in-progress.

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#> .
@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.





RDFa

<xml> <!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="text/html; 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.


</body> </html>

</xml>

RDF/XML

<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:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

 <gr:BusinessEntity rdf:about="http://www.example.com/xyz#company">
   <foaf:page 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">
       <foaf:page 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">
       <foaf:page 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">
           <foaf:page 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">
       <foaf:page 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">
           <foaf:page 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>

</xml>

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/#