The Semantic Web in ActionKennissystemen, November 2009<br />Rinke Hoekstra<br />
Overview<br />The Semantic Web<br />Languages and Integration<br />Storage and Querying<br />Linked (Open) Data<br />Scala...
The Semantic Web Ideology<br />Identity is everything<br />Partial solutions are great too!<br />Layer cake<br />11/30/09<...
Semantic Web<br /><ul><li>Intially
`Metadata’ for web pages
Since ~2006
`Web of Data’
Semantic web as data source in its own right
Linked Data
A ‘Databaseesque’ Web
RDF Triple stores
Query languages</li></ul>11/30/09<br />4<br />
Languages<br /><ul><li>Multiple Languages
RDF, RDFS and OWL
Multiple Syntaxes</li></ul>RDF/XML, Turtle (Restricted N3), Ntriple<br />Functional Syntax, Manchester Syntax, OWL XML<br ...
Triples <subject, predicate,object>
Distributed
Always about something else
... but can be about other RDF triples as well.</li></ul>11/30/09<br />5<br />
Languages: RDF(S)/XML<br />&lt;rdf:RDF<br />xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”<br />xmlns:rdfs=&quot;...
Languages: Turtle<br />@prefix rdf:&lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;.<br />@prefix rdfs:&lt;http://www.w...
Languages: FS<br />11/30/09<br />8<br />Namespace(=&lt;http://www.uva.nl/people#&gt;)<br />Namespace(owl=&lt;http://www.w3...
Integration<br />How to add this ‘meta’ to my ‘data’?<br />Three options:<br />Old fashioned HTML:&lt;link rel=&apos;meta&...
Integration: 303 See Other (Demo)<br />http://www.metalex.eu/metalex<br />11/30/09<br />10<br />
Integration: Inline <br />RDFa<br />Attributes on XHTML elements<br />http://www.w3.org/TR/xhtml-rdfa-primer<br />GRDDL<br...
Integration: RDFa Example<br /><ul><li>In XHTML:</li></ul>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;...
Integration: GRDDL<br />In HTML/XML instance documents:<br />&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;<br />...
Storage (on the web)<br />As documents<br />.rdf, .n3, .turtle, .html<br />RDF triple stores<br />Sesame, Joseki, 4Store, ...
Querying<br />Originally many languages<br />SPARQL, nRQL, SeRQL, etc. <br />SPARQL: <br />http://www.w3.org/TR/rdf-sparql...
Querying (2)<br />SPARQL 1.0<br />select, construct, from, optional, filter<br />Negation via unbound variable<br />SPARQL...
The Web of Data<br />… does it exist?<br />11/30/09<br />17<br />
Linked Open Data<br />11/30/09<br />18<br />
11/30/09<br />19<br />November 2009: 13.1 Billion triples, 142 Million links <br />
But there’s more<br /><ul><li>Late additions…
New York Times archives
Now 5k names, with 4 references to LOD
Will grow to > 30k
Reuters
OpenCalais automated tagging
Soon to come
Data.gov (via RPI)
Whitehouse.gov (via Drupal)
Data.gov.uk (directly)
European Parliament (MetaLex+RDFa)</li></ul>11/30/09<br />20<br />
Upcoming SlideShare
Loading in...5
×

Ks2009 Semanticweb In Action

724

Published on

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
724
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Ks2009 Semanticweb In Action

  1. 1. The Semantic Web in ActionKennissystemen, November 2009<br />Rinke Hoekstra<br />
  2. 2. Overview<br />The Semantic Web<br />Languages and Integration<br />Storage and Querying<br />Linked (Open) Data<br />Scalability issues<br />Browsing and Viewing<br />DEMOs<br />… if there’s time …<br />OWL in Action<br />11/30/09<br />2<br />
  3. 3. The Semantic Web Ideology<br />Identity is everything<br />Partial solutions are great too!<br />Layer cake<br />11/30/09<br />3<br />OWL<br />
  4. 4. Semantic Web<br /><ul><li>Intially
  5. 5. `Metadata’ for web pages
  6. 6. Since ~2006
  7. 7. `Web of Data’
  8. 8. Semantic web as data source in its own right
  9. 9. Linked Data
  10. 10. A ‘Databaseesque’ Web
  11. 11. RDF Triple stores
  12. 12. Query languages</li></ul>11/30/09<br />4<br />
  13. 13. Languages<br /><ul><li>Multiple Languages
  14. 14. RDF, RDFS and OWL
  15. 15. Multiple Syntaxes</li></ul>RDF/XML, Turtle (Restricted N3), Ntriple<br />Functional Syntax, Manchester Syntax, OWL XML<br /><ul><li>RDF
  16. 16. Triples <subject, predicate,object>
  17. 17. Distributed
  18. 18. Always about something else
  19. 19. ... but can be about other RDF triples as well.</li></ul>11/30/09<br />5<br />
  20. 20. Languages: RDF(S)/XML<br />&lt;rdf:RDF<br />xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”<br />xmlns:rdfs=&quot;http://www.w3.org/TR/rdf-schema/&quot;<br />xmlns:owl=“http://www.w3.org/2002/07/owl#”<br />xmlns:uva=“http://www.uva.nl/rdf#”<br />xmlns=“http://www.uva.nl/people”&gt;<br /> &lt;rdf:Descriptionrdf:ID=“#radboud”&gt;<br /> &lt;rdf:typerdf:resource=“http://www.uva.nl/rdf#AssociateProfessor”/&gt;<br /> &lt;uva:name&gt;RadboudWinkels&lt;/uva:name&gt;<br /> &lt;uva:teachesrdf:resource=“http://www.uva.nl/courses#ks2009”/&gt;<br /> &lt;/rdf:Description&gt;<br /> &lt;uva:Courserdf:about=“http://www.uva.nl/courses#ks2009”/&gt;<br /> &lt;rdfs:Classrdf:about=“http://www.uva.nl/rdf#AssociateProfessor”&gt;<br /> &lt;rdfs:subClassOfrdf:resource=“http://www.uva.nl/rdf#StaffMember”/&gt;<br /> &lt;/rdfs:Class&gt;<br />&lt;owl:ObjectPropertyrdf:about=“http://www.uva.nl/rdf#teaches”&gt;<br /> &lt;rdfs:domainrdf:resource=“http://www.uva.nl/rdf#Professor”/&gt;<br /> &lt;rdfs:rangerdf:resource=“http://www.uva.nl/rdf#Course”/&gt;<br /> &lt;/owl:ObjectProperty&gt;<br />&lt;/rdf:RDF&gt;<br />11/30/09<br />6<br />
  21. 21. Languages: Turtle<br />@prefix rdf:&lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;.<br />@prefix rdfs:&lt;http://www.w3.org/TR/rdf-schema/&gt;.<br />@prefix owl:&lt;http://www.w3.org/2002/07/owl#&gt;.<br />@prefix uva:&lt;http://www.uva.nl/rdf#&gt;.<br />@prefix courses:&lt;http://www.uva.nl/courses#&gt;.<br />@prefix :&lt;http://www.uva.nl/people#&gt;.<br />uva:AssociateProfessor a rdfs:Class;<br />rdfs:subClassOfuva:StaffMember.<br />uva:teaches aowl:ObjectProperty;<br />rdfs:domainuva:AssociateProfessor;<br />rdfs:rangeuva:Course.<br />:radboud a uva:AssociateProfessor;<br />uva:name ”RadboudWinkels”^^xsd:string;<br />uva:teachescourses:ks2009.<br />courses:ks2009 a uva:Course.<br />11/30/09<br />7<br />
  22. 22. Languages: FS<br />11/30/09<br />8<br />Namespace(=&lt;http://www.uva.nl/people#&gt;)<br />Namespace(owl=&lt;http://www.w3.org/2002/07/owl#&gt;)<br />Namespace(uva=&lt;http://www.uva.nl/rdf#&gt;)<br />Namespace(courses=&lt;http://www.uva.nl/courses#&gt;)<br />Declaration(Class(uva:Course))<br />Declaration(Class(uva:StaffMember))<br />Declaration(Class(uva:AssociateProfessor))<br />SubClassOf(uva:AssociateProfessoruva:StaffMember)<br />Declaration(DataProperty(uva:name))<br />Declaration(ObjectProperty(uva:teaches))<br />ObjectPropertyDomain(uva:teachesuva:AssociateProfessor)<br />ObjectPropertyRange(uva2:teaches uva:Course)<br />Declaration(Individual(courses:ks2009))<br />Declaration(Individual(radboud))<br />ObjectPropertyAssertion(uva:teachesradboud courses:ks2009)<br />DataPropertyAssertion(uva:nameradboud &quot;RadboudWinkels&quot;)<br />
  23. 23. Integration<br />How to add this ‘meta’ to my ‘data’?<br />Three options:<br />Old fashioned HTML:&lt;link rel=&apos;meta&apos; type=&apos;application/rdf+xml&apos; href=&apos;http://www.leibnizcenter.org/~hoekstra/foaf.rdf&apos; title=&apos;FOAF&apos;&gt; <br />HTTP 303 `see other’http://www.w3.org/TR/swbp-vocab-pub/<br />Inline (RDFa/GRDDL)<br />11/30/09<br />9<br />
  24. 24. Integration: 303 See Other (Demo)<br />http://www.metalex.eu/metalex<br />11/30/09<br />10<br />
  25. 25. Integration: Inline <br />RDFa<br />Attributes on XHTML elements<br />http://www.w3.org/TR/xhtml-rdfa-primer<br />GRDDL<br />Gleaning Resource Descriptions from Dialects of Languages<br />Explicit reference to (XSL) transformation<br />http://www.w3.org/TR/grddl/<br />11/30/09<br />11<br />
  26. 26. Integration: RDFa Example<br /><ul><li>In XHTML:</li></ul>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML+RDFa 1.0//EN&quot;<br /> &quot;http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd&quot;&gt;<br />&lt;html xmlns:cal=&quot;http://www.w3.org/2002/12/cal/ical#&quot;&gt;<br /> &lt;head&gt;&lt;title&gt;Jo&apos;s Friends and Family Blog&lt;/title&gt;&lt;/head&gt;<br /> &lt;body&gt;<br /> &lt;p instanceof=&quot;cal:Vevent&quot;&gt;<br /> I&apos;m holding<br /> &lt;span property=&quot;cal:summary&quot;&gt;one last summer Barbecue&lt;/span&gt;,<br /> on<br /> &lt;span property=&quot;cal:dtstart&quot; content=&quot;20070916T1600-0500&quot;&gt;<br /> September 16th at 4pm.<br /> &lt;/span&gt;<br /> &lt;/p&gt;<br /> &lt;/body&gt;<br />&lt;/html&gt;<br /><ul><li>In RDF:</li></ul>_:blanknode0<br /> rdf:type cal:Vevent; <br /> cal:summary ”one last summer Barbecue&quot;;<br /> cal:dtstart &quot;20070916T1600-0500&quot; .<br />11/30/09<br />12<br />
  27. 27. Integration: GRDDL<br />In HTML/XML instance documents:<br />&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;<br /> xmlns:grddl=&apos;http://www.w3.org/2003/g/data-view#&apos;<br /> grddl:transformation=&quot;glean_title.xsl<br /> http://www.w3.org/2001/sw/grddl-wg/td/getAuthor.xsl”&gt;<br />In XML Schema documents:<br /> &lt;xsd:annotation&gt;<br /> &lt;xsd:appinfo&gt;<br /> &lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;<br /> &lt;rdf:Description rdf:about=&quot;http://www.metalex.eu/latest&quot;&gt;<br /> &lt;grddl:namespaceTransformation<br /> rdf:resource=”http://www.metalex.eu/grddl/metalex2owl.xsl&quot; /&gt;<br /> &lt;/rdf:Description&gt;<br /> &lt;/rdf:RDF&gt;<br /> &lt;/xsd:appinfo&gt;<br /> &lt;/xsd:annotation&gt;<br />11/30/09<br />13<br />
  28. 28. Storage (on the web)<br />As documents<br />.rdf, .n3, .turtle, .html<br />RDF triple stores<br />Sesame, Joseki, 4Store, AllegroGraph, OpenLink Virtuoso, SDB/TDB, Open Calais, SWI Prolog <br />Reasoners ‘on top’, or via DIG<br />Pellet, OWLIM, etc.<br />SPARQL Endpoints<br />Results as JSON, XML, CSV etc.<br />11/30/09<br />14<br />
  29. 29. Querying<br />Originally many languages<br />SPARQL, nRQL, SeRQL, etc. <br />SPARQL: <br />http://www.w3.org/TR/rdf-sparql-query/<br />Example<br />PREFIX course: &lt;http://www.uva.nl/courses#&gt;<br />PREFIX uva: &lt;http://www.uva.nl/rdf#&gt;<br />SELECT ?name<br />WHERE<br /> { ?x uva:teaches course:ks2007.<br /> ?x uva:name ?name }<br />?x binds with &lt;http://www.uva.nl/people#radboud&gt; <br />?name binds with “Radboud Winkels”^^xsd:string<br />11/30/09<br />15<br />
  30. 30. Querying (2)<br />SPARQL 1.0<br />select, construct, from, optional, filter<br />Negation via unbound variable<br />SPARQL 1.1<br />update, negation, aggregation, subqueries <br />11/30/09<br />16<br />
  31. 31. The Web of Data<br />… does it exist?<br />11/30/09<br />17<br />
  32. 32. Linked Open Data<br />11/30/09<br />18<br />
  33. 33. 11/30/09<br />19<br />November 2009: 13.1 Billion triples, 142 Million links <br />
  34. 34. But there’s more<br /><ul><li>Late additions…
  35. 35. New York Times archives
  36. 36. Now 5k names, with 4 references to LOD
  37. 37. Will grow to > 30k
  38. 38. Reuters
  39. 39. OpenCalais automated tagging
  40. 40. Soon to come
  41. 41. Data.gov (via RPI)
  42. 42. Whitehouse.gov (via Drupal)
  43. 43. Data.gov.uk (directly)
  44. 44. European Parliament (MetaLex+RDFa)</li></ul>11/30/09<br />20<br />
  45. 45. Scalability<br />How to deal with massive amounts of data?<br />Consequences for reasoning<br />Billion Triple Challenge<br />(864.8 Million Triples)<br />Consequences for querying<br />Table lookups, joins etc.<br />… and what about …<br />Dealing with change, provenance, trust?<br />11/30/09<br />21<br />
  46. 46. A rough idea…<br />I can crash a DL reasoner using an ontology of ~15 classes and 5 individuals (honestly)<br />What if my ontology contains thousands of classes and billions of individuals?<br />11/30/09<br />22<br />
  47. 47. Reasoning<br /><ul><li>When?
  48. 48. Realtime vs. in advance
  49. 49. Lightweight reasoning (RDFS, OWL 2 RL)
  50. 50. Implementable using forward chaining rules
  51. 51. Still problems with scalability
  52. 52. Distributed reasoning (DAS-3)
  53. 53. MaRVIN
  54. 54. ‘SpeedDate’ distrubution of triples across nodes
  55. 55. MapReduce
  56. 56. Full closure of BTC in 57 minutes
  57. 57. Output: 30B triples
  58. 58. And what to do with the results?</li></ul>11/30/09<br />23<br />
  59. 59. 2 Degrees from Kevin Bacon<br />PREFIX p: http://dbpedia.org/property/<br />SELECT ?film1 ?actor1 ?film2 ?actor2<br />WHERE { <br /> ?film1 p:starring &lt;http://dbpedia.org/resource/Kevin_Bacon&gt; . <br /> ?film1 p:starring ?actor1 . <br /> ?film2 p:starring ?actor1 . <br /> ?film2 p:starring ?actor2 .}<br />11/30/09<br />24<br />DBPedia: 150M triples<br />
  60. 60. Rough idea…<br /><ul><li>1 Billion triples in MySQL
  61. 61. Load time
  62. 62. … a couple of hours
  63. 63. Simple table lookup (one-variable query)
  64. 64. … about 5 minutes
  65. 65. Single join (two-variable query)
  66. 66. … a couple of hours
  67. 67. Better indexes?
  68. 68. Harddisk access times are the bottleneck (9ms)
  69. 69. More targeted reasoning, querying, federation.</li></ul>11/30/09<br />25<br />
  70. 70. Let’s suppose that all works<br />Viewing the web of data<br />11/30/09<br />26<br />
  71. 71. Browsing and Viewing<br />How to unlock your RDF/OWL to users?<br />Custom applications (PizzaFinder)<br />Generic RDF Browsers (Faceted Browsing)<br />How to present your RDF/OWL to users?<br />Custom applications (TopBraid Geo)<br />Generic RDF Visualisation (Fresnel Lenses)<br />11/30/09<br />27<br />
  72. 72. Browsing: Facets<br />Multi-dimensional search<br />User filters available information<br />Context dependent<br />Facet<br />UI element<br />Values of a property<br />Number of results<br />Query building<br />11/30/09<br />28<br />
  73. 73. Browsing<br />MIT Longwell<br />http://simile.mit.edu/longwell/demo/libraries<br />/facet<br />http://slashfacet.semanticweb.org<br />Flamenco<br />RDFBrowser<br />Exhibit<br />http://simile.mit.edu/exhibit<br />LENA<br />OpenAcademia<br />http://vu.openacademia.org<br />11/30/09<br />29<br />
  74. 74. Viewing<br />Tables are boring!<br />Different data? Different presentation:<br />URI/URL<br />Images<br />Strings<br />Coordinates<br />Filtering data<br />Aggregating data<br />11/30/09<br />30<br />
  75. 75. Viewing: Fresnel<br /><ul><li>RDF specification of
  76. 76. What data to present, and
  77. 77. How to present it
  78. 78. http://www.w3.org/2005/04/fresnel-info
  79. 79. Lenses
  80. 80. Group information (class membership, SPARQL result)
  81. 81. Formats
  82. 82. Specify how property values should be rendered</li></ul>11/30/09<br />31<br />
  83. 83. Viewing: Fresnel lens<br />:foafPersonDefaultLens rdf:type fresnel:Lens ;<br /> fresnel:purpose fresnel:defaultLens ;<br /> fresnel:classLensDomain foaf:Person ;<br /> fresnel:group :foafGroup ;<br /> fresnel:showProperties ( foaf:name <br /> foaf:surname <br /> foaf:depiction ) .<br />:knowsLens rdf:type fresnel:Lens ;<br /> fresnel:classLensDomain foaf:Person ;<br /> fresnel:group :foafGroup ;<br /> fresnel:showProperties ( foaf:name <br /> foaf:surname<br /> foaf:mbox <br /> [ rdf:type fresnel:PropertyDescription ;<br /> fresnel:property foaf:knows ;<br /> fresnel:sublens :foafPersonDefaultLens ] ) .<br />11/30/09<br />32<br />
  84. 84. Viewing: Fresnel format<br />:foafGroup rdf:type fresnel:Group ;<br /> fresnel:stylesheetLink &lt;http://www.example.org/example.css&gt; . <br />:depictFormat rdf:type fresnel:Format ;<br /> fresnel:propertyFormatDomain foaf:depiction ;<br /> fresnel:label fresnel:none ;<br /> fresnel:value fresnel:image ;<br /> fresnel:valueStyle &quot;imageWithThickBorder&quot;^^fresnel:styleClass ; <br /> fresnel:group :foafGroup .<br />:urlFormat rdf:type fresnel:Format ;<br /> fresnel:propertyFormatDomain foaf:homepage ;<br /> fresnel:propertyFormatDomain foaf:mbox ;<br /> fresnel:value fresnel:externalLink ;<br /> fresnel:labelStyle &quot;basicLabel&quot;^^fresnel:styleClass ;<br /> fresnel:valueStyle &quot;basicUrl&quot;^^fresnel:styleClass ;<br /> fresnel:group :foafGroup .<br />11/30/09<br />33<br />
  85. 85. Longwell<br />11/30/09<br />34<br />
  86. 86. /facet<br />11/30/09<br />35<br />
  87. 87. Some Demos<br />11/30/09<br />36<br />
  88. 88. OWL in Action<br />11/30/09<br />37<br />
  89. 89. OWL in Action<br /><ul><li>What OWL can do…
  90. 90. Traditional
  91. 91. Straightforward classification tasks
  92. 92. Extensions
  93. 93. Explanation & Justification
  94. 94. Probabilistic Reasoning
  95. 95. Advanced (Law)
  96. 96. Temporal reasoning (Klarman et al., 2008)
  97. 97. Legal reasoning (van de Ven et al., 2008)</li></ul>11/30/09<br />38<br />
  98. 98. Legal assessment<br />Case input <br />Individual case description<br />Match<br />Case is matched against a set of norms<br />Resolve conflicts<br />Where multiple norms apply, the system determines whether and which norms have priority over others<br />Final verdict<br />
  99. 99. University library regulations<br />Norms qualify a situation<br />1a) Students registered at this university are allowed to check out a book from this library<br />1b) Students registered at other universities are allowed to check out a book from this library provided that they are enrolled in at least one course given at this university.<br />1c) Students who have checked out more than five books are not allowed to check out another book.<br />Expected subsumption hierarchy:<br />Art1c ⊑ Art1a, Art1c ⊑ Art1b<br />Amy<br /> C {Amy :Student, book_1 :Library_Book, … , book_6 :Library_Book<br />Amychecks_out book_1, … , Amychecks_out book_6}<br />
  100. 100. Norms in LKIF Core<br />
  101. 101. A Default Norm<br />0) Default: Checking out books is disallowed.<br />Default_GC <br /> ⊑ Generic_Case<br />⊑ ∃disallowed_by.{defaultnorm}<br />≡ ∃checks_out.Library_Book<br /> <br />Default_Norm <br /> ⊑ Prohibition <br />⊑ ∀disallows.Default_GC<br />≡ {defaultnorm}<br />
  102. 102. Article 1a<br />1a) Students registered at this university are allowed to check out a book from this library.<br />Art1a_GC <br /> ⊑ Generic_Case<br />⊑ ∃allowed_by.art1a<br />≡ Registered_Student ⊓<br />∃checks_out.Library_Book<br /> <br />Art1a_Permission <br /> ⊑ Permission<br />⊑ ∀allows.Art1a_GC<br />≡ {art1a}<br />
  103. 103. Article 1c<br />1c) Students who have checked out more than five books are not allowed to check out another book.<br />Art1c_GC_F <br /> ⊑Generic_Case<br />⊑∃disallowed_by.{art1c}<br />≡ Registered_Student ⊓≥ 6 checks_out.Library_Book<br />Art1c_GC_P <br /> ⊑Generic_Case<br />⊑∃allowed_by.{art1c}<br />≡ Registered_Student ⊓∃checks_out.Library_Book<br /> ≤ 5 checks_out.Library_Book<br />Art1c_Prohibition <br /> ⊑ Prohibition<br />⊑ ∀disallows.Art1c_GC_F ⊓ ∀allows.Art1c_GC_P <br />≡ {art1c}<br />
  104. 104. Judging Amy<br />
  105. 105. Resources<br /><ul><li>http://www.w3.orgRDF(S), N3, OWL, SPARQL, RDFa, GRDDL, XML, XMLSchema, XSLT, CSS, XPath, fresnel...
  106. 106. http://www.semanticweb.org/facet, other resources
  107. 107. http://www.planetrdf.comAggregated RSS feed of the cool & famous
  108. 108. NEW: OWL 2
  109. 109. http://www.w3.org/TR/owl-overview</li></ul>11/30/09<br />46<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×