RestaurantsVersusTheirReviews

From W3C Wiki
Revision as of 10:29, 11 August 2012 by Zruset (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

see: RestaurantRecommendation, ThingsVersusTheirNames, PersonsVersusTheirDescriptions, OpeningHoursUseCase


Compare these two ways of writing restaurant descriptions in RDF/XML. The latter is tweaked so that the restaurant properties attach to a representation of a restaurant (well, Pub) and not to a document. This more explicit modelling style makes it easier to draw upon independently developed vocabularies and mix them together, since it becomes clearer what we're saying.

Document-centric description

This representation is based around the idea of taking an RSS feed and directly adding properties to the things the RSS feed talks about, ie channels and document items.


<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns="http://purl.org/rss/1.0/"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:wiki="http://purl.org/rss/1.0/modules/wiki/"
 xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
 xmlns:chefmoz="http://chefmoz.org/rdf/elements/1.0/"
 xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
>

<channel rdf:about="TODO-link">
<title>CGI::Wiki Test Site</title>
<link>TODO-link</link>
<description>TODO-description</description>
<dc:rights>TODO-rights</dc:rights>
<dc:date>2003-04-06T13:02:22</dc:date>
<dc:publisher>TODO-publisher</dc:publisher>
<dc:contributor>TODO-contributor</dc:contributor>
<wiki:interwiki>TODO-interwiki</wiki:interwiki>
<items>
 <rdf:Seq>
  <rdf:li rdf:resource="http://the.earth.li/~kake/cgi-bin/cgi-wiki/wiki.cgi?Calthorpe_Arms%2C_WC1X_8JR" />
 </rdf:Seq>
</items>
</channel>

<item rdf:about="http://the.earth.li/~kake/cgi-bin/cgi-wiki/wiki.cgi?Calthorpe_Arms%2C_WC1X_8JR">
<title>Calthorpe Arms, WC1X 8JR</title>
<link>http://the.earth.li/~kake/cgi-bin/cgi-wiki/wiki.cgi?Calthorpe_Arms%2C_WC1X_8JR</link>
<description>TODO-description</description>
<chefmoz:Country>United Kingdom</chefmoz:Country>
<chefmoz:Restaurant>http://the.earth.li/~kake/cgi-bin/cgi-wiki/wiki.cgi?Calthorpe_Arms%2C_WC1X_8JR</chefmoz:Restaurant>
<chefmoz:Zip></chefmoz:Zip>
<chefmoz:City>London</chefmoz:City>
<chefmoz:Neighborhood>Clerkenwell</chefmoz:Neighborhood>
</item>

</rdf:RDF>


World-centric description

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:foaf="http://xmlns.com/foaf/0.1/"
 xmlns:chefmoz="http://chefmoz.org/rdf/elements/1.0/" >
  <rdf:Description rdf:about="http://the.earth.li/~kake/cgi-bin/cgi-wiki/wiki.cgi?Calthorpe_Arms%2C_WC1X_8JR">
    <title>Grubstreet review: Calthorpe Arms, WC1X 8JR</title>
    <!-- more about the document goes here -->
    <foaf:topic>
      <chefmoz:Restaurant>
        <dc:title>Calthorpe Arms, WC1X 8JR</dc:title>
        <chefmoz:Country>United Kingdom</chefmoz:Country>
        <chefmoz:Restaurant>http://the.earth.li/~kake/cgi-bin/cgi-wiki/wiki.cgi?Calthorpe_Arms%2C_WC1X_8JR</chefmoz:Restaurant>
        <chefmoz:City>London</chefmoz:City>
        <chefmoz:Neighborhood>Clerkenwell</chefmoz:Neighborhood>
        <!-- more about the restaurant goes here -->
      </chefmoz:Restaurant>
    </foaf:topic>
  </rdf:Description>
</rdf:RDF>


(EtanWexler thinks that the above example is still heavy on string values where first-class resources are wanted. The Chef Moz vocabulary is frustratingly low in semantics, and it seems easy to fix. What’s with the postal code in the title/name? Seems both unnecessary and inappropriate. As an aside, is there an ontology of political geography?)

Here's what we have at the moment on the grubstreet dev site, under the “Chef Dan RDF/XML” links. It's modified from the example above and some other suggestions DanBri made on IRC. Pre-release code tarball probably has bugs — I'm generating the XML by hand and probably forgetting to escape stuff that might need escaping.


<?xml version="1.0" encoding="UTF-8"?>
  <rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:dcterms="http://purl.org/dc/terms/"
  xmlns:foaf="http://xmlns.com/foaf/0.1/"
  xmlns:wiki="http://purl.org/rss/1.0/modules/wiki/"
  xmlns:chefmoz="http://chefmoz.org/rdf/elements/1.0/" >
  <rdf:Description rdf:about="http://the.earth.li/~kake/cgi-bin/cgi-wiki/wiki.cgi?id=Noto_Restaurant%2C_EC2V_5DS;version=6">
    <dc:title>CGI::Wiki Test Site review: Noto Restaurant, EC2V 5DS</dc:title>
    <dc:date>2003-04-08T00:37:29</dc:date>
    <dcterms:modified>2003-04-08T00:37:29</dcterms:modified>
    <dc:contributor>Wiki Hoover</dc:contributor>
    <dc:source rdf:resource="http://the.earth.li/~kake/cgi-bin/cgi-wiki/wiki.cgi?Noto_Restaurant%2C_EC2V_5DS" />
    <wiki:version>6</wiki:version>
    <foaf:homepage>http://www.noto.co.uk/</foaf:homepage>
    <foaf:topic>
      <chefmoz:Restaurant>
	<dc:title>Noto Restaurant, EC2V 5DS</dc:title>
	<chefmoz:Country>United Kingdom</chefmoz:Country>
        <chefmoz:City>London</chefmoz:City>
	<chefmoz:Zip>EC2V 5DS</chefmoz:Zip>
	<chefmoz:Phone>(020) 7256 9433</chefmoz:Phone>
	<chefmoz:Hours>Lunch : 11:30 - 14:30 , Dinner : 18:00 - 22:00</chefmoz:Hours>
        <chefmoz:Neighborhood>City of London</chefmoz:Neighborhood>
      </chefmoz:Restaurant>
    </foaf:topic>
  </rdf:Description>
</rdf:RDF>


Chat w/ Rigo and Bert

Which direction to prioritise? restaurant centric or doc centric? Links to choice of 'topic' vs 'page' relation.

also what an aggregate might use is different to what the author of a single review might write?

so we need rdf database aggregators to be able to merge either way around...