1 / 79

Internet Technologies

Internet Technologies. The Semantic Web and The Resource Description Framework (RDF and RDFa). RDF and RDFa. Notes from three articles on course schedule: “ What is RDF ” by Tim Bray and Joshua Tauberer, the “ RDFa Primer ” from W3C and from Google ’ s adoption of RDFa and Microformats.

kirkan
Télécharger la présentation

Internet Technologies

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Internet Technologies The Semantic Web and The Resource Description Framework (RDF and RDFa) 95-733 Internet Technologies

  2. RDF and RDFa Notes from three articles on course schedule: “What is RDF” by Tim Bray and Joshua Tauberer, the “RDFa Primer” from W3C and from Google’s adoption of RDFa and Microformats. 95-733 Internet Technologies

  3. First: Let’s get some RDF • curl --include --location –header "Accept:application/rdf+xml" http://dbpedia.org/resource/Yukihiro_Matsumoto • Can we learn anything from the result? • Is there any other data we can learn from? 95-733 Internet Technologies

  4. Each of these stores many many RDF triples. See www.linkeddata.org 95-733 Internet Technologies

  5. So, what’s a “triple”? A triple is a statement in some RDF format. The next slides shows how we can combine some triples into Knowledge Graph. 95-733 Internet Technologies

  6. A Knowledge Graph 95-733 Internet Technologies

  7. Triples Start Node Edge Label End Node vincent_donofrio starred_in law_&_order_ci law_&_order_ci is_a tv_show the_thirteenth_floor similar_plot_as the_matrix 95-733 Internet Technologies

  8. Notation 3 (N3) or Turtle Format @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ex: <http://www.example.org/> . ex:vincent_donofrio ex:starred_in ex:law_and_order_ci . ex:law_and_order_ci rdf:type ex:tv_show . ex:the_thirteenth_floor ex:similar_plot_as ex:the_matrix . 95-733 Internet Technologies

  9. RDF/XML <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://www.example.org/"> <rdf:Description rdf:about="http://www.example.org/vincent_donofrio"> <ex:starred_in> <ex:tv_show rdf:about="http://www.example.org/law_and_order_ci" /> </ex:starred_in> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/the_thirteenth_floor"> <ex:similar_plot_as rdf:resource="http://www.example.org/the_matrix" /> </rdf:Description> </rdf:RDF> 95-733 Internet Technologies

  10. Another RDF/XML <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:geo="http://www. w3.org/2003/01/geo/wgs84_pos#" xmlns:edu="http://www.example.org/"> <rdf:Description rdf:about="http://www.princeton.edu"> <geo:lat>40.35</geo:lat> <geo:long>-74.66</geo:long> <edu:hasDept rdf:resource="http://www.cs.princeton.edu" dc:title="Department of Computer Science"/> </rdf:Description> </rdf:RDF> 95-733 Internet Technologies

  11. As A Table Subject Predicate Object ----------------------------- ----------- -------- <http://www.princeton.edu> edu:hasDept <http://www.cs.princeton.edu> <http://www.princeton.edu> geo:lat "40.35" <http://www.princeton.edu> geo:long "-74.66" <http://www.cs.princeton.edu> dc:title "Department of Computer Science" 95-733 Internet Technologies

  12. Notation 3 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix geo: <http://www. w3.org/2003/01/geo/wgs84_pos#> . @prefix edu: <http://www.example.org/> . <http://www.princeton.edu> geo:lat "40.35" ; geo:long "-74.66" . <http://www.cs.princeton.edu> dc:title "Department of Computer Science" . <http://www.princeton.edu> edu:hasDept <http://www.cs.princeton.edu> . 95-733 Internet Technologies

  13. RDFa and RDF • RDFa is a lightweight version of RDF for web pages. • RDF stands on its own. • We’ll first look at RDFa and then RDF. • RDFa is being used today by search engines like Google and sites like Best Buy. 95-733 Internet Technologies

  14. From the RDFa W3C Primer “When web data meant for humans is augmented with hints meant for computer programs, these programs become significantly more helpful.” 95-733 Internet Technologies

  15. XHTML Without and With RDFa All content on this site is licensed under <a href="http://creativecommons.org/licenses/by/3.0/"> a Creative Commons License </a> All content on this site is licensed under <a rel="license" href="http://creativecommons.org/licenses/by/3.0/"> a Creative Commons License </a>. The rel, in a link, describes the relationship between the current page and the linked page. 95-733 Internet Technologies

  16. A Link with a Flavor 95-733 Internet Technologies

  17. Labeling Title and Author <div> <h2>The trouble with Bob</h2> <h3>Alice</h3> ... </div> <div xmlns:dc="http://purl.org/dc/elements/1.1/"> <h2 property="dc:title">The trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> ... </div> RDFa introduces the property attribute. What kind of title? A title of a person or a title to land or a title of a work? 95-733 Internet Technologies

  18. In RDFa, all property names are, in fact, URLs. 95-733 Internet Technologies

  19. Multiple Items Per Page RDFa provides @about, an attribute for specifying the exact URL to which the contained RDFa markup applies <div xmlns:dc="http://purl.org/dc/elements/1.1/"> <div about="/alice/posts/trouble_with_bob"> <h2 property="dc:title">The trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> ... </div> <div about="/alice/posts/jos_barbecue"> <h2 property="dc:title">Jo's Barbecue</h2> <h3 property="dc:creator">Eve</h3> ... </div> </div> 95-733 Internet Technologies

  20. As a Diagram 95-733 Internet Technologies

  21. Alice Gives Bob Credit <div about="/alice/posts/trouble_with_bob"> <h2 property="dc:title">The trouble with Bob</h2> The trouble with Bob is that he takes much better photos than I do: <div about="http://example.com/bob/photos/sunset.jpg"> <img src="http://example.com/bob/photos/sunset.jpg" /> <span property="dc:title">Beautiful Sunset</span> by <span property="dc:creator">Bob</span>. </div> </div> The inner about overrides the outer about. 95-733 Internet Technologies

  22. As A Graph 95-733 Internet Technologies

  23. Blog Contact Info <div> <p> Alice Birpemswick </p> <p> Email: <a href="mailto:alice@example.com">alice@example.com</a> </p> <p> Phone: <a href="tel:+1-617-555-7332">+1 617.555.7332</a> </p> </div> This is mainly useful for viewing. 95-733 Internet Technologies

  24. Blog w/FOAF Contact Info The Dublin core has no vocabulary for describing friendships. But foaf does. <div typeof="foaf:Person" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <p property="foaf:name">Alice Birpemswick</p> <p>Email: <a rel="foaf:mbox" href="mailto:alice@example.com"> alice@example.com</a> </p> <p> Phone: <a rel="foaf:phone" href="tel:+1-617-555-7332">+1 617.555.7332</a> </p> </div> The typeof is an RDFa attribute that is specifically meant to declare a new data item with a certain type. 95-733 Internet Technologies

  25. As A Graph Alice didn't specify @about like she did when adding blog entry metadata. What is she associating these properties with, then? In fact, the @typeof on the enclosing div implicitly sets the subject of the properties marked up within that div. The name, email address, and phone number are associated with a new node of type foaf:Person. This node has no URL to identify it, so it is called a blank node. 95-733 Internet Technologies

  26. Social Networks <div> <ul> <li> <a href="http://example.com/bob/">Bob</a> </li> <li> <a href="http://example.com/eve/">Eve</a> </li> <li> <a href="http://example.com/manu/">Manu</a> </li> </ul> </div> These people are all friends of Alice and she Includes them in her normal HTML blog. 95-733 Internet Technologies

  27. Adding RDFa First,describe these as Persons. <div xmlns:foaf="http://xmlns.com/foaf/0.1/"> <ul> <li typeof="foaf:Person"> <a href="http://example.com/bob/">Bob</a> </li> <li typeof="foaf:Person"> <a href="http://example.com/eve/">Eve</a> </li> <li typeof="foaf:Person"> <a href="http://example.com/manu/">Manu</a> </li> </ul> </div> 95-733 Internet Technologies

  28. Add Homepages Use rel for the link relationships. <div xmlns:foaf="http://xmlns.com/foaf/0.1/"> <ul> <li typeof="foaf:Person"> <a rel="foaf:homepage" href="http://example.com/bob/">Bob</a> </li> <li typeof="foaf:Person"> <a rel="foaf:homepage" href="http://example.com/eve/">Eve</a> </li> <li typeof="foaf:Person"> <a rel="foaf:homepage" href="http://example.com/manu/">Manu</a> </li> </ul> </div> 95-733 Internet Technologies

  29. Describe Text as Names <div xmlns:foaf="http://xmlns.com/foaf/0.1/"> <ul> <li typeof="foaf:Person"> <a property="foaf:name" rel="foaf:homepage" href="http://example.com/bob/">Bob</a> </li> <li typeof="foaf:Person"> <a property="foaf:name" rel="foaf:homepage" href="http://example.com/eve/">Eve</a> </li> <li typeof="foaf:Person"> <a property="foaf:name" rel="foaf:homepage" href="http://example.com/manu/">Manu</a> </li> </ul> </div> 95-733 Internet Technologies

  30. Claim in Primer “Alice is ecstatic that, with so little additional markup, she's able to fully express both a pleasant human-readable page and a machine-readable dataset.” 95-733 Internet Technologies

  31. Using foaf:knows <div xmlns:foaf="http://xmlns.com/foaf/0.1/" about="#me" rel="foaf:knows"> <ul> <li typeof="foaf:Person"> <a property="foaf:name" rel="foaf:homepage" href="http://example.com/bob">Bob</a> </li> <li typeof="foaf:Person"> <a property="foaf:name" rel="foaf:homepage" href="http://example.com/eve">Eve</a> </li> <li typeof="foaf:Person"> <a property="foaf:name" rel="foaf:homepage" href="http://example.com/manu">Manu</a> </li> </ul> </div> Alice knows these people with these names and homepages. 95-733 Internet Technologies

  32. 95-733 Internet Technologies

  33. Building Custom Vocabularies 1. Selecting a URL where the vocabulary will reside, e.g. http://example.com/photos/vocab#. 2. Distributing an RDF document, at that URL, which defines the classes and properties that make up the vocabulary. For example, Alice may want to define classes Photo and Camera, as well as the property takenWith that relates a photo to the camera with which it was taken. 3. Using the vocabulary in XHTML+RDFa with the usual prefix declaration mechanism, e.g. xmlns:photo="http://example.com/photos/vocab#", and typeof="photo:Camera". 95-733 Internet Technologies

  34. Microformats Compete with RDFa Not from a standards body. A grassroots effort since 2004. hCard Business card data XFN Friends and contacts hCalendar Events hReview Review movies, books, etc.. “When web data meant for humans is augmented with hints meant for computer programs, these programs become significantly more helpful.” 95-733 Internet Technologies

  35. Microformats Compete with RDFa As an exercise, visit: http://microformats.org and build an hCard and an hCalendar. Use hCard creator and hCalendar creator. Quiz. What information is requested by the XFN tool? 95-733 Internet Technologies

  36. Google adopted Microformats and RDFa in 2009 Why? In support of “Rich Snippits”. “Google Rich Snippets provides structured data in Google search result snippets. Webmasters can provide this structured data by using microformats or RDFa to mark up their web pages. “ See the Rich Snippit Testing Tool at : http://www.google.com/webmasters/tools/richsnippets 95-733 Internet Technologies

  37. Rich Snippits “This kind of markup is designed for sites containing specific types of structured data. Google currently supports the following information types: reviews, people profiles, business listings, and events.” From: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=99170 95-733 Internet Technologies

  38. Examples from Google – A Review of a Pizza Joint The old way: <div> L’Amourita Pizza Reviewed by Ulysses Grant on Jan 6. Delicious, tasty pizza on Eastlake! L'Amourita serves up traditional wood-fired Neapolitan-style pizza, brought to your table promptly and without fuss. An ideal neighborhood pizza joint. Rating: 4.5 </div> : 95-733 Internet Technologies

  39. Examples from Google – A Review of a Pizza Joint With RDFa: <div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Review"> <span property="v:itemreviewed">L’Amourita Pizza</span> Reviewed by <span property="v:reviewer">Ulysses Grant</span> on <span property="v:dtreviewed" content="2009-01-06">Jan 6</span>. <span property="v:summary">Delicious, tasty pizza on Eastlake!</span> <span property="v:description">L'Amourita serves up traditional wood-fired Neapolitan-style pizza, brought to your table promptly and without fuss. An ideal neighborhood pizza joint. </span> Rating: <span property="v:rating">4.5</span> </div> Be sure to visit: http://rdf.data-vocabulary.org/rdf.xml 95-733 Internet Technologies

  40. Examples from Google – A Review of a Pizza Joint With Microformats: <div class="hreview"> <span class="item"> <span class="fn">L’Amourita Pizza</span> </span> Reviewed by <span class="reviewer">Ulysses Grant</span> on <span class="dtreviewed"> Jan 6<span class="value-title" title="2009-01-06"> </span> <span class="summary">Delicious, tasty pizza on Eastlake!</span> <span class="description">L'Amourita serves up traditional wood-fired Neapolitan-style pizza, brought to your table promptly and without fuss. An ideal neighborhood pizza joint. </span> Rating: <span class="rating">4.5</span> </div> 95-733 Internet Technologies

  41. Examples from Google – People The old way: <div> My name is Bob Smith, but people call me Smithy. Here is my home page: <a href="http://www.example.com">www.example.com</a>. I live in Albuquerque, NM and work as an engineer at ACME Corp. My friends: <a href="http://darryl-blog.example.com">Darryl</a>, <a href="http://edna-blog.example.com">Edna</a> </div> 95-733 Internet Technologies

  42. Examples from Google – People In RDFa: <div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Person"> My name is <span property="v:name">Bob Smith</span>, but people call me <span property="v:nickname">Smithy</span>. Here is my homepage: <a href=http://www.example.com rel="v:url"> www.example.com</a>. I live in <span rel="v:address"> <span typeof="v:Address"> <span property="v:locality">Albuquerque</span>, <span property="v:region">NM</span> </span> </span> and work as an <span property="v:title">engineer</span> at <span property="v:affiliation">ACME Corp</span>. My friends: <a href="http://darryl-blog.example.com" rel="v:friend">Darryl</a>, <a href="http://edna-blog.example.com" rel="v:friend">Edna</a> </div> 95-733 Internet Technologies

  43. Examples from Google – People In Microformats: <div class="vcard"> My name is <span class="fn">Bob Smith</span>, but people call me <span class="nickname">Smithy</span>. Here is my home page: <a href=http://www.example.com class="url">www.example.com</a>. I live in <span class="adr"> <span class="locality">Albuquerque</span>, <span class="region">NM</span> </span> and work as an <span class="title">engineer</span> at <span class="org">ACME Corp</span>. My friends: <a href=http://darryl-blog.example.com rel="friend">Darryl</a>, <a href="http://edna-blog.example.com" rel="friend">Edna</a> </div> 95-733 Internet Technologies

  44. Examples from Google – Events The old way: <div> <a href="http://www.example.com/events/spinaltap">Spinal Tap</a> <img src="spinal_tap.jpg" /> After their highly-publicized search for a new drummer, Spinal Tap kicks off their latest comeback tour with a San Francisco show. When: Oct 15, 7:00PM—9:00PM Where: Warfield Theatre, 982 Market St, San Francisco, CA Category: Concert </div> 95-733 Internet Technologies

  45. Examples from Google – Events In RDFa: <div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Event">    <a href="http://www.example.com/events/spinaltap" rel="v:url" property="v:summary"> Spinal Tap</a>     <img src="spinal_tap.jpg" rel="v:photo" />     <span property="v:description">After their highly-publicized search for a new drummer, Spinal Tap kicks off their latest comeback tour with a San Francisco show. </span>   When:     <span property="v:startDate" content="2009-10-15T19:00-08:00">Oct 15, 7:00PM</span>   <span property="v:endDate" content="2009-10-15T21:00-08:00">9:00PM</span>    Where:     <span rel="v:location">      <span typeof="v:Organization">        <span property="v:name">Warfield Theatre</span>,        95-733 Internet Technologies

  46. Examples from Google – Events <span rel="v:address">          <span typeof="v:Address">            <span property="v:street-address">982 Market St</span>,         <span property="v:locality">San Francisco</span>,         <span property="v:region">CA</span>      </span>       </span>  <span rel="v:geo">          <span typeof="v:Geo">             <span property="v:latitude" content="37.774929" ></span>            <span property="v:longitude" content="-122.419416" ></span> </span> </span> </span> </span>   Category: <span property="v:eventType">Concert</span> </div> 95-733 Internet Technologies

  47. Examples from Google – Events In Microformat: <div class="vevent"> <a href="http://www.example.com/events/spinaltap" class="url summary">Spinal Tap</a> <img src="spinal_tap.jpg" class="photo" /> <span class="description">After their highly-publicized search for a new drummer, Spinal Tap kicks off their latest comeback tour with a San Francisco show.</span> When: <span class="dtstart"> Oct 15, 7:00PM<span class="value-title" title="2009-10-15T19:00-08:00"> </span> </span> <span class="dtend"> 9:00PM<span class="value-title" title="2009-10-15T21:00-08:00"> </span> </span> Where: <div class="location vcard"> <span class="fn org">Warfield Theatre</span>, <span class="adr"> <span class="street-address">982 Market St</span>, <span class="locality">San Francisco</span>, <span class="region">CA</span> </span> 95-733 Internet Technologies

  48. Examples from Google – Events <span class="geo"> <span class="latitude"> <span class="value-title" title="37.774929" > </span> </span> <span class="longitude"> <span class="value-title" title="-122.419416"> </span> </span> </span> </div> Category: <span class="category">Concert</span> </div> 95-733 Internet Technologies

  49. Quiz For each RDFa document, draw a knowledge graph. For each RDFa attribute, trace its meaning with the ontology at http://rdf.data-vocabulary.org/#. 95-733 Internet Technologies

  50. RDF On Its Own • RDFa is RDF in XHTML. • The Resource Description Framework (RDF) is a W3C recommendation for • an XML encoding of metadata. • A standard for encoding metadata is important for finding and • describing resources. A “resource” is anything with a URI. This would • include people, books, devices and so on. • Card catalogs, for example, have been used for years to record metadata • about the collection of materials in libraries. Is Google the card catalogue • for the web? Are we done? 95-733 Internet Technologies

More Related