0
<ul><li>Emanuele Della Valle </li></ul><ul><li>[email_address] </li></ul><ul><li>http://emanueledellavalle.org   </li></ul...
Share, Remix, Reuse — Legally <ul><li>This work is licensed under the Creative Commons Attribution 3.0 Unported License.  ...
Data Interchange: RDF
RDF in a nutshell Looking for a flexible data model  <ul><li>Why </li></ul><ul><ul><li>Application are  always  changing (...
RDF in a nutshell Resource Description Framework <ul><li>The adaptation of the relational model to the Web give rise to RD...
RDF in a nutshell Representing relational data in RDF (almost) <ul><li>E.g., drug data </li></ul><ul><li>Represented in RD...
RDF in a nutshell Representing relational data in RDF (almost) <ul><li>Two important problems </li></ul><ul><ul><li>Once o...
<ul><li>Which URI should we use? </li></ul><ul><ul><li>Popular ones! Data merge will take place automatically! </li></ul><...
<ul><li>Where do I find popular URIs? </li></ul><ul><ul><li>A difficult question with no clear answer </li></ul></ul><ul><...
<ul><li>What is a value? When shall we URI-fy a value?  </li></ul><ul><ul><li>Literals cannot be used to merge different d...
RDF in a nutshell Other data structure in RDF <ul><li>Trees can be represented in RDF </li></ul><ul><li>Anything can be re...
RDF in a nutshell Serializing RDF <ul><li>Three alternatives to write triples, in </li></ul><ul><ul><li>RDF/XML: Standard ...
RDF in a nutshell Serializing RDF in Turtle - namespaces <ul><li>URI terms can be abbreviated using namespaces </li></ul><...
RDF in a nutshell Serializing RDF in Turtle - Literals <ul><li>Literals:  &quot;Propranolol&quot; </li></ul><ul><ul><li>Li...
RDF in a nutshell Serializing RDF in Turtle -  Convience Syntax <ul><li>Abbreviating repeated subjects: </li></ul><ul><ul>...
RDF in a nutshell Serializing RDF in XML - basics <ul><li>W3C standardized an RDF/XML syntax [1]  </li></ul><ul><li>The ba...
RDF in a nutshell Serializing RDF in XML - abbreviation <ul><li>A possible abbreviation is using  rdf:resource  in the pro...
RDF in a nutshell Serializing RDF in XML - abbreviation <ul><li>Encoding Literals </li></ul><ul><ul><li>datatype </li></ul...
RDF in a nutshell Serializing RDF in XML – rdf:type abbreviation <ul><li>It’s possible to abbreviate rdf:type </li></ul><u...
RDF in a nutshell  Serializing RDF in XML – more statements 1/3 <ul><li>E.g. </li></ul><ul><li>can be </li></ul><ul><ul><l...
RDF in a nutshell  Serializing RDF in XML – more statements 2/3 <ul><li>E.g. </li></ul><ul><li>can be </li></ul><ul><ul><l...
RDF in a nutshell  Serializing RDF in XML – more statements 3/3 <ul><li>E.g. </li></ul><ul><li>Applying all abbreviations ...
RDF in a nutshell Merging XML files (representing an RDF model) <ul><li>Suppose you have to merge the two following XML </...
RDF in a nutshell Merging XML files  2/2 <ul><li>It’s (just) a matter to merge the two RDF graphs </li></ul><ul><li>NOTE: ...
Publishing RDF as Linked Data Principles <ul><li>Things must be identified with dereferenceable HTTP URIs. </li></ul><ul><...
Publishing RDF as Linked Data  More on Content Negotiation <ul><li>Approach </li></ul><ul><li>E.g.  </li></ul><ul><ul><li>...
Publishing RDF as Linked Data  Recipes for Serving Information as Linked Data <ul><li>Recipes  [1] </li></ul><ul><li>Servi...
Publishing RDF as Linked Data  Recipe 1 - Serving static RDF files  1/3 <ul><li>IDEA: negotiate content using Apache mod_r...
Publishing RDF as Linked Data  Recipe 1 - Serving static RDF files  2/3 <ul><li># Turn off MultiViews </li></ul><ul><li>Op...
Publishing RDF as Linked Data  Recipe 1 - Serving static RDF files  3/3 <ul><li>Testing the configuration </li></ul>http:/...
Publishing RDF as Linked Data  Recipe 2 - DB as (virtual) RDF  <ul><li>General Idea </li></ul><ul><li>Ready to use solutio...
Publishing RDF as Linked Data  Recipe 3 - RDF storage + Linked Data Interface <ul><li>General Idea </li></ul><ul><li>Ready...
Publishing RDF as Linked Data  Recipe 4 - Wrap API to serve (virtual) RDF <ul><li>General Idea </li></ul><ul><li>No “gener...
Publishing RDF as Linked Data  Which recipe should I use? <ul><li>How much data do you want to serve?  </li></ul><ul><ul><...
RDF in a nutshell RDF Resources <ul><li>RDF at the W3C - primer and specifications </li></ul><ul><ul><li>http://www.w3.org...
credits <ul><li>Some slides are derived from </li></ul><ul><ul><li>“ How to Publish Linked Data on the Web” by Chris Bizer...
Upcoming SlideShare
Loading in...5
×

Data in RDF

6,117

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
6,117
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
218
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • 07/04/10 © 2005 - Della Valle - CEFRIEL
  • 07/04/10 © 2005 - Della Valle - CEFRIEL
  • 07/04/10 © 2005 - Della Valle - CEFRIEL
  • Transcript of "Data in RDF"

    1. 1. <ul><li>Emanuele Della Valle </li></ul><ul><li>[email_address] </li></ul><ul><li>http://emanueledellavalle.org </li></ul>Data in RDF
    2. 2. Share, Remix, Reuse — Legally <ul><li>This work is licensed under the Creative Commons Attribution 3.0 Unported License. </li></ul><ul><li>Your are free: </li></ul><ul><ul><li>to Share — to copy, distribute and transmit the work </li></ul></ul><ul><ul><li>to Remix — to adapt the work </li></ul></ul><ul><li>Under the following conditions </li></ul><ul><ul><li>Attribution — You must attribute the work by inserting </li></ul></ul><ul><ul><ul><li>“ © applied-semantic-web.org” at the end of each reused slide </li></ul></ul></ul><ul><ul><ul><li>a credits slide stating: these slides are partially based on “Data in RDF” by Emanuele Della Valle http://applied-semantic-web.org/2010/03/02_RDF.ppt </li></ul></ul></ul><ul><li>To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ </li></ul>
    3. 3. Data Interchange: RDF
    4. 4. RDF in a nutshell Looking for a flexible data model <ul><li>Why </li></ul><ul><ul><li>Application are always changing (competitive environment) </li></ul></ul><ul><ul><li>People are always adding more features </li></ul></ul><ul><ul><li>Graceful evolution is important </li></ul></ul><ul><li>Optimal: relational model </li></ul><ul><ul><li>Relational model is remarkably flexible </li></ul></ul><ul><ul><li>Supports graceful evolution </li></ul></ul><ul><ul><ul><li>Change => Add another table </li></ul></ul></ul><ul><ul><ul><li>Existing queries are unaffected </li></ul></ul></ul><ul><ul><li>Easily accommodates new data </li></ul></ul><ul><ul><ul><li>Without affecting existing queries </li></ul></ul></ul><ul><ul><li>Allows data to be easily combined (&quot;joined&quot;) in new ways </li></ul></ul><ul><ul><li>25+ years of relational database experience </li></ul></ul>
    5. 5. RDF in a nutshell Resource Description Framework <ul><li>The adaptation of the relational model to the Web give rise to RDF </li></ul><ul><li>From tuples to triples </li></ul><ul><li>Any relational data can be represented as triples </li></ul><ul><ul><li>Row Key --> Subject </li></ul></ul><ul><ul><li>Column --> Property </li></ul></ul><ul><ul><li>Value --> Value </li></ul></ul>
    6. 6. RDF in a nutshell Representing relational data in RDF (almost) <ul><li>E.g., drug data </li></ul><ul><li>Represented in RDF (almost) </li></ul>BB.2 Anxiolytics C 16 H 21 NO 2 Propranolol Propranololo プロプラノロール Category Formula Is a Drug Legend resource literal Name Drug Category Formula BB.2   Anxiolytics C 16 H 21 NO 2 Drug Name BB.2 Propranolol BB.2 Propranololo BB.2 プロプラノロール
    7. 7. RDF in a nutshell Representing relational data in RDF (almost) <ul><li>Two important problems </li></ul><ul><ul><li>Once out of the database internal ID (e.g., BB.2) becomes useless </li></ul></ul><ul><ul><li>Once out of the database internal names of schema element (e.g., Category) becomes useless as well </li></ul></ul><ul><li>RDF solves it by using URI </li></ul><ul><ul><li>Internal ID should be replaced by URI </li></ul></ul><ul><ul><li>Internal schema names should be replaced by URI </li></ul></ul><ul><ul><li>Values do (always) not need to be URI-fied </li></ul></ul>http://dbpedia.org/resource/Propranolol http://dbpedia.org/resource/Category:Anxiolytics C16H21NO2 http://www.w3.org/2004/02/skos/core#subject http://dbpedia.org/ontology/formula http://www.w3.org/2000/01/rdf-schema#label http://dbpedia.org/ontology/Drug http://www.w3.org/1999/02/22-rdf-syntax-ns#type Legend resource literal Propranolol Propranololo プロプラノロール
    8. 8. <ul><li>Which URI should we use? </li></ul><ul><ul><li>Popular ones! Data merge will take place automatically! </li></ul></ul>RDF in a nutshell Representing data in RDF Q/A 1/4 http://dbpedia.org/resource/Propranolol http://dbpedia.org/resource/Category:Anxiolytics http://www.w3.org/2004/02/skos/core#subject + http://dbpedia.org/resource/Propranolol http://dbpedia.org/ontology/knownFor http://dbpedia.org/resource/Propranolol http://dbpedia.org/resource/Category:Anxiolytics http://www.w3.org/2004/02/skos/core#subject = http://dbpedia.org/ontology/knownFor http://dbpedia.org/resource/James_W._Black http://dbpedia.org/resource/James_W._Black
    9. 9. <ul><li>Where do I find popular URIs? </li></ul><ul><ul><li>A difficult question with no clear answer </li></ul></ul><ul><ul><li>The best place to keep an eye on is </li></ul></ul><ul><ul><ul><li>the Linking Open Data Project http://esw.w3.org/topic/SweoIG/TaskForces/CommunityProjects/LinkingOpenData </li></ul></ul></ul><ul><ul><ul><li>and in particular the following pages of the Wiki </li></ul></ul></ul><ul><ul><ul><ul><li>Data Sets http://esw.w3.org/topic/TaskForces/CommunityProjects/LinkingOpenData/DataSets </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Semantic Web Search Engines http://esw.w3.org/topic/TaskForces/CommunityProjects/LinkingOpenData/SemanticWebSearchEngines </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Common Vocabularies http://esw.w3.org/topic/TaskForces/CommunityProjects/LinkingOpenData/CommonVocabularies </li></ul></ul></ul></ul><ul><ul><li>I normally use </li></ul></ul><ul><ul><ul><li>Sindice API through sameas.org </li></ul></ul></ul><ul><ul><ul><ul><li>e.g. http://sameas.org/html?q=propranolol&x=0&y=0 </li></ul></ul></ul></ul>RDF in a nutshell Representing data in RDF Q/A 2/4
    10. 10. <ul><li>What is a value? When shall we URI-fy a value? </li></ul><ul><ul><li>Literals cannot be used to merge different data set </li></ul></ul><ul><ul><li>E.g., what if we what to merge two resources based on their labels? </li></ul></ul><ul><ul><ul><li>BRCA may refer to different thing on the Web e.g., try http://en.wikipedia.org/wiki/BRCA </li></ul></ul></ul><ul><ul><li>URI-fy any value that can be eventually used to merge different dataset and leave the other values as literals </li></ul></ul>RDF in a nutshell Representing data in RDF Q/A 3/4 BRCA http://www.w3.org/2000/01/rdf-schema#label BRCA http://www.w3.org/2000/01/rdf-schema#label + = ?
    11. 11. RDF in a nutshell Other data structure in RDF <ul><li>Trees can be represented in RDF </li></ul><ul><li>Anything can be represented in RDF </li></ul>
    12. 12. RDF in a nutshell Serializing RDF <ul><li>Three alternatives to write triples, in </li></ul><ul><ul><li>RDF/XML: Standard serialization in XML </li></ul></ul><ul><ul><ul><li><Description about=”subject”> </li></ul></ul></ul><ul><ul><ul><li><property>value</property> </li></ul></ul></ul><ul><ul><ul><li></Description> </li></ul></ul></ul><ul><ul><ul><li>e.g., http://dbpedia.org/data/Propranolol.rdf </li></ul></ul></ul><ul><ul><ul><li>Check-out the triples using http://www.w3.org/RDF/Validator/ </li></ul></ul></ul><ul><ul><li>NTriples: Simple (verbose) reference serialization (for specifications only) ‏ </li></ul></ul><ul><ul><li><http:// ... subject> <http:// ... predicate> “value” . </li></ul></ul><ul><ul><ul><li>http://www.w3.org/RDF/Validator/ARPServlet?URI=http%3A%2F%2Fdbpedia.org%2Fresource%2FPropranolol&PARSE=Parse+URI%3A+&TRIPLES_AND_GRAPH=PRINT_TRIPLES&FORMAT=PNG_EMBED </li></ul></ul></ul><ul><ul><li>N3 and Turtle: Developer-friendly serializations </li></ul></ul><ul><ul><ul><li>:subject :property “value” . </li></ul></ul></ul><ul><ul><ul><li>e.g. http://dbpedia.org/data/Propranolol.n3 </li></ul></ul></ul>
    13. 13. RDF in a nutshell Serializing RDF in Turtle - namespaces <ul><li>URI terms can be abbreviated using namespaces </li></ul><ul><ul><li>@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . </li></ul></ul><ul><ul><li>@prefix dbpedia: <http://dbpedia.org/resource/> . </li></ul></ul><ul><ul><li>@prefix dbpedia-owl: <http://dbpedia.org/ontology/> . </li></ul></ul><ul><ul><li>dbpedia:Propranolol rdf:type dbpedia-owl:Drug . </li></ul></ul><ul><li><http://www.w3.org/1999/ 02/22-rdf-syntax-ns#type> = ' a ' </li></ul><ul><ul><li>dbpedia:Propranolol a dbpedia-owl:Drug . </li></ul></ul>
    14. 14. RDF in a nutshell Serializing RDF in Turtle - Literals <ul><li>Literals: &quot;Propranolol&quot; </li></ul><ul><ul><li>Literals with language tags: &quot; プロプラノロール &quot;@jp </li></ul></ul><ul><ul><li>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . </li></ul></ul><ul><ul><li>dbpedia:Propranolol rdfs:label &quot;Propranolol&quot;@en . </li></ul></ul><ul><ul><li>dbpedia:Propranolol rdfs:label &quot;Propranololo&quot;@it . </li></ul></ul><ul><ul><li>dbpedia:Propranolol rdfs:label &quot; プロプラノロール &quot;@jp . </li></ul></ul><ul><ul><li>Typed literals: &quot;3.14&quot;^^xsd:float </li></ul></ul><ul><ul><li>dbpedia:Propranolol dbpprop:molecularWeight &quot;259.34&quot;^^xsd:float . </li></ul></ul>
    15. 15. RDF in a nutshell Serializing RDF in Turtle - Convience Syntax <ul><li>Abbreviating repeated subjects: </li></ul><ul><ul><li>dbpedia:Propranolol rdfs:label &quot;Propranololo&quot;@it . </li></ul></ul><ul><ul><li>dbpedia:Propranolol dbpprop:molecularWeight &quot;259.34&quot;^^xsd:float . </li></ul></ul><ul><li>... is the same as ... </li></ul><ul><ul><li>dbpedia:Propranolol rdfs:label &quot;Propranololo&quot;@it ; </li></ul></ul><ul><ul><li>dbpprop:molecularWeight &quot;259.34&quot;^^xsd:float . </li></ul></ul><ul><li>Abbreviating repeated subject/predicate pairs: </li></ul><ul><ul><li>dbpedia:Propranolol rdfs:label &quot;Propranolol&quot;@en . </li></ul></ul><ul><ul><li>dbpedia:Propranolol rdfs:label &quot;Propranololo&quot;@it . </li></ul></ul><ul><ul><li>dbpedia:Propranolol rdfs:label &quot; プロプラノロール &quot;@cn . </li></ul></ul><ul><ul><li>... is the same as ... </li></ul></ul><ul><ul><li>dbpedia:Propranolol rdfs:label &quot;Propranolol&quot;@en , </li></ul></ul><ul><ul><li>&quot;Propranololo&quot;@it , </li></ul></ul><ul><ul><li>&quot; プロプラノロール &quot;@cn . </li></ul></ul>
    16. 16. RDF in a nutshell Serializing RDF in XML - basics <ul><li>W3C standardized an RDF/XML syntax [1] </li></ul><ul><li>The basic idea is to insert an XML element for each node (sobject and value) and arch (predicate) </li></ul><ul><li>Es. </li></ul><ul><ul><li>< rdf:RDF </li></ul></ul><ul><ul><li>xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#” </li></ul></ul><ul><ul><li>xmlns:skos=&quot;http://www.w3.org/2004/02/skos/core#&quot; </li></ul></ul><ul><ul><li>< rdf:Description </li></ul></ul><ul><ul><li>rdf:about =&quot;http://dbpedia.org/resource/Propranolol&quot;> < skos:subject >    < rdf:Description </li></ul></ul><ul><ul><li>rdf:about =&quot;http://dbpedia.org/resource/Category:Anxiolytics&quot;/> </li></ul></ul><ul><ul><li></ skos:subject > </li></ul></ul><ul><ul><li></rdf:Description> </li></ul></ul><ul><ul><li></rdf:RDF> </li></ul></ul>[1] RDF/XML Syntax Specification available at http://www.w3.org/TR/rdf-syntax-grammar/ dbpedia:Propranolol category:Anxiolytics skos:subject property element Root tag
    17. 17. RDF in a nutshell Serializing RDF in XML - abbreviation <ul><li>A possible abbreviation is using rdf:resource in the property elements </li></ul><ul><li>Es. </li></ul><ul><ul><li>< rdf:RDF </li></ul></ul><ul><ul><li>xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#” </li></ul></ul><ul><ul><li>xmlns:skos=&quot;http://www.w3.org/2004/02/skos/core#&quot; </li></ul></ul><ul><ul><li><rdf:Description rdf:about=&quot;http://dbpedia.org/resource/Propranolol&quot;> <skos:subject </li></ul></ul><ul><ul><li>rdf:resource =&quot;http://dbpedia.org/resource/Category:Anxiolytics&quot;/> </li></ul></ul><ul><ul><li></rdf:Description> </li></ul></ul><ul><ul><li></rdf:RDF> </li></ul></ul>
    18. 18. RDF in a nutshell Serializing RDF in XML - abbreviation <ul><li>Encoding Literals </li></ul><ul><ul><li>datatype </li></ul></ul><ul><ul><li><rdf:Description rdf:about=&quot;http://dbpedia.org/resource/Propranolol&quot;> <dbpprop:molecularWeight </li></ul></ul><ul><ul><li>rdf:datatype=&quot;http://www.w3.org/2001/XMLSchema#float&quot; </li></ul></ul><ul><ul><li>>259.34 </dbpprop:molecularWeight > </li></ul></ul><ul><ul><li></rdf:Description> </li></ul></ul><ul><ul><li>Language tag </li></ul></ul><ul><ul><li><rdf:Description rdf:about=&quot;http://dbpedia.org/resource/Propranolol&quot;> <rdfs:label xml:lang=&quot;it&quot;> Propranololo </rdfs:label > </li></ul></ul><ul><ul><li></rdf:Description> </li></ul></ul>dbpedia:Propranolol dbpprop:molecularWeight dbpedia:Propranolol rdfs:label “ Propranololo”@it &quot;259.34&quot;^^xsd:float
    19. 19. RDF in a nutshell Serializing RDF in XML – rdf:type abbreviation <ul><li>It’s possible to abbreviate rdf:type </li></ul><ul><ul><li>Es. </li></ul></ul><ul><ul><li>Long form </li></ul></ul><ul><ul><li><rdf:Description rdf:about=&quot; http://dbpedia.org/resource/Propranolol &quot;> </li></ul></ul><ul><ul><ul><li><rdf:type rdf:resource=&quot;http://dbpedia.org/ontology/Drug&quot;/> </li></ul></ul></ul><ul><ul><ul><li></rdf:Description> </li></ul></ul></ul><ul><ul><li>Abbreviated form </li></ul></ul><ul><ul><ul><li><dbpedia-owl:Drug rdf:about=&quot; http://dbpedia.org/resource/Propranolol &quot; /> </li></ul></ul></ul>dbpedia:Propranolol http://dbpedia.org/ontology/Drug rdf:type
    20. 20. RDF in a nutshell Serializing RDF in XML – more statements 1/3 <ul><li>E.g. </li></ul><ul><li>can be </li></ul><ul><ul><li>listed </li></ul></ul><ul><ul><ul><li><rdf:Description rdf:about=&quot; http://dbpedia.org/resource/Propranolol &quot;> </li></ul></ul></ul><ul><ul><ul><li><rdf:type rdf:resource=&quot;http://dbpedia.org/ontology/Drug&quot;/> </li></ul></ul></ul><ul><ul><ul><li></rdf:Description> </li></ul></ul></ul><ul><ul><li><rdf:Description rdf:about=&quot;http://dbpedia.org/resource/Propranolol&quot;> <skos:subject rdf:resource =&quot;http://dbpedia.org/resource/Category:Anxiolytics&quot;/> </li></ul></ul><ul><ul><li></rdf:Description> </li></ul></ul><ul><ul><li>nested </li></ul></ul><ul><ul><ul><li><rdf:Description rdf:about=&quot; http://dbpedia.org/resource/Propranolol &quot;> </li></ul></ul></ul><ul><ul><ul><li><rdf:type rdf:resource=&quot;http://dbpedia.org/ontology/Drug&quot;/> </li></ul></ul></ul><ul><ul><ul><li><skos:subject rdf:resource =&quot;http://dbpedia.org/resource/Category:Anxiolytics&quot;/> </li></ul></ul></ul><ul><ul><ul><li></rdf:Description> </li></ul></ul></ul><ul><ul><li>shortened to a minimum </li></ul></ul><ul><ul><ul><li><dbpedia-owl:Drug rdf:about=&quot; http://dbpedia.org/resource/Propranolol &quot; > </li></ul></ul></ul><ul><ul><ul><li><skos:subject rdf:resource =&quot;http://dbpedia.org/resource/Category:Anxiolytics&quot;/> </li></ul></ul></ul><ul><ul><ul><li></dbpedia-owl:Drug> </li></ul></ul></ul>dbpedia:Propranolol category:Anxiolytics skos:subject http://dbpedia.org/ontology/Drug
    21. 21. RDF in a nutshell Serializing RDF in XML – more statements 2/3 <ul><li>E.g. </li></ul><ul><li>can be </li></ul><ul><ul><li>listed </li></ul></ul><ul><ul><ul><li><rdf:Description rdf:about=&quot;http://dbpedia.org/resource/Propranolol&quot;> </li></ul></ul></ul><ul><ul><ul><li><skos:subject rdf:resource =&quot;http://dbpedia.org/resource/Category:Anxiolytics&quot;/> </li></ul></ul></ul><ul><ul><ul><li></rdf:Description> </li></ul></ul></ul><ul><ul><ul><li><rdf:Description rdf:about=&quot;http://dbpedia.org/resource/Category:Anxiolytics&quot;> </li></ul></ul></ul><ul><ul><ul><li><skos:broader </li></ul></ul></ul><ul><ul><ul><li>rdf:resource =&quot;http://dbpedia.org/resource/Category:Psycholeptics&quot;/> </li></ul></ul></ul><ul><ul><li></rdf:Description> </li></ul></ul><ul><ul><li>nested </li></ul></ul><ul><ul><ul><li><rdf:Description rdf:about=&quot; http://dbpedia.org/resource/Propranolol &quot;> </li></ul></ul></ul><ul><ul><ul><li><skos:subject> </li></ul></ul></ul><ul><ul><ul><li><rdf:Description rdf:about =&quot;http://dbpedia.org/resource/Category:Anxiolytics&quot;> </li></ul></ul></ul><ul><ul><ul><li><skos:broader </li></ul></ul></ul><ul><ul><ul><li>rdf:resource =&quot;http://dbpedia.org/resource/Category:Psycholeptics&quot;/> </li></ul></ul></ul><ul><ul><ul><li></rdf:Description> </li></ul></ul></ul><ul><ul><ul><li></skos:subject> </li></ul></ul></ul><ul><ul><ul><li></rdf:Description> </li></ul></ul></ul>dbpedia:Propranolol category:Anxiolytics skos:subject Category:Psycholeptics skos:broader
    22. 22. RDF in a nutshell Serializing RDF in XML – more statements 3/3 <ul><li>E.g. </li></ul><ul><li>Applying all abbreviations becomes </li></ul><ul><ul><li><dbpedia-owl:Drug rdf:about=&quot; http://dbpedia.org/resource/Propranolol &quot; > </li></ul></ul><ul><ul><li><rdfs:label xml:lang=&quot;it&quot;>Propranololo</rdfs:label> </li></ul></ul><ul><ul><li><skos:subject> </li></ul></ul><ul><ul><li><skos:concept r df:about =&quot;http://dbpedia.org/resource/Category:Anxiolytics&quot;> </li></ul></ul><ul><ul><li><skos:broader> </li></ul></ul><ul><ul><li><skos:concept </li></ul></ul><ul><ul><li>r df:about =&quot;http://dbpedia.org/resource/Category:Psycholeptics&quot;/> </li></ul></ul><ul><ul><li></skos:broader> </li></ul></ul><ul><ul><li></skos:concept> </li></ul></ul><ul><ul><li></skos:subject> </li></ul></ul><ul><ul><li></dbpedia-owl:Drug> </li></ul></ul>dbpedia:Propranolol category:Anxiolytics skos:subject Category:Psycholeptics skos:broader http://dbpedia.org/ontology/Drug skos:concept “ Propranololo”@it rdfs:label
    23. 23. RDF in a nutshell Merging XML files (representing an RDF model) <ul><li>Suppose you have to merge the two following XML </li></ul><ul><li>Merging the XML trees is difficult, but being RDF … </li></ul><ul><ul><li><Drug rdf:about=&quot;Propranolol&quot;> </li></ul></ul><ul><ul><li><skos:subject> </li></ul></ul><ul><ul><li><skos:concept rdf:about=&quot;Anxiolytics&quot;/> </li></ul></ul><ul><ul><li></skos:subject > </li></ul></ul><ul><ul><li><excretion> </li></ul></ul><ul><ul><li><AnatomicalStructure rdf:about=&quot;Kidney&quot;/> </li></ul></ul><ul><ul><li></excretion> </li></ul></ul><ul><ul><li></Drug> </li></ul></ul><ul><ul><li><skos:concept rdf:about=&quot; Anxiolytics &quot; </li></ul></ul><ul><ul><li>skos:isSubjectOf=&quot; Propranolol &quot;> </li></ul></ul><ul><ul><li><canDamage> </li></ul></ul><ul><ul><li>< AnatomicalStructure </li></ul></ul><ul><ul><li>rdf:about=&quot; Kidney &quot;/> </li></ul></ul><ul><ul><li></canDamage> </li></ul></ul><ul><ul><li></skos:concept> </li></ul></ul>Propranolol Anxiolytics Drug rdf : type rdf : type skos:subject Concept Kidney rdf : type AnatomicalStructure excretion Propranolol Anxiolytics rdf : type Concept Kidney rdf : type AnatomicalStructure canDamage skos:isSubjectOf
    24. 24. RDF in a nutshell Merging XML files 2/2 <ul><li>It’s (just) a matter to merge the two RDF graphs </li></ul><ul><li>NOTE: It works out nicely because both RDF/XML documents refer to the same resources and use the same vocabularies. </li></ul>U Propranolol Anxiolytics Drug rdf : type rdf : type skos:subject Concept Kidney AnatomicalStructure canDamage excretion skos:isSubjectOf rdf : type
    25. 25. Publishing RDF as Linked Data Principles <ul><li>Things must be identified with dereferenceable HTTP URIs. </li></ul><ul><li>If such a URI is dereferenced asking for the MIME-type application/rdf+xml, a data source must return an RDF/XML description of the identified resource. </li></ul><ul><ul><ul><li>Information Resources </li></ul></ul></ul><ul><ul><ul><li>Non-Information Resources </li></ul></ul></ul><ul><li>Besides RDF links to resources within the same data source, RDF descriptions should also contain RDF links to resources provided by other data sources </li></ul>
    26. 26. Publishing RDF as Linked Data More on Content Negotiation <ul><li>Approach </li></ul><ul><li>E.g. </li></ul><ul><ul><li>Resource identifier </li></ul></ul><ul><ul><ul><li>http://dbpedia.org/resource/Propranolol </li></ul></ul></ul><ul><ul><li>RDF representation describing Propranolol </li></ul></ul><ul><ul><ul><li>http://dbpedia.org/ data /Propranolol .rdf </li></ul></ul></ul><ul><ul><li>HTML representation describing Propranolol </li></ul></ul><ul><ul><ul><li>http://dbpedia.org/ page /Propranolol </li></ul></ul></ul><ul><li>Test it! http://idi.fundacionctic.org/vapour </li></ul>
    27. 27. Publishing RDF as Linked Data Recipes for Serving Information as Linked Data <ul><li>Recipes [1] </li></ul><ul><li>Serving static RDF files </li></ul><ul><li>Serving information stored in a DB as (virtual) RDF </li></ul><ul><li>Using a RDF storage with a Linked Data Interface </li></ul><ul><li>Wrap API to serve (virtual) RDF </li></ul><ul><li>[1] http://www4.wiwiss.fu-berlin.de/bizer/pub/LinkedDataTutorial/ </li></ul>
    28. 28. Publishing RDF as Linked Data Recipe 1 - Serving static RDF files 1/3 <ul><li>IDEA: negotiate content using Apache mod_rewrite by writing a .htaccess file </li></ul><ul><li>Directory layout </li></ul><ul><ul><li>apachedocumentroot/ </li></ul></ul><ul><ul><ul><li>examples/ </li></ul></ul></ul><ul><ul><ul><ul><li>.htaccess </li></ul></ul></ul></ul><ul><ul><ul><ul><li>content/ </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>file.html </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>file.rdf </li></ul></ul></ul></ul></ul><ul><li>Expected behavior </li></ul><ul><ul><li>Requesting http://localhost/examples/file </li></ul></ul><ul><ul><li>a HTML browser is redirected to http://localhost/examples/content/file.html </li></ul></ul><ul><ul><li>a Linked Data application is redirected to http://localhost/examples/content/file.rdf </li></ul></ul>
    29. 29. Publishing RDF as Linked Data Recipe 1 - Serving static RDF files 2/3 <ul><li># Turn off MultiViews </li></ul><ul><li>Options –MultiViews </li></ul><ul><li># Rewrite engine setup </li></ul><ul><li>RewriteEngine On </li></ul><ul><li>RewriteBase /examples </li></ul><ul><li># Rewrite rule to serve HTML content from the vocabulary URI if requested </li></ul><ul><li>RewriteCond %{HTTP_ACCEPT} !application/rdf+xml.*(text/html|application/xhtml+xml) </li></ul><ul><li>RewriteCond %{HTTP_ACCEPT} text/html [OR] </li></ul><ul><li>RewriteCond %{HTTP_ACCEPT} application/xhtml+xml [OR] </li></ul><ul><li>RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.* </li></ul><ul><li>RewriteRule ^example/$ content/file.html [R=303] </li></ul><ul><li># Rewrite rule to serve RDF/XML content if requested </li></ul><ul><li>RewriteCond %{HTTP_ACCEPT} application/rdf+xml </li></ul><ul><li>RewriteRule ^example/ content/file.rdf [R=303] </li></ul><ul><li># Rewrite rule to serve RDF/XML content by default </li></ul><ul><li>RewriteRule ^example/ content/file.rdf [R=303] </li></ul><ul><li>[source: http://www.w3.org/TR/swbp-vocab-pub/#recipe4example ] </li></ul>
    30. 30. Publishing RDF as Linked Data Recipe 1 - Serving static RDF files 3/3 <ul><li>Testing the configuration </li></ul>http://localhost/examples/ file http://localhost/examples/ content/file.html http://localhost/examples/content/file.html http://localhost/examples/ file http://localhost/examples/ content/file.rdf http://localhost/examples/content/file.rdf
    31. 31. Publishing RDF as Linked Data Recipe 2 - DB as (virtual) RDF <ul><li>General Idea </li></ul><ul><li>Ready to use solutions </li></ul><ul><ul><li>D2R Server </li></ul></ul><ul><ul><ul><li>http://sites.wiwiss.fu-berlin.de/suhl/bizer/d2r-server/index.html#quickstart </li></ul></ul></ul><ul><ul><li>OpenLink Virtuoso </li></ul></ul><ul><ul><ul><li>http://virtuoso.openlinksw.com/Whitepapers/pdf/Virtuoso_SQL_to_RDF_Mapping.pdf </li></ul></ul></ul><ul><ul><ul><li>http://virtuoso.openlinksw.com/Whitepapers/pdf/Deploying_Linked_Data_Final1.pdf </li></ul></ul></ul><ul><ul><li>Triplify </li></ul></ul><ul><ul><ul><li>http://triplify.org/Overview </li></ul></ul></ul>
    32. 32. Publishing RDF as Linked Data Recipe 3 - RDF storage + Linked Data Interface <ul><li>General Idea </li></ul><ul><li>Ready to use solutions </li></ul><ul><ul><li>Pubby : a Linked Data interfaces to SPARQL endpoints. </li></ul></ul><ul><ul><ul><li>http://www4.wiwiss.fu-berlin.de/pubby/ </li></ul></ul></ul>
    33. 33. Publishing RDF as Linked Data Recipe 4 - Wrap API to serve (virtual) RDF <ul><li>General Idea </li></ul><ul><li>No “general” solutions, only ad hoc ones </li></ul><ul><ul><li>Virtuoso Sponger : a framework for developing Linked Data wrappers (called cartridges) around different types of data sources </li></ul></ul><ul><ul><ul><li>http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtSponger </li></ul></ul></ul><ul><ul><ul><li>http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtSpongerCartridgeSupportedDataSources </li></ul></ul></ul><ul><ul><li>SIOC Exporters </li></ul></ul><ul><ul><ul><li>http://sioc-project.org/exporters </li></ul></ul></ul>[source http://sites.wiwiss.fu-berlin.de/suhl/bizer/pub/Bizer-ESWC2007-RDFbookmashup.pdf ]
    34. 34. Publishing RDF as Linked Data Which recipe should I use? <ul><li>How much data do you want to serve? </li></ul><ul><ul><li>several hundred RDF triples: recipe 1 </li></ul></ul><ul><ul><li>Larger dataset: recipe 2, 3 and 4 </li></ul></ul><ul><li>How is your data currently stored? </li></ul><ul><ul><li>In a relational database: recipe 2 </li></ul></ul><ul><ul><li>Available through an API: recipe 4 </li></ul></ul><ul><ul><li>As RDF dump: recipe 3 </li></ul></ul><ul><li>How often does your data change? </li></ul><ul><ul><li>Frequently: recipe 2 and 4 </li></ul></ul><ul><ul><li>Rarely: recipe 1 and 3 </li></ul></ul>
    35. 35. RDF in a nutshell RDF Resources <ul><li>RDF at the W3C - primer and specifications </li></ul><ul><ul><li>http://www.w3.org/RDF/ </li></ul></ul><ul><li>Semantic Web tools - community maintained list; includes triple store, programming environments, tool sets, and more </li></ul><ul><ul><li>http://esw.w3.org/topic/SemanticWebTools </li></ul></ul><ul><li>302 Semantic Web Videos and Podcasts - includes a section specifically on RDF videos </li></ul><ul><ul><li>http://www.semanticfocus.com/blog/entry/title/302-semantic-web-videos-and-podcasts/ </li></ul></ul>
    36. 36. credits <ul><li>Some slides are derived from </li></ul><ul><ul><li>“ How to Publish Linked Data on the Web” by Chris Bizer, Richard Cyganiak and Tom Heath http://sites.wiwiss.fu-berlin.de/suhl/bizer/pub/LinkedDataTutorial/ </li></ul></ul>
    1. A particular slide catching your eye?

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

    ×