1 / 38

Semantic Web in Depth

This article discusses the techniques of embedding semantic web data using RDFa and GRDDL, including examples and syntax for both approaches. It explores how to extract relevant portions of XML documents and make them available to Semantic Web agents, as well as how to store structure in attributes and set namespaces for RDFa.

lguerin
Download Presentation

Semantic Web in Depth

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. Semantic Web in Depth RDFa, GRDDL and POWDER Dr Nicholas Gibbins - nmg@ecs.soton.ac.uk2013-2014

  2. Embedding Semantic Web Data http://www.flickr.com/photos/40472757@N07/4508416502/

  3. Embedded Data • Publishing patterns for linked data that we’ve already considered make the assumption that we’re publishing directly in RDF/OWL • What if the data already exists in a web resource, in some form?

  4. Embedded Data • Republishing the data separately introduces redundancy, and the possibility of inconsistency - embed our SW data in the web resource • Two main approaches: • GRDDL • RDFa

  5. GRDDL

  6. GRDDL • Given a document in some XML format, how can we extract the relevant portions and make them available to SW agents? • GRDDL (Gleaning Resource Descriptions from Dialects of Languages) uses XSLT stylesheets to transform documents XSLTstylesheet XML doc RDF/XML GRDDL Processor

  7. Using GRDDL with XML In well-formed XML, link to XSLT transformation using grddl:transformation attribute • Need to introduce grddl: namespace <html xmlns=‘http://www.w3.org/1999/xhtml’xmlns:grddl='http://www.w3.org/2003/g/data-view#’grddl:transformation="glean_title.xsl”> <head> <title>Are You Experienced?</title> [...]</html>

  8. Using GRDDL with XHTML Link to XSLT transformation using link element • Introduce GRDDL in profile <html xmlns="http://www.w3.org/1999/xhtml”> <head profile="http://www.w3.org/2003/g/data-view”> <title>Some Document</title><link rel="transformation”href="http://www.w3.org/2000/06/dc-extract/dc-extract.xsl" /><meta name="DC.Subject” content="ADAM; Simple Search; Index+; prototype" /> [...] </head> [...]</html>

  9. RDFa

  10. RDFa Yet another syntax for RDF… • Designed for embedding structured data in web pages • Stored structure in attributes (the ‘a’ in ‘RDFa’)

  11. RDFa Example <html> <head><title>Jo's Friends and Family Blog</title></head> <body> <p>I'm holding one last summer Barbecue, on September 16th at 4pm.</p><p class="contactinfo”>Jo Smith. Web hacker at Example, Inc. You can contact me <a href="mailto:jo@example.org">via email</a>.</p></body></html>

  12. Setting namespaces <html prefix=“cal: http://example.org/ontology/cal#foaf: http://xmlns.com/foaf/0.1/xsd: http://www.w3.org/2001/XMLSchema#”> <head><title>Jo's Friends and Family Blog</title></head> <body> <p>I'm holding one last summer barbecue, on September 16th at 4pm.</p> <p class="contactinfo”>Jo Smith. Web hacker atExample, Inc. You can contact me <a href="mailto:jo@example.org">via email</a>.</p> </body></html>

  13. Showing an instance of a class Class membership is indicated using the typeof attribute: <p>I'm holding one last summer barbecue, on September 16th at 4pm.</p>

  14. Showing an instance of a class Class membership is indicated using the typeof attribute: <p typeof=“cal:Event”>I'm holding one last summer barbecue, on September 16th at 4pm.</p> _:a rdf:typecal:Event.

  15. Using properties: predicates The predicate of a triple is indicated using the property attribute: <p>I'm holding one last summer barbecue, on September 16th at 4pm.</p>

  16. Using properties: predicates The predicate of a triple is indicated using the property attribute: <p>I'm holding <span property=“cal:summary”>one last summer barbecue</span>, on September 16th at 4pm.</p>

  17. Using properties: literal objects The object of a literal-valued triple is given by the content of the element bearing the property attribute <p>I'm holding <span property=“cal:summary”>one last summer barbecue</span>, on September 16th at 4pm.</p> _:a cal:summary“one last summer barbecue” .

  18. Using properties: substitute values The content of an element may be substituted for using the content attribute: <p>I'm holding one last summer barbecue, on <span property=“cal:start” content=“2007-09-16T16:00:00”>September 16th at 4pm</span>.</p> _:a cal:start“2007-09-16T16:00:00”.

  19. Using properties: datatypes The datatype of a literal-value object is indicated using the datatypeattribute: <p>I'm holding one last summer barbecue, on <span property=“cal:start” datatype=“xsd:dateTime”content=“2007-09-16T16:00:00”>September 16th at 4pm</span>.</p> _:a cal:start “2007-09-16T16:00:00”^^xsd:dateTime.

  20. Using properties: resource objects The object of a resource-valued triple is given by the content of the resource attribute: <p class="contactinfo”>Jo Smith. Web hacker at <span property=“foaf:workplaceHomepage” resource=“http://example.org”>Example, Inc</span>. You can contact me <a href="mailto:jo@example.org">via email</a>.</p> _:b foaf:workplaceHomepage<http://example.org/> .

  21. Identity The subject of a triple is indicated using the about attribute: <p class="contactinfo”>Jo Smith. Web hacker at <span property=“foaf:workplaceHomepage” resource=“http://example.org”>Example, Inc</span>. You can contact me <a href="mailto:jo@example.org">via email</a>.</p> _:b foaf:workplaceHomepage <http://example.org/> .

  22. Identity The subject of a triple is indicated using the about attribute: <p class="contactinfo” about=“http://example.org/staff/jo”>Jo Smith. Web hacker at <span property=“foaf:workplaceHomepage” resource=“http://example.org”>Example, Inc</span>. You can contact me <a href="mailto:jo@example.org">via email</a>.</p> <http://example.org/staff/jo>foaf:workplaceHomepage <http://example.org/> .

  23. Using existing links Existing links may be used to construct triples with resource-valued objects: <p class="contactinfo” about=“http://example.org/staff/jo”>Jo Smith. Web hacker at Example, Inc. You can contact me <a href="mailto:jo@example.org">via email</a>.</p>

  24. Using existing links The rel attribute is used to indicate the predicate: <p class="contactinfo” about=“http://example.org/staff/jo”>Jo Smith. Web hacker at Example, Inc. You can contact me <a rel=“foaf:mbox”href="mailto:jo@example.org">via email</a>.</p>

  25. Using existing links The href attribute is used to indicate the object: <p class="contactinfo” about=“http://example.org/staff/jo”>Jo Smith. Web hacker at Example, Inc. You can contact me <a rel=“foaf:mbox” href="mailto:jo@example.org">via email</a>.</p> <http://example.org/staff/jo> foaf:mbox <mailto:jo@example.org> .

  26. Original File <html> <head><title>Jo's Friends and Family Blog</title></head> <body> <p>I'm holding one last summer barbecue, on September 16th at 4pm.</p> <p class="contactinfo”>Jo Smith. Web hacker at Example, Inc. You can contact me <a href="mailto:jo@example.org">via email</a>.</p> </body></html>

  27. Annotated File <html prefix=“cal: http://example.org/ontology/cal#foaf: http://xmlns.com/foaf/0.1/xsd: http://www.w3.org/2001/XMLSchema#”> <head><title>Jo's Friends and Family Blog</title></head> <body><p typeof=“cal:Event”>I'm holding <span property=“cal:summary”>one last summer barbecue</span>, on <span property=“cal:start”content=“2007-09-16T16:00:00” datatype=“xsd:dateTime”>September 16th at 4pm</span>.</p> <p class="contactinfo” typeof=“foaf:Person”about=“http://example.org/staff/jo”><span property=“foaf:name”>Jo Smith</span>. Web hacker at<span property=“foaf:workplaceHomepage” resource=“http://example.org”>Example, Inc</span>. You can contact me <a rel=“foaf:mbox”href="mailto:jo@example.org">via email</a>.</p> </body></html>

  28. Contained Triples _:a rdf:typecal:Event ;cal:summary “one last summer barbecue” ;cal:start “2007-09-16T16:00:00”^^xsd:dateTime . <http://example.org/staff/jo> rdf:typefoaf:Person ;foaf:name “Jo Smith” ;foaf:workplaceHomepage <http://example.org> ;foaf:mbox <mailto:jo@example.org> .

  29. POWDER

  30. Protocol for Web Description Resources RDF lets us make statements about a single resource at a time • an RDF triple has only one subject! POWDER is an XML format for describing groups of resources Lineage goes back to PICS – Platform for Internet Content Selection

  31. OWL 1.1 Languages of the Semantic Web PICS MCF SHOE 1996 1997 1998 RDF(S) 1999 OIL DAML 2000 DAML+OIL 2001 2002 RDF(S) OWL 2003 2004 2005 2006 2007 W3C Language 2008 Other OWL 2 2009

  32. General Syntax <powder> <attribution> //description of entity making the description </attribution> <dr> //description resource <iriset> //specifier for things being described </iriset> <descriptorset> // descriptions of things being described </descriptorset> </dr></powder>

  33. General Syntax <powder><attribution> //description of entity making the description </attribution> <dr> //description resource <iriset> //specifier for things being described </iriset> <descriptorset> // descriptions of things being described </descriptorset> </dr></powder>

  34. General Syntax <powder> <attribution> //description of entity making the description </attribution><dr> //description resource <iriset> //specifier for things being described </iriset> <descriptorset> // descriptions of things being described </descriptorset> </dr></powder>

  35. General Syntax <powder> <attribution> //description of entity making the description </attribution> <dr> //description resource<iriset> //specifier for things being described </iriset> <descriptorset> // descriptions of things being described </descriptorset> </dr></powder>

  36. General Syntax <powder> <attribution> //description of entity making the description </attribution> <dr> //description resource <iriset> //specifier for things being described </iriset><descriptorset> // descriptions of things being described </descriptorset> </dr></powder>

  37. Example <?xml version="1.0"?><powder xmlns="http://www.w3.org/2007/05/powder#" xmlns:ex="http://example.org/vocab#"> <attribution> <issuedbysrc="http://authority.example.org/company.rdf#me" /> <issued>2007-12-14T00:00:00</issued> </attribution> <dr> <iriset> <includehosts>example.com</includehosts> </iriset> <descriptorset> <ex:color>red</ex:color> <ex:shape>square</ex:shape> <displaytext>Everything on example.com is red and square</displaytext> <displayiconsrc="http://authority.example.org/icon.png" /> </descriptorset> </dr> </powder>

  38. Further Reading Gleaning Resource Descriptions from Dialects of LanguagesW3C Recommendation 11 September 2007http://www.w3.org/TR/grddl/ RDFaCore 1.1W3C Recommendation 22 August 2013http://www.w3.org/TR/rdfa-syntax/ RDFa1.1 Primer (essential reading!)W3C Working Group Note 22 August 2013http://www.w3.org/TR/xhtml-rdfa-primer/ POWDER PrimerW3C Working Group Note 1 September 2009http://www.w3.org/TR/powder-primer/

More Related