Your SlideShare is downloading. ×
0
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Facet: Building Web Pages with SPARQL

7,566

Published on

Introduces the high-level design of an web templating API for providing read-only access to RDF data using SPARQL.

Introduces the high-level design of an web templating API for providing read-only access to RDF data using SPARQL.

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
7,566
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
162
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 1. Facet Building Web Pages With SPARQL SWIG-UK Event, HP Labs November 23 rd 2007 Leigh Dodds Chief Technology Officer, Ingenta
    • 2. Problem Statement
    • 3. Where’s my RDF-native Web Framework?! There is no good system for integrating RDF repositories with existing an web framework (in Java)
    • 4. Design Constraints
    • 5.  
    • 6.  
    • 7.  
    • 8.  
    • 9.  
    • 10.  
    • 11.  
    • 12.  
    • 13. Design Constraints <ul><li>A web page presents data that is a sub-graph (i.e. a view) over a larger RDF store, (the data model) </li></ul><ul><li>The extent of the sub-graph may vary for different presentations of the data, and may contain arbitrary properties </li></ul><ul><li>The description of the sub-graph (a lens) should be declarative </li></ul><ul><li>That sub-graph is “rooted” on a single primary resource (e.g. a Journal) </li></ul><ul><li>The identifier of the primary resource can be derived from the request URL, e.g. by rewriting the URI. And vice versa </li></ul><ul><ul><li>Therefore, we don’t support blank nodes as primary resources </li></ul></ul><ul><ul><li>Or fragment identifiers in URIs! </li></ul></ul><ul><li>The sub-graph should be serializable into an object graph for presentation to the templating system </li></ul>
    • 14. Facet Request Handling <ul><li>To return a response we need to answer three questions… </li></ul><ul><li>What lens are we going to apply? </li></ul><ul><li>What data model are we going to apply it to? </li></ul><ul><li>What’s the identifier of the primary resource ? </li></ul>
    • 15. Lenses Describing views of RDF data
    • 16. A Simple Lens <ul><li>PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt; </li></ul><ul><li>CONSTRUCT { </li></ul><ul><li>?item dc:title ?title . </li></ul><ul><li>?item dc:language ?language . </li></ul><ul><li>} </li></ul><ul><li>WHERE { </li></ul><ul><li>?item dc:title ?title . </li></ul><ul><li>OPTIONAL { ?item dc:language ?language . } </li></ul><ul><li>} </li></ul>
    • 17. Configuring Lenses <ul><li>&lt;rdf:RDF </li></ul><ul><li>xmlns:rdf=&amp;quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&amp;quot; </li></ul><ul><li>xmlns:ja=&amp;quot;http://jena.hpl.hp.com/2005/11/Assembler#&amp;quot; </li></ul><ul><li> xmlns:view=&amp;quot;http://metastore.ingenta.com/facet/lens/&amp;quot;&gt; </li></ul><ul><li>&lt;rdf:Description </li></ul><ul><li>rdf:about=&amp;quot;http://metastore.ingenta.com/facet/lens/Sparql&amp;quot;&gt; &lt;ja:assembler&gt;com.ingenta.facet….&lt;/ja:assembler&gt; </li></ul><ul><li>&lt;/rdf:Description&gt; </li></ul><ul><li>&lt;view:Sparql </li></ul><ul><li>rdf:about=&amp;quot; http://oecd.metastore.ingenta.com/views/just-the-title &amp;quot;&gt; </li></ul><ul><li>&lt;view:query&gt; sparql/just-the-title.rq &lt;/view:query&gt; </li></ul><ul><li>&lt;/view:Sparql&gt; </li></ul><ul><li>&lt;/rdf:RDF&gt; </li></ul>
    • 18. Data Model Configuring RDF graphs
    • 19. Data Model Configuration <ul><li>Jena Assembler API </li></ul><ul><li>Add notion of application level default data model </li></ul><ul><ul><li>Uses well-known URI </li></ul></ul><ul><li>Lenses may be configured to apply to a specific data model </li></ul><ul><ul><li>Allows “sharding” of data models </li></ul></ul><ul><li>&lt;view:Sparql </li></ul><ul><li>rdf:about=&amp;quot; http://oecd.metastore.ingenta.com/views/just-the-title &amp;quot;&gt; </li></ul><ul><li>&lt;view:appliesTo rdf:resource=“…”/&gt; </li></ul><ul><li>&lt;/view:Sparql&gt; </li></ul>
    • 20. Resource Identifiers
    • 21. Mapping Resource Identifiers <ul><li>In a RESTful application, each resource should have a single primary location </li></ul><ul><li>Allows resource identifiers to be derived using URL rewriting </li></ul><ul><li>http://test.sourceoecd.org/oecd/content/journal/18168116 </li></ul><ul><li>http://oecd.metastore.ingenta.com/content/journal/18168116 </li></ul>
    • 22. Serialization Mapping an RDF sub-graph to a Java object model
    • 23. Serialization <ul><li>Primary resource is a ContentItem </li></ul><ul><ul><li>Has an identifier and Map of properties </li></ul></ul><ul><li>Walk through graph, beginning at “root” resource, mapping RDF statements to Map entries </li></ul><ul><li>Mapping of property names is configurable. </li></ul><ul><ul><li>Default based on namespace prefix, E.g. dc_title </li></ul></ul><ul><li>Mapping of objects of each statement to a suitable Java object </li></ul><ul><ul><li>ContentItem, Map, List, Integer , etc </li></ul></ul>
    • 24. Serialization (special cases) <ul><li>Multilingual properties </li></ul><ul><ul><li>Special casing (i.e. a hack!) to modify naming, e.g. dc_title_fr </li></ul></ul><ul><li>Repeated properties, e.g. dc:subject </li></ul><ul><ul><li>Use schema annotation to indicate these, and then Serialize to a List </li></ul></ul><ul><li>XML Literals &amp; Multi-lingual data </li></ul><ul><ul><li>E.g. multi-lingual abstracts ( dc:description ) that contain XHTML markup </li></ul></ul><ul><ul><li>Use schema annotation, parse and create separate Map entries </li></ul></ul>
    • 25. Additional Features <ul><li>“ MultiLens”, applying multiple queries in series to build results </li></ul><ul><li>Automatic availability of URL parameters as SPARQL query parameters </li></ul><ul><li>Integral API support </li></ul><ul><ul><li>RDF output for free; JSON output trivial </li></ul></ul><ul><li>Simple content lifecycle, mapping to HTTP resource statuses </li></ul><ul><ul><li>E.g. Content Not Found, Moved, Gone </li></ul></ul><ul><ul><li>Add type ( life:Deleted ) and properties ( life:newLocation ) to data </li></ul></ul><ul><li>Support for URL Aliasing based on property values </li></ul><ul><ul><li>/content/issn/1234-5678 -&gt; /content/journal/abcdef </li></ul></ul><ul><ul><li>&lt;prism:issn&gt; </li></ul></ul>
    • 26. Summary <ul><li>Pros </li></ul><ul><li>By embracing a few limitations on RDF modelling, e.g. identifiers provides a very flexible means of building web pages from an RDF repository </li></ul><ul><li>Reliance on SPARQL and Jena API features provides great deal of configuration options </li></ul><ul><li>Good integration with existing web templating environments </li></ul><ul><li>Quick to learn </li></ul><ul><li>Cons </li></ul><ul><li>Model limitations mean its not suited to all RDF “in the wild” </li></ul>

    ×