Your SlideShare is downloading. ×
  • Like
  • Save
Semantic Web - RDF
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Semantic Web - RDF

  • 545 views
Published

 

Published in Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
545
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
4

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. Faculty of Science, Technology and Communication (FSTC) Bachelor en informatique (professionnel) Semantic Web Unit 4: RDF and RDF Schema Trust Proof Rules Logic Data Ontology vocabulary RDF + RDF Schema Data XML + Namespaces + XML Schema •URI •Unicode Digital Signature Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 1
  • 2. 44.. RRDDFF aanndd RRDDFF SScchheemmaa Semantic Web Roadmap: Controlled growth bottom up according to this architecture. Architecture was (slightly) modified in the last years. Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 2
  • 3. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..11.. WWhhyy iiss XXMMLL nnoott SSuuffffiicciieenntt?? 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss 44..33.. RRDDFF SScchheemmaa ((RRDDFFSS)) 44..44.. SSPPAARRQQLL –– RRDDFF QQuueerryy LLaanngguuaaggee 44..55.. SShhaarriinngg VVooccaabbuullaarryy iinn RRDDFF 44..66.. JJeennaa –– RRDDFF iinn JJaavvaa 44..77.. RReeffeerreenncceess Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 3
  • 4. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.1. Why iiss XXMMLL nnoott SSuuffffiicciieenntt?? Level of knowledge representation and semantics OWL domain knowledge, interconnections RDF / RDF Schema knowledge about objects, relations between objects XML / XML Schema objects, structure Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 4
  • 5. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.1. Why iiss XXMMLL nnoott SSuuffffiicciieenntt?? ? Problem 1: missing relational expressivity Christoph Meinel Viola Brehmer Long Wang XML document Feng Cheng Dirk Cordel Serge Linckels Harald Sack What is the relation between a "Professor", a "Secretary" and a "PhDStudent"? <ChairMeinel> <Professor> <FirstName>Christoph</FirstName> <LastName>Meinel</LastName> </Professor> <Secretary>Viola Brehmer</Secretary> <PhDStudent>Long Wang</PhDStudent> <PhDStudent>Feng Cheng</PhDStudent> <PhDStudent>Dirk Cordel</PhDStudent> <PhDStudent>Serge Linckels</PhDStudent> <FormerPhDStudent>Harald Sack</FormerPhDStudent> </ChairMeinel> We need a more powerful formalism above XML to describe relations between objects Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 5
  • 6. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.1. Why iiss XXMMLL nnoott SSuuffffiicciieenntt?? Problem 2: missing relational expressivity XML document 2 XML document 1 <phonenumber> <person> <owner>Serge Linckels</owner> <number>++352-691-123456</number> </phonenumber> ? <person name="Serge Linckels" phone="++352-691-123456" /> Are all three documents equivalent? Do they represent the same information? We need a more powerful formalism above XML to <name>Serge Linckels</name> <phone>++352-691-123456</phone> </person> Solving this kind of problem requires a matching of all 3 documents and their according DTD / XML Schema, e.g., with XSLT. This reengineering is difficult, complex and can be avoided. describe objects with a shared vocabulary XML document 3 Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 6
  • 7. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF overview Resource Description Framework RDF allows to describe resources in a more expressive way than XML RDF can be serialized as XML (or in other formats) The syntax of a RDF document can be described in a RDF Schema RDF documents can be queried using optimized query languages, e.g., SPARQL Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 7
  • 8. Statement 1 Statement 2 English RDF 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF standard W3C recommendation Make statements (assertions) about resources, e.g., "Serge Linckels is a teacher. He teaches RDF." The object "Serge Linckels" has a property "hasJob" that has the value "teacher" The object "Serge Linckels" has a property "toTeach" that has the value "RDF" RDF statement A RDF statement is a "triple": resource – property – value hasJob Serge Linckels teacher Subject Predicate Object Resource Property Value Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 8
  • 9. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF graph RDF statements are represented as directed and labeled graphs, where each resource is represented as a node Each resource is identified by a URI teacher hasJob RDF toTeach http://www.linckels.lu/ RDF serialization RDF graphs can be serialized in different formats, e.g., as XML <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdf:Description rdf:about="http://www.linckels.lu/"> <myNS:hasJob>teacher</myNS:hasJob> <myNS:toTeach>RDF</myNS:toTeach> </rdf:Description> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 9
  • 10. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF validation RDF graphs can be validated with "a validator", e.g., http://www.w3.org/RDF/Validator/ Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 10
  • 11. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss More about objects An RDF object can be a literal hasJob Serge Linckels teacher is a literal An RDF object can be a resource Serge Linckels worksWith Denis Zampuniéris is a resource <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdf:Description rdf:about="http://www.linckels.lu/"> <myNS:hasJob>teacher</myNS:hasJob> <myNS:worksWith rdf:resource="http://www.zampunieris.be" /> </rdf:Description> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 11
  • 12. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss Example – RDF graph hasTitle likesToRead ISBN: 2-495-10604-8 worksWith Les Générations Pascal hasJob http://www.zampunieris.be teacher hasName Serge Linckels RDF hasJob hasName toTeach professor Denis Zampuniéris hasAuthor http://www.linckels.lu/ Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 12
  • 13. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss Example – XML serialization <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdf:Description rdf:about="http://www.linckels.lu/"> <myNS:hasJob>teacher</myNS:hasJob> <myNS:hasName>Serge Linckels</myNS:hasName> <myNS:toTeach>RDF</myNS:toTeach> <myNS:worksWith rdf:resource="http://www.zampunieris.be/" /> </rdf:Description> <rdf:Description rdf:about="http://www.zampunieris.be/"> <myNS:hasJob>professor</myNS:hasJob> <myNS:hasName>Denis Zampunieris</myNS:hasName> <myNS:likesToRead rdf:resource="ISBN: 2-495-10604-8" /> </rdf:Description> <rdf:Description rdf:about="ISBN: 2-495-10604-8"> <myNS:hasTitle>Les Générations Pascal</myNS:hasTitle> <myNS:hasAuthor rdf:resource="http://www.linckels.lu/" /> </rdf:Description> </rdf:RDF> Related elements must not be nested within the elements they are related to Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 13
  • 14. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF directed graph – 3 types of nodes teacher hasJob uriref node http://www.linckels.lu/ literal Serge first Linckels last fullname blank node <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdf:Description rdf:about="http://www.linckels.lu/"> <myNS:fullname> <rdf:Description> <myNS:first>Serge</myNS:first> <myNS:last>Linckels</myNS:last> </rdf:Description> </myNS:fullname> <myNS:hasJob>teacher</myNS:hasJob> <myNS:toTeach>RDF</myNS:toTeach> </rdf:Description> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 14
  • 15. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF type attribute rdf:type explicitly specifies the type of a resource The following two examples are equivalent <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdf:Description rdf:about="http://www.linckels.lu/"> <myNS:hasName>Serge Linckels</myNS:hasName> <myNS:hasJob>teacher</myNS:hasJob> <myNS:toTeach>RDF</myNS:toTeach> <rdf:type rdf:resource="http://www.linckels.lu/myNS/Person" /> </rdf:Description> </rdf:RDF> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <myNS:Person rdf:about="http://www.linckels.lu/"> <myNS:hasName>Serge Linckels</myNS:hasName> <myNS:hasJob>teacher</myNS:hasJob> <myNS:toTeach>RDF</myNS:toTeach> </myNS:Person> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 15
  • 16. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF datatypes rdf:datatype explicitly specifies the type of a literal No implicit semantics are attached to typed literals <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"> <myNS:Person rdf:about="http://www.linckels.lu/"> <myNS:hasName rdf:datatype="xsd:string">Serge Linckels</myNS:hasName> <myNS:luckyNumber rdf:datatype="xsd:integer">12</myNS:luckyNumber> </myNS:Person> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 16
  • 17. rdf:Bag 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF containers - example Serge Linckels http://www.linckels.lu/ Aviation _1 Krav Maga _2 hasName hasHobbies <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdf:Description rdf:about="http://www.linckels.lu/"> <myNS:hasHobbies> <rdf:Bag> <rdf:li>Aviation</rdf:li> <rdf:li>Krav Maga</rdf:li> </rdf:Bag> </myNS:hasHobbies> <myNS:hasName>Serge Linckels</myNS:hasName> </rdf:Description> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 17
  • 18. Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 18
  • 19. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF containers - overview rdf:Bag – containing unordered lists of resources or literals, with duplicate data allowed rdf:Seq – containing ordered lists of resources or literals, with duplicate data allowed rdf:Alt – containing resources or literals that represent possible alternatives for a specific value RDF collections - overview Unlike a container, a collection is a finite grouping of resources or literals <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdf:Description rdf:about="http://www.linckels.lu/"> <myNS:hasFriends rdf:parseType="Collection"> <rdf:Description rdf:about="http://www.toto.lu" /> <rdf:Description rdf:about="http://www.titi.lu" /> <rdf:Description rdf:about="http://www.tata.lu" /> </myNS:hasFriends> <myNS:hasName>Serge Linckels</myNS:hasName> </rdf:Description> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 19
  • 20. rdf:list 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF lists Serge Linckels http://www.linckels.lu/ hasName hasFriends http://www.toto.lu/ rdf:first http://www.titi.lu/ rdf:rest rdf:first http://www.tata.lu/ rdf:rest rdf:first rdf:rest rdf:nil A list is a terminated sequence of items Traversing a list becomes a matter of finding the start node and then accessing the next predicates for that node Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 20
  • 21. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF lists <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdf:Description rdf:about="http://www.linckels.lu/"> <myNS:hasFriends> <rdf:List> <rdf:first rdf:resource="http://www.toto.lu" /> <rdf:rest> <rdf:List> <rdf:first rdf:resource="http://www.titi.lu" /> <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/> </rdf:List> </rdf:rest> </rdf:List> </myNS:hasFriends> <myNS:hasName>Serge Linckels</myNS:hasName> </rdf:Description> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 21
  • 22. rdf:Statement 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss Reification Reification is a method of formally modeling a statement about another statement Serge Linckels says are This lemon sweet <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdf:Description rdf:about="http://www.linckels.lu/"> <myNS:says rdf:resource="#myStatement" /> </rdf:Description> <rdf:Statement rdf:about="#myStatement"> <rdf:subject rdf:resource="http://www.lemon123.lu" /> <rdf:predicate rdf:resource="myNS:are" /> <rdf:object>sweet</rdf:object> </rdf:Statement> </rdf:RDF> identification of the statement Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 22
  • 23. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss rdf:Statement Reification – problem Reification is always an subjective view and can cause ambiguities Serge Linckels says are Who do you believe? This lemon sweet are bitter rdf:Statement Denis Zampunieris says Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 23
  • 24. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss Reification is useful Useful to formally express trust Serge Linckels says π 1.61803 hasValue hasValue 3.14159 Create metadata over assertions (assertion ≠ fact) says Who do you believe? A. Einstein D. Zampunieris M. Planck O. Hahn says says says Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 24
  • 25. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF helps to make semantic relations between databases Relations between distinct databases can made explicit  same URI = same resources Data can be integrated (from one database into another)  same URI, same vocabulary Database 1 Database 2 hasTitle Les Générations Pascal http://www.men.lu publishedBy ISBN: 2-495-10604-8 hasAuthor http://www.linckels.lu/ Ministère de l'Éducation Nationale hasName http://www.men.lu hasProject http://www.myschool.lu Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 25
  • 26. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..22.. RRDDFF SSppeecciiffiiccaattiioonnss RDF helps to make semantic relations between databases Relations between distinct databases can made explicit  same URI = same resources Data can be integrated (from one database into another)  same URI, same vocabulary Les Générations Pascal hasTitle ISBN: 2-495-10604-8 hasAuthor http://www.linckels.lu/ publishedBy Ministère de l'Éducation Nationale hasName http://www.men.lu hasProject http://www.myschool.lu Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 26
  • 27. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..33.. RRDDFF SScchheemmaa ((RRDDFFSS)) RDFS overview RDFS specifies: - how RDF constructs relate to each other - how RDF constructs can be diagrammed in XML RDFS is a rules-based dictionary that: - defines the elements of importance to a domain - describes how these elements relate to one another RDF is a way of describing data RDFS is a domain-neutral way of describing the metadata that can be used to describe the data for domain-specific vocabulary RDFS allows to define: - abstract datatypes (classes) - hierarchically structure the datamodel - properties and relations (e.g., inheritance) Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 27
  • 28. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..33.. RRDDFF SScchheemmaa ((RRDDFFSS)) RDFS – defining classes rdfs:class – definition of a new class that inherits from the super class specified in rdfs:subClassOf rdfs:Resource is the RDFS top-class rdfs:Resource myNS:Person fullname rdf:Property – definition of a new property of a class specified in rdfs:domain Example: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <rdfs:class rdf:about="http://www.linckels.lu/myNS/Person"> <rdfs:subClassOf rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Resource" /> </rdfs:class> <rdf:Property rdf:about="http://www.linckels.lu/myNS/fullname"> <rdfs:domain rdf:resource="http://www.linckels.lu/myNS/Person" /> </rdf:Property> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 28
  • 29. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..33.. RRDDFF SScchheemmaa ((RRDDFFSS)) RDFS – defining a instance of a class <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:myNS="http://www.linckels.lu/myNS/"> <rdfs:class rdf:about="http://www.linckels.lu/myNS/Person"> <rdfs:subClassOf rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Resource" /> </rdfs:class> <rdf:Property rdf:about="http://www.linckels.lu/myNS/fullname"> <rdfs:domain rdf:resource="http://www.linckels.lu/myNS/Person" /> </rdf:Property> <myNS:Person rdf:about="http://www.linckels.lu/"> <myNS:fullname>Serge Linckels</myNS:fullname> </myNS:Person> </rdf:RDF> <rdf:Description rdf:about="http://www.linckels.lu/"> = <myNS:fullname>Serge Linckels</myNS:fullname> <rdf:type rdf:resource="http://www.linckels.lu/myNS/Person" /> </rdf:Description> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 29
  • 30. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..33.. RRDDFF SScchheemmaa ((RRDDFFSS)) RDFS – defining relations and restrictions rdfs:Resource myNS:Person worksFor age myNS:Firm rdfs:range – specifies the classes the property can reference as values This mechanism allows to define basic relations between classes and to define datatypes for property values A validator checks only the syntax, not if the values for properties are correct. This task must be assumed by the application. ! <rdf:Property rdf:about="http://www.linckels.lu/myNS/worksFor"> <rdfs:domain rdf:resource="http://www.linckels.lu/myNS/Person" /> <rdfs:range rdf:resource="http://www.linckels.lu/myNS/Firm" /> </rdf:Property> <rdf:Property rdf:about="http://www.linckels.lu/myNS/age"> <rdfs:domain rdf:resource="http://www.linckels.lu/myNS/Person" /> <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer" /> </rdf:Property> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 30
  • 31. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..33.. RRDDFF SScchheemmaa ((RRDDFFSS)) RDFS – other elements rdfs:label – provides a (human) readable version the resource's name rdfs:Literal - defines a node as being a literal value, not a resource rdfs:Comment – defines a comment rdfs:Container – superclass of all RDF container elements (rdf:Bag, rdf:Seq and rdf:Alt) rdfs:member – superproperty for each numbered container element (e.g., _1, _2, etc.) rdfs:subPropertyOf – specifies a property as a refinement of another property rdfs:seeAlso – identifies another resource that contains additional information rdfs:isDefinedBy – identifies the namespace for the resource, preventing any ambiguity Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 31
  • 32. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.4. SPARQL –– RRDDFF QQuueerryy LLaanngguuaaggee RDF query languages – overview There exists multiple languages to query RDF data: ARQ, RDQL, N3QL, RQL, SPARQL, SeRQL, Versa, XUL, Adenine, RDQ, N3QL… SPARQL (SPARQL Protocol and RDF Query Language) was standardized in January 2008 by the W3C "SQL like" syntax to query RDF data as triples Example: "show me all firms that have employees" @prefix myNS: <http://www.linckels.lu/myNS#> SELECT DISTINCT ?X FROM <http://www.linckels.lu/myRDF-file.rdf> WHERE { myNS:Person myNS:worksFor ?X . } triple Complex filtering is possible, e.g., - string operations - conjunctions and disjunctions of logical tests - datatype checking Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 32
  • 33. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.4. SPARQL –– RRDDFF QQuueerryy LLaanngguuaaggee RDF query languages – overview Example: "show me all persons and the firms they work for, who are between 31 and 40 in age" @prefix myNS: <http://www.linckels.lu/myNS#> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?person ?firm FROM <http://www.linckels.lu/myRDF-file.rdf> WHERE { ?person rdf:type myNS:Person . ?person myNS:worksFor ?firm . ?firm rdf:type myNS:Firm . ?person myNS:age ?age . FILTER (?age > 30) . FILTER (?age <= 40) . } Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 33
  • 34. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.5. Sharing VVooccaabbuullaarryy iinn RRDDFF Problem with not identical predicates Les Générations Pascal hasTitle ISBN: 2-495-10604-8 Les Générations Pascal avoirTitre ISBN: 2-495-10604-8 = ? - Resources are equal because same URI - Objects are equal because same value  are both predicates equal ? Use (as far as possible) existing vocabulary for predicates, or share your own vocabulary with others Examples: Dublin Core (DC), Friend of a Friend (FOAF) Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 34
  • 35. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.5. Sharing VVooccaabbuullaarryy iinn RRDDFF Dublin Core (DC) DC metadata element set is a standard for cross-domain information resource description Provides a simple and standardized set of conventions for describing resources DC is widely used to describe digital materials such as video, sound, image, text, and composite media like web pages DC is controlled by Dublin Core Metadata Initiative (DCMI), an organization providing an open forum for the development of interoperable online metadata standards Les Générations Pascal Dublin Core is defined by NISO Standard Z39.85-2007 http://dublincore.org/ dc:title ISBN: 2-495-10604-8 Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 35
  • 36. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.5. Sharing VVooccaabbuullaarryy iinn RRDDFF Dublin Core (DC) Simple Dublin Core Metadata Element Set (DCMES) consists of 15 metadata elements title : a name given to a resource creator : an entity responsible for making the content of the resource subject : the topic of the content of the resource description : an account of the content of the resource publisher : an entity responsible for making the content available contributor : an entity responsible for making contributions to the content of the resource date : a date associated with an event in the life cycle of the resource type : the nature or genre of the content of the resource format : the physical or digital manifestation of the resource identifier : an unambiguous reference to the resource within a given context source : a reference to the resource from which the present resource is derived language : a language of the intellectual content of the resource relation : a reference to a related resource coverage : the extent or scope of the content of the resource rights : information about rights held in and over the resource Qualified Dublin Core Metadata Element Set (QDCME) includes three additional elements (audience, provenance and rightsholder), as well as a group of element refinements Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 36
  • 37. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.5. Sharing VVooccaabbuullaarryy iinn RRDDFF Friend of a Friend (FOAF) FOAF is a way to describe people and relationships to computers; it is a vocabulary http://www.foaf-project.org/ Agent Person name nick title homepage mbox mbox_sha1sum img depiction surname family_name givenname firstName FOAF Basics weblog knows interest currentProject pastProject plan based_near workplaceHomepage workInfoHomepage schoolHomepage topic_interest publications geekcode myersBriggs dnaChecksum Personal Info OnlineAccount OnlineChatAccount OnlineEcommerceAccount OnlineGamingAccount holdsAccount accountServiceHomepage accountName icqChatID msnChatID aimChatID jabberID yahooChatID Online Accounts Document Image PersonalProfileDocument topic (page) primaryTopic tipjar sha1 made (maker) thumbnail logo Projects & Groups Documents & Images Project Organization Group member membershipClass fundedBy theme Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 37
  • 38. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 4.5. Sharing VVooccaabbuullaarryy iinn RRDDFF Mixing Vocabularies Les Générations Pascal Serge Linckels RDF dc:title foaf:name myNS:toTeach ISBN: 2-495-10604-8 dc:creator http://www.linckels.lu/ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:myNS="http://www.linckels.lu/myNS/"> <myNS:Person rdf:about="http://www.linckels.lu/"> <foaf:name>Serge Linckels</foaf:name> <myNS:toTeach>RDF</myNS:toTeach> </myNS:Person> <rdf:Description rdf:about="ISBN: 2-495-10604-8"> <dc:title>Les Générations Pascal</dc:title> <dc:creator rdf:resource="http://www.linckels.lu/" /> </rdf:Description> </rdf:RDF> Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 38
  • 39. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..66.. JJeennaa –– RRDDFF iinn JJaavvaa Jena – overview Jena is a Java framework for building Semantic Web applications Jena provides a programmatic environment for RDF, RDFS, OWL and SPARQL Jena is open source and grown out of work with the HP Labs Semantic Web Programme http://jena.sourceforge.net/ Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 39
  • 40. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..66.. JJeennaa –– RRDDFF iinn JJaavvaa Jena – example: creating a resource import com.hp.hpl.jena.mem.ModelMem; import com.hp.hpl.jena.rdf.model.*; static String myDemo= "http://www.linckels.lu/"; static String myNS = " http://www.linckels.lu/myNS"; // create an empty graph Model myModel = new ModelMem(); // create the resource Resource myResource = myModel.createResource(myDemo); // create the predicate (property) Property fullname = myModel.createProperty(myNS,"fullname"); // add the property with associated value (object) myResource.addProperty(fullname, "Serge Linckels"); // print RDF/XML of model to system out myModel.write(new PrintWriter(System.out)); Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 40
  • 41. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..66.. JJeennaa –– RRDDFF iinn JJaavvaa Jena – example: browsing through a graph // using a statement iterator StmtIterator iter = myModel.listStatements(); while (iter.hasNext()) { // read a statement (resource, predicate, object) Statement stmt = iter.next(); // identify resource Resource subject = stmt.getSubject(); // identify predicate Property predicate = stmt.getPredicate(); // identify object RDFNode object = stmt.getObject(); // output System.out.print("("+predicate.toString()+","); System.out.print(subject.toString()+","); System.out.println(object.toString()+")"); } Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 41
  • 42. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..66.. JJeennaa –– RRDDFF iinn JJaavvaa Jena – example: read and write a file String filename = "myFile.rdf"; // creating a model Model myModel = new ModelMem(); // read a file Model.read(new FileReader(filename)); // write a file Model.write(new PrintWriter(System.out)); Jena – example: creating a container Bag bag = myModel.createBag(); bag.add("Romeo and Juliet") bag.add("Hamlet") bag.add("Othello"); NodeIterator iter = bag.iterator(); while (iter.hasNext()) { System.out.println(" " + iter.next().toString()); } Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 42
  • 43. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..77.. RReeffeerreenncceess E-Librarian Service User-Friendly Semantic Search in Digital Libraries Serge Linckels, Christoph Meinel Creating the Semantic Web with RDF: Professional Developer's Guide Johan Hjelm Practical RDF Shelley Powers Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 43
  • 44. 44.. RRDDFF aanndd RRDDFF SScchheemmaa 44..77.. RReeffeerreenncceess A Semantic Web Primer (Cooperative Information Systems) Grigoris Antoniou , Frank van Harmelen Semantic Web: Concepts, Technologies and Applications K.K. Breitman, M.A. Casanova, W. Truszkowski Foundations of Semantic Web Technologies Pascal Hitzler, Markus Krötzsch, Sebastian Rudolph Semantic Web ::: Serge Linckels ::: www.linckels.lu ::: serge@linckels.lu ::: 44