SlideShare une entreprise Scribd logo
1  sur  16
Chapter: 2 (Tutorial)
1
RDF Graphs:
Give the RDF/XML, Notation 3, triples for the following sentences and also draw the RDF graph.
1. The lecture is attended by Kishoj, Pradeep, Mohan and Dipendra.
RDF/XML:
<rdf:RDF
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex = "http://example.org/"
>
<rdf:Description rdf:about="http://example.org/lecture">
<ex:isAttendedBy>
<rdf:Bag>
<rdf:li rdf:resource = "http://example.org/Kishoj"/>
<rdf:li rdf:resource = "http://example.org/Pradeep"/>
<rdf:li rdf:resource = "http://example.org/Mohan"/>
<rdf:li rdf:resource = "http://example.org/Dipendra"/>
</rdf:Bag>
</ex:isAttendedBy>
</rdf:Description>
</rdf:RDF>
Notation 3:
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix ex: <http://example.org/>.
ex:lecture ex:isAttendedBy _:bnode1.
_:bnode1 rdf:type rdf:Bag;
rdf:_1 ex:Kishoj;
rdf:_2 ex:Pradeep;
rdf:_3 ex:Mohan;
rdf:_4 ex:Dipendra.
Triples:
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-
syntax-ns#Bag>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> <http://example.org/Kishoj>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> <http://example.org/Pradeep>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> <http://example.org/Mohan>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> <http://example.org/Dipendra>.
<http://example.org/lecture> <http://example.org/isAttendedBy> _:bnode1.
Chapter: 2 (Tutorial)
2
2. [RDF-Concept] is studied by Kishoj and Pradeep in order.
RDF/XML:
<rdf:RDF
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex = "http://example.org/"
>
<rdf:Description rdf:about="http://www.w3.org/TR/rdf-concepts/">
<ex:studiedBy>
<rdf:Seq>
<rdf:li rdf:resource = "http://example.org/Kishoj"/>
<rdf:li rdf:resource = "http://example.org/Pradeep"/>
</rdf:Seq>
</ex:studiedBy>
</rdf:Description>
</rdf:RDF>
Notation 3:
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix ex: <http://example.org/>.
<http://www.w3.org/TR/rdf-concepts/> ex:studiedBy _:bnode1.
_:bnode1 rdf:type rdf:Seq;
rdf:_1 ex:Kishoj;
rdf:_2 ex:Pradeep.
Triples:
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-
syntax-ns#Seq>.
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> <http://example.org/Kishoj>.
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> <http://example.org/Pradeep>.
<http://www.w3.org/TR/rdf-concepts/> <http://example.org/studiedBy> _:b1.
Chapter: 2 (Tutorial)
3
3. The software Mobile Tracker can be downloaded from three links link1or link2 or link3.
RDF/XML:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex = "http://example.org/"
>
<rdf:Description rdf:about="http://example.org/MobileTraker">
<ex:sourceLocation>
<rdf:Alt>
<rdf:li rdf:resource = "http://example.org/Link1"/>
<rdf:li rdf:resource = "http://example.org/Link2"/>
<rdf:li rdf:resource = "http://example.org/Link3"/>
</rdf:Alt>
</ex:sourceLocation>
</rdf:Description>
</rdf:RDF>
Notation 3:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix ex: <http://example.org/>.
ex:MobileTraker ex:sourceLocation _:bnode1.
_:bnode1 rdf:type rdf:Alt;
rdf:_1 ex:Link1;
rdf:_2 ex:Link2;
rdf:_3 ex:Link3.
Triples:
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-
syntax-ns#Alt>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> <http://example.org/Link1>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> <http://example.org/Link2>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> <http://example.org/Link3>.
<http://example.org/MobileTraker> <http://example.org/sourceLocation> _:bnode1.
Chapter: 2 (Tutorial)
4
Convert the given graph to RDF/XML, Notation 3, turtle, triples and JSON.
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:ex="http://example.org/stuff/1.0/">
<rdf:Description rdf:about="http://www.w3.org/TR/rdf-syntax-grammar"
dc:title="RDF/XML Syntax Specification (Revised)">
<ex:editor>
<rdf:Description ex:fullName="Dave Beckett">
<ex:homePage rdf:resource="http://purl.org/net/dajobe/" />
</rdf:Description>
</ex:editor>
</rdf:Description>
</rdf:RDF>
Notation 3:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
@prefix ex: <http://example.org/stuff/1.0/>.
<http://www.w3.org/TR/rdf-syntax-grammar> ex:editor
[ ex:fullName "Dave Beckett"; ex:homePage <http://purl.org/net/dajobe/> ];
dc:title "RDF/XML Syntax Specification (Revised)".
Turtle: .ttl extension:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
Chapter: 2 (Tutorial)
5
@prefix ex: <http://example.org/stuff/1.0/>.
<http://www.w3.org/TR/rdf-syntax-grammar> dc:title "RDF/XML Syntax Specification (Revised)";
ex:editor [ ex:fullname "Dave Beckett"; ex:homePage <http://purl.org/net/dajobe/>].
Triples:
<http://www.w3.org/TR/rdf-syntax-grammar> <http://purl.org/dc/elements/1.1/title> "RDF/XML Syntax
Specification (Revised)".
_:bnode1 <http://example.org/stuff/1.0/fullName> "Dave Beckett".
_:bnode1 <http://example.org/stuff/1.0/homePage> <http://purl.org/net/dajobe/>.
<http://www.w3.org/TR/rdf-syntax-grammar> <http://example.org/stuff/1.0/editor> _:bnode1.
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Seq rdf:about="http://example.org/favourite-fruit">
<rdf:li rdf:resource="http://example.org/banana"/>
<rdf:li rdf:resource="http://example.org/apple"/>
<rdf:li rdf:resource="http://example.org/pear"/>
</rdf:Seq>
</rdf:RDF>
Tripes: .nt extension
<http://example.org/favourite-fruit> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq>.
<http://example.org/favourite-fruit> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1>
<http://example.org/banana>.
<http://example.org/favourite-fruit> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2>
<http://example.org/apple>.
<http://example.org/favourite-fruit> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3>
<http://example.org/pear>.
Turtle to graph:
@prefix : <http://example.org/stuff/1.0/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
:a :b
[ rdf:first "apple";
rdf:rest [ rdf:first "banana";
rdf:rest rdf:nil ]
] .
Chapter: 2 (Tutorial)
6
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ns="http://example.org/stuff/1.0/">
<rdf:Description rdf:about="http://example.org/stuff/1.0/a">
<ns:b>
<rdf:Description>
<rdf:first>apple</rdf:first>
<rdf:rest>
<rdf:Description>
<rdf:first>banana</rdf:first>
<rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" />
</rdf:Description>
</rdf:rest>
</rdf:Description>
</ns:b>
</rdf:Description>
</rdf:RDF>
Triples:
<http://example.org/stuff/1.0/a> <http://example.org/stuff/1.0/b> _:bnode1.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple".
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:bnode2.
_:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana".
_:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-
ns#nil>.
Chapter: 2 (Tutorial)
7
RDF collection of nodes using rdf:parseType="Collection"
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/stuff/1.0/">
<rdf:Description rdf:about="http://example.org/basket">
<ex:hasFruit rdf:parseType="Collection">
<rdf:Description rdf:about="http://example.org/banana"/>
<rdf:Description rdf:about="http://example.org/apple"/>
<rdf:Description rdf:about="http://example.org/pear"/>
</ex:hasFruit>
</rdf:Description>
</rdf:RDF>
Notation 3:
@prefix ex: <http://example.org/stuff/1.0/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
<http://example.org/basket> ex:hasFruit (<http://example.org/banana> <http://example.org/apple>
<http://example.org/pear>).
Triple:
<http://example.org/basket> <http://example.org/stuff/1.0/hasFruit> _:bnode1.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/banana>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/apple>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:bnode2.
_:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/pear>.
_:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:bnode3.
_:bnode3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-
ns#nil>.
Differentiate between two RDF/XML statement.
1. <?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Seq rdf:about="http://example.org/favourite-fruit">
<rdf:_1 rdf:resource="http://example.org/banana"/>
<rdf:_2 rdf:resource="http://example.org/apple"/>
<rdf:_3 rdf:resource="http://example.org/pear"/>
</rdf:Seq>
Chapter: 2 (Tutorial)
8
</rdf:RDF>
2. <?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Seq rdf:about="http://example.org/favourite-fruit">
<rdf:li rdf:resource="http://example.org/banana"/>
<rdf:li rdf:resource="http://example.org/apple"/>
<rdf:li rdf:resource="http://example.org/pear"/>
</rdf:Seq>
</rdf:RDF>
Both are equivalent and produces same RDF graph as shown below in figure because rdf:li, special property
element, is equivalent to rdf:_1, rdf:_2 in order.
Complete example of rdf:datatype:
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/stuff/1.0/">
<rdf:Description rdf:about="http://example.org/item01">
<ex:size rdf:datatype="http://www.w3.org/2001/XMLSchema#int">123</ex:size>
</rdf:Description>
</rdf:RDF>
Triples:
<http://example.org/item01> <http://example.org/stuff/1.0/size>
"123"^^<http://www.w3.org/2001/XMLSchema#int>.
Notation 3:
@prefix eg: <http://example.org/>.
@prefix ex: <http://example.org/stuff/1.0/>.
eg:item01 ex:size "123".
Reification: statements about statements.
1. {:John :Loves :Mary} :accordingTo :Bill.
2. Mary claims that John’s name is “John Smith”.
3. Romeo thought that {Juliet was dead}.
Romeo thought that Juliet was dead.
Chapter: 2 (Tutorial)
9
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/#">
<rdf:Description rdf:about="http://example.org/#romeo">
<ex:thought>
<rdf:Description>
<rdf:subject>
<rdf:Description rdf:about="http://example.org/#juliet"/>
</rdf:subject>
<rdf:predicate>
<rdf:Description rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
</rdf:predicate>
<rdf:object>
<rdf:Description rdf:about="http://example.org/#dead"/>
</rdf:object>
</rdf:Description>
</ex:thought>
</rdf:Description>
</rdf:RDF>
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/#">
<rdf:Description rdf:about="http://example.org/romeo">
<ex:thought>
<rdf:Description>
<rdf:subject>
<rdf:Description rdf:about="http://example.org/juliet"/>
</rdf:subject>
<rdf:predicate>
<rdf:Description rdf:about="http://example.org/was"/>
</rdf:predicate>
<rdf:object>
<rdf:Description rdf:about="http://example.org/dead"/>
</rdf:object>
</rdf:Description>
</ex:thought>
</rdf:Description>
</rdf:RDF>
Notation 3:
Chapter: 2 (Tutorial)
10
@prefix ex: <http://example.org/#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
ex:romeo ex:thought _:bnode1.
_:bnode1 rdf:subject ex:Juliet;
rdf:object ex:dead;
rdf:predicate rdf:type.
Triples:
<http://example.org/#romeo> <http://example.org/#thought> _:bnode1.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://example.org/#Juliet>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.w3.org/1999/02/22-rdf-
syntax-ns#type>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://example.org/#dead>.
John loves Mary, according to Bill.
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/">
<rdf:Description rdf:about="http://example.org/bill">
<ex:thought>
<rdf:Description>
<rdf:subject>
<rdf:Description rdf:about="http://example.org/john"/>
</rdf:subject>
<rdf:predicate>
<rdf:Description rdf:about="http://example.org/love"/>
</rdf:predicate>
<rdf:object>
<rdf:Description rdf:about="http://example.org/mary"/>
</rdf:object>
</rdf:Description>
</ex:thought>
</rdf:Description>
</rdf:RDF>
Notation 3:
@prefix ex: <http://example.org/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
ex:bill ex:thought _:bnode1.
_:bnode1 rdf:subject ex:john;
Chapter: 2 (Tutorial)
11
rdf:predicate ex:love;
rdf:object ex:mary.
Triples:
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://example.org/john>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://example.org/love>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://example.org/mary>.
<http://example.org/bill> <http://example.org/thought> _:bnode1.
Mary claims that John’s name is “John Smith”.
〈<#myStatement>, rdf:type, rdf:Statement〉
〈<#myStatement>, rdf:subject, <#john>〉
〈<#myStatement>, rdf:predicate, <#hasName>〉
〈<#myStatement>, rdf:object, ”John Smith”〉
〈<#mary>, <#claims>, <#myStatement>〉
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/">
<rdf:Description rdf:about="http://example.org/mary">
<ex:claim>
<rdf:Description>
<rdf:subject>
<rdf:Description rdf:about="http://example.org/john"/>
</rdf:subject>
<rdf:predicate>
<rdf:Description rdf:about="http://example.org/hasName"/>
</rdf:predicate>
<rdf:object>
John Smith
</rdf:object>
</rdf:Description>
</ex:claim>
</rdf:Description>
</rdf:RDF>
Notation 3:
@prefix ex: <http://example.org/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
ex:mary ex:claim _:bnode1.
_:bnode1 rdf:subject ex:john;
rdf:predicate ex:hasName;
rdf:object “John Smith”.
Triples:
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://example.org/john>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://example.org/hasName>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> “John Smith”.
<http://example.org/mary> <http://example.org/claim> _:bnode1.
Chapter: 2 (Tutorial)
12
RDF Entailment:
<http://example.org/#john> rdf:type <http://example.org/#Student>
<http://example.org/#> rdfs:subClassOf <http://example.org/#Person>
Entails: <http://example.org/#john> rdf:type <http://example.org/#Person>
Triples:
<http://example.org/#john> <http://example.org/#hasName> "John".
<http://example.org/#john> <http://example.org/#marriedTo> <http://example.org/#mary>.
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/#">
<rdf:Description rdf:about="http://example.org/#john">
<ex:hasName>John</ex:hasName>
<ex:marriedTo rdf:resource = "http://example.org/#mary"/>
</rdf:Description>
</rdf:RDF>
Notation 3:
@prefix ex: <http://example.org/#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
ex:john ex:hasName "John";
ex:marriedTo ex:mary.
Exercise 1.2: Write the following part of an RDF document in Turtle syntax:
<?xml version="1.0"?>
Chapter: 2 (Tutorial)
13
<rdf:RDF xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="Jack">
<rdf:type>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class rdf:about="Person"/>
<owl:Class>
<owl:complementOf rdf:resource="Parent"/>
</owl:Class>
</owl:intersectionOf>
</owl:Class>
</rdf:type>
</rdf:Description>
</rdf:RDF>
Turtle syntax:
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
<Jack> a _:bnode1.
<Person> a owl:Class.
_:bnode2 a owl:Class;
owl:complementOf <Parent>.
_:bnode1 a owl:Class;
owl:intersectionOf (<Person> _:bnode2).
Triples:
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>.
<Person> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>.
_:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <Person>.
_:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:bnode3.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>.
_:bnode4 <http://www.w3.org/2002/07/owl#complementOf> <Parent>.
_:bnode3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:bnode4.
_:bnode3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-
ns#nil>.
_:bnode1 <http://www.w3.org/2002/07/owl#intersectionOf> _:bnode2.
<Jack> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> _:bnode1.
Exercise 1.1 Write the following part of an RDF document in Turtle syntax:
<rdf:RDF
Chapter: 2 (Tutorial)
14
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<owl:Class rdf:about="Parent">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty rdf:resource="hasChild"/>
<owl:someValuesFrom rdf:resource="Person"/>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>
</rdf:RDF>
Notation 3:
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
<Parent> a owl:Class;
owl:equivalentClass _:bnode1.
_:bnode1 rdf:type owl:Restriction;
owl:onProperty <hasChild>;
owl:someValuesFrom <Person>.
Triples:
<Parent> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>.
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction>.
_:bnode1 <http://www.w3.org/2002/07/owl#onProperty> <hasChild>.
_:bnode1 <http://www.w3.org/2002/07/owl#someValuesFrom> <Person>.
<Parent> <http://www.w3.org/2002/07/owl#equivalentClass> _:bnode1.
Exercise 1.5:
Write the following Turtle triples in RDF/XML syntax: ([] can be used in Turtle for a blank node.)
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
[] rdf:type owl:NegativePropertyAssertion;
owl:sourceIndividual :Bill;
owl:assertionProperty :hasDaughter;
owl:targetIndividual :Susan.
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-
ns#">
Chapter: 2 (Tutorial)
15
<owl:NegativePropertyAssertion>
<owl:sourceIndividual rdf:resource="#Bill" />
<owl:assertionProperty rdf:resource="#hasDaughter" />
<owl:targetIndividual rdf:resource="#Susan" />
</owl:NegativePropertyAssertion>
</rdf:RDF>
Triples:
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/2002/07/owl#NegativePropertyAssertion>.
_:bnode1 <http://www.w3.org/2002/07/owl#sourceIndividual> <#Bill>.
_:bnode1 <http://www.w3.org/2002/07/owl#assertionProperty> <#hasDaughter>.
_:bnode1 <http://www.w3.org/2002/07/owl#targetIndividual> <#Susan>.
Exercise 1.4 Write the following Turtle triple in RDF/XML syntax:
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix ex: <http://example.org/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
ex:Person rdfs:comment "Represents the set of all people."^^xsd:string .
RDF/XML:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:ex="http://example.org/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://example.org/Person">
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
Represents the set of all people.
</rdfs:comment>
</rdf:Description>
</rdf:RDF>
Chapter: 2 (Tutorial)
16
Triples:
<http://example.org/Person> <http://www.w3.org/2000/01/rdf-schema#comment> "Represents the set of all
people."^^<http://www.w3.org/2001/XMLSchema#string>.

Contenu connexe

Tendances

Praneet’s Pre On ChatGpt edited.pptx
Praneet’s Pre On ChatGpt edited.pptxPraneet’s Pre On ChatGpt edited.pptx
Praneet’s Pre On ChatGpt edited.pptxSalunke2
 
Introduction to Data Science.pptx
Introduction to Data Science.pptxIntroduction to Data Science.pptx
Introduction to Data Science.pptxVrishit Saraswat
 
LLMOps for Your Data: Best Practices to Ensure Safety, Quality, and Cost
LLMOps for Your Data: Best Practices to Ensure Safety, Quality, and CostLLMOps for Your Data: Best Practices to Ensure Safety, Quality, and Cost
LLMOps for Your Data: Best Practices to Ensure Safety, Quality, and CostAggregage
 
Introduction to LLMs
Introduction to LLMsIntroduction to LLMs
Introduction to LLMsLoic Merckel
 
Evaluating LLM Models for Production Systems Methods and Practices -
Evaluating LLM Models for Production Systems Methods and Practices -Evaluating LLM Models for Production Systems Methods and Practices -
Evaluating LLM Models for Production Systems Methods and Practices -alopatenko
 
Generative Models and ChatGPT
Generative Models and ChatGPTGenerative Models and ChatGPT
Generative Models and ChatGPTLoic Merckel
 
Azure Digital Twins.pdf
Azure Digital Twins.pdfAzure Digital Twins.pdf
Azure Digital Twins.pdfTomasz Kopacz
 
intro chatGPT workshop.pdf
intro chatGPT workshop.pdfintro chatGPT workshop.pdf
intro chatGPT workshop.pdfpeterpur
 
TiDB as an HTAP Database
TiDB as an HTAP DatabaseTiDB as an HTAP Database
TiDB as an HTAP DatabasePingCAP
 
Automate your Job and Business with ChatGPT #3 - Fundamentals of LLM/GPT
Automate your Job and Business with ChatGPT #3 - Fundamentals of LLM/GPTAutomate your Job and Business with ChatGPT #3 - Fundamentals of LLM/GPT
Automate your Job and Business with ChatGPT #3 - Fundamentals of LLM/GPTAnant Corporation
 
ChatGPT_Prompts.pptx
ChatGPT_Prompts.pptxChatGPT_Prompts.pptx
ChatGPT_Prompts.pptxChakrit Phain
 
Scientific data curation and processing with Apache Tika
Scientific data curation and processing with Apache TikaScientific data curation and processing with Apache Tika
Scientific data curation and processing with Apache TikaChris Mattmann
 
[225]yarn 기반의 deep learning application cluster 구축 김제민
[225]yarn 기반의 deep learning application cluster 구축 김제민[225]yarn 기반의 deep learning application cluster 구축 김제민
[225]yarn 기반의 deep learning application cluster 구축 김제민NAVER D2
 
اجابات البرولوج
اجابات البرولوجاجابات البرولوج
اجابات البرولوجAmmar Khalid
 
Data science and Artificial Intelligence
Data science and Artificial IntelligenceData science and Artificial Intelligence
Data science and Artificial IntelligenceSuman Srinivasan
 

Tendances (20)

Praneet’s Pre On ChatGpt edited.pptx
Praneet’s Pre On ChatGpt edited.pptxPraneet’s Pre On ChatGpt edited.pptx
Praneet’s Pre On ChatGpt edited.pptx
 
Introduction to Data Science.pptx
Introduction to Data Science.pptxIntroduction to Data Science.pptx
Introduction to Data Science.pptx
 
LLMOps for Your Data: Best Practices to Ensure Safety, Quality, and Cost
LLMOps for Your Data: Best Practices to Ensure Safety, Quality, and CostLLMOps for Your Data: Best Practices to Ensure Safety, Quality, and Cost
LLMOps for Your Data: Best Practices to Ensure Safety, Quality, and Cost
 
Introduction to LLMs
Introduction to LLMsIntroduction to LLMs
Introduction to LLMs
 
Evaluating LLM Models for Production Systems Methods and Practices -
Evaluating LLM Models for Production Systems Methods and Practices -Evaluating LLM Models for Production Systems Methods and Practices -
Evaluating LLM Models for Production Systems Methods and Practices -
 
DynamodbDB Deep Dive
DynamodbDB Deep DiveDynamodbDB Deep Dive
DynamodbDB Deep Dive
 
Generative Models and ChatGPT
Generative Models and ChatGPTGenerative Models and ChatGPT
Generative Models and ChatGPT
 
Azure Digital Twins.pdf
Azure Digital Twins.pdfAzure Digital Twins.pdf
Azure Digital Twins.pdf
 
ChatGPT_ppf.pdf
ChatGPT_ppf.pdfChatGPT_ppf.pdf
ChatGPT_ppf.pdf
 
intro chatGPT workshop.pdf
intro chatGPT workshop.pdfintro chatGPT workshop.pdf
intro chatGPT workshop.pdf
 
TiDB as an HTAP Database
TiDB as an HTAP DatabaseTiDB as an HTAP Database
TiDB as an HTAP Database
 
ChatGPT ChatBot
ChatGPT ChatBotChatGPT ChatBot
ChatGPT ChatBot
 
AzureOpenAI.pptx
AzureOpenAI.pptxAzureOpenAI.pptx
AzureOpenAI.pptx
 
Automate your Job and Business with ChatGPT #3 - Fundamentals of LLM/GPT
Automate your Job and Business with ChatGPT #3 - Fundamentals of LLM/GPTAutomate your Job and Business with ChatGPT #3 - Fundamentals of LLM/GPT
Automate your Job and Business with ChatGPT #3 - Fundamentals of LLM/GPT
 
Behind the Scenes of ChatGPT.pptx
Behind the Scenes of ChatGPT.pptxBehind the Scenes of ChatGPT.pptx
Behind the Scenes of ChatGPT.pptx
 
ChatGPT_Prompts.pptx
ChatGPT_Prompts.pptxChatGPT_Prompts.pptx
ChatGPT_Prompts.pptx
 
Scientific data curation and processing with Apache Tika
Scientific data curation and processing with Apache TikaScientific data curation and processing with Apache Tika
Scientific data curation and processing with Apache Tika
 
[225]yarn 기반의 deep learning application cluster 구축 김제민
[225]yarn 기반의 deep learning application cluster 구축 김제민[225]yarn 기반의 deep learning application cluster 구축 김제민
[225]yarn 기반의 deep learning application cluster 구축 김제민
 
اجابات البرولوج
اجابات البرولوجاجابات البرولوج
اجابات البرولوج
 
Data science and Artificial Intelligence
Data science and Artificial IntelligenceData science and Artificial Intelligence
Data science and Artificial Intelligence
 

En vedette

FRBR και Linked Data - Σεμινάριο Αθήνας
FRBR και Linked Data -  Σεμινάριο ΑθήναςFRBR και Linked Data -  Σεμινάριο Αθήνας
FRBR και Linked Data - Σεμινάριο ΑθήναςGiannis Tsakonas
 
RDF: what and why plus a SPARQL tutorial
RDF: what and why plus a SPARQL tutorialRDF: what and why plus a SPARQL tutorial
RDF: what and why plus a SPARQL tutorialJerven Bolleman
 
Semantic framework for web scraping.
Semantic framework for web scraping.Semantic framework for web scraping.
Semantic framework for web scraping.Shyjal Raazi
 
RDF4U: RDF Graph Visualization by Interpreting Linked Data as Knowledge
RDF4U: RDF Graph Visualization by Interpreting Linked Data as KnowledgeRDF4U: RDF Graph Visualization by Interpreting Linked Data as Knowledge
RDF4U: RDF Graph Visualization by Interpreting Linked Data as KnowledgeNational Institute of Informatics
 
RDFS In A Nutshell V1
RDFS In A Nutshell V1RDFS In A Nutshell V1
RDFS In A Nutshell V1Fabien Gandon
 
Semantic Web Technologies - SS 2010 - 03 - RDF
Semantic Web Technologies - SS 2010 - 03 - RDFSemantic Web Technologies - SS 2010 - 03 - RDF
Semantic Web Technologies - SS 2010 - 03 - RDFSteffen Schloenvoigt
 
Νικολακοπούλου Μαρία - final
Νικολακοπούλου Μαρία - finalΝικολακοπούλου Μαρία - final
Νικολακοπούλου Μαρία - finalMaria Nikolakopoulou
 
Saveface - Save your Facebook content as RDF data
Saveface - Save your Facebook content as RDF dataSaveface - Save your Facebook content as RDF data
Saveface - Save your Facebook content as RDF dataFuming Shih
 
Fosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and MonoFosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and MonoAchim Friedland
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphsandyseaborne
 
RDF2Vec: RDF Graph Embeddings for Data Mining
RDF2Vec: RDF Graph Embeddings for Data MiningRDF2Vec: RDF Graph Embeddings for Data Mining
RDF2Vec: RDF Graph Embeddings for Data MiningPetar Ristoski
 
SPARQL and RDF query optimization
SPARQL and RDF query optimizationSPARQL and RDF query optimization
SPARQL and RDF query optimizationKisung Kim
 
RDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesRDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesMarin Dimitrov
 

En vedette (19)

Rdf
RdfRdf
Rdf
 
FRBR και Linked Data - Σεμινάριο Αθήνας
FRBR και Linked Data -  Σεμινάριο ΑθήναςFRBR και Linked Data -  Σεμινάριο Αθήνας
FRBR και Linked Data - Σεμινάριο Αθήνας
 
RDF: what and why plus a SPARQL tutorial
RDF: what and why plus a SPARQL tutorialRDF: what and why plus a SPARQL tutorial
RDF: what and why plus a SPARQL tutorial
 
Access Control for RDF graphs using Abstract Models
Access Control for RDF graphs using Abstract ModelsAccess Control for RDF graphs using Abstract Models
Access Control for RDF graphs using Abstract Models
 
Semantic framework for web scraping.
Semantic framework for web scraping.Semantic framework for web scraping.
Semantic framework for web scraping.
 
RDF4U: RDF Graph Visualization by Interpreting Linked Data as Knowledge
RDF4U: RDF Graph Visualization by Interpreting Linked Data as KnowledgeRDF4U: RDF Graph Visualization by Interpreting Linked Data as Knowledge
RDF4U: RDF Graph Visualization by Interpreting Linked Data as Knowledge
 
RDFS In A Nutshell V1
RDFS In A Nutshell V1RDFS In A Nutshell V1
RDFS In A Nutshell V1
 
Semantic Web Technologies - SS 2010 - 03 - RDF
Semantic Web Technologies - SS 2010 - 03 - RDFSemantic Web Technologies - SS 2010 - 03 - RDF
Semantic Web Technologies - SS 2010 - 03 - RDF
 
Νικολακοπούλου Μαρία - final
Νικολακοπούλου Μαρία - finalΝικολακοπούλου Μαρία - final
Νικολακοπούλου Μαρία - final
 
Saveface - Save your Facebook content as RDF data
Saveface - Save your Facebook content as RDF dataSaveface - Save your Facebook content as RDF data
Saveface - Save your Facebook content as RDF data
 
Fosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and MonoFosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
 
Graph-based Relational Data Visualization
Graph-based RelationalData VisualizationGraph-based RelationalData Visualization
Graph-based Relational Data Visualization
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphs
 
RDF2Vec: RDF Graph Embeddings for Data Mining
RDF2Vec: RDF Graph Embeddings for Data MiningRDF2Vec: RDF Graph Embeddings for Data Mining
RDF2Vec: RDF Graph Embeddings for Data Mining
 
SPARQL and RDF query optimization
SPARQL and RDF query optimizationSPARQL and RDF query optimization
SPARQL and RDF query optimization
 
RDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesRDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic Repositories
 
Protege tutorial
Protege tutorialProtege tutorial
Protege tutorial
 
SPARQL Cheat Sheet
SPARQL Cheat SheetSPARQL Cheat Sheet
SPARQL Cheat Sheet
 
RDF and OWL
RDF and OWLRDF and OWL
RDF and OWL
 

Similaire à Tutorial for RDF Graphs

Chapter 3 semantic web
Chapter 3 semantic webChapter 3 semantic web
Chapter 3 semantic webR A Akerkar
 
The Semantic Web #5 - RDF (2)
The Semantic Web #5 - RDF (2)The Semantic Web #5 - RDF (2)
The Semantic Web #5 - RDF (2)Myungjin Lee
 
Bib Data Experiment -- The GW Journey
Bib Data Experiment -- The GW JourneyBib Data Experiment -- The GW Journey
Bib Data Experiment -- The GW JourneyJ Shieh
 
Linked data: spreading data over the web
Linked data: spreading data over the webLinked data: spreading data over the web
Linked data: spreading data over the webshellac
 
RDFa: an introduction
RDFa: an introductionRDFa: an introduction
RDFa: an introductionKai Li
 
06 gioca-ontologies
06 gioca-ontologies06 gioca-ontologies
06 gioca-ontologiesnidzokus
 
Library Linked Data Progress
Library Linked Data ProgressLibrary Linked Data Progress
Library Linked Data ProgressRichard Wallis
 
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIsJosef Petrák
 
RDFa in ostala spletna semantika
RDFa in ostala spletna semantikaRDFa in ostala spletna semantika
RDFa in ostala spletna semantikaJure Cuhalev
 
Rdf Overview Presentation
Rdf Overview PresentationRdf Overview Presentation
Rdf Overview PresentationKen Varnum
 
A Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic WebA Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic WebShamod Lacoul
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataFabien Gandon
 
An Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of DataAn Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of DataOlaf Hartig
 
Trying SPARQL Anything with MEI
Trying SPARQL Anything with MEITrying SPARQL Anything with MEI
Trying SPARQL Anything with MEIEnrico Daga
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataGabriela Agustini
 
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013Fabien Gandon
 

Similaire à Tutorial for RDF Graphs (20)

Chapter 3 semantic web
Chapter 3 semantic webChapter 3 semantic web
Chapter 3 semantic web
 
RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
 
The Semantic Web #5 - RDF (2)
The Semantic Web #5 - RDF (2)The Semantic Web #5 - RDF (2)
The Semantic Web #5 - RDF (2)
 
Bib Data Experiment -- The GW Journey
Bib Data Experiment -- The GW JourneyBib Data Experiment -- The GW Journey
Bib Data Experiment -- The GW Journey
 
Semantic Web - RDF
Semantic Web - RDFSemantic Web - RDF
Semantic Web - RDF
 
Linked data: spreading data over the web
Linked data: spreading data over the webLinked data: spreading data over the web
Linked data: spreading data over the web
 
Data in RDF
Data in RDFData in RDF
Data in RDF
 
RDFa Tutorial
RDFa TutorialRDFa Tutorial
RDFa Tutorial
 
RDFa: an introduction
RDFa: an introductionRDFa: an introduction
RDFa: an introduction
 
06 gioca-ontologies
06 gioca-ontologies06 gioca-ontologies
06 gioca-ontologies
 
Library Linked Data Progress
Library Linked Data ProgressLibrary Linked Data Progress
Library Linked Data Progress
 
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
 
RDFa in ostala spletna semantika
RDFa in ostala spletna semantikaRDFa in ostala spletna semantika
RDFa in ostala spletna semantika
 
Rdf Overview Presentation
Rdf Overview PresentationRdf Overview Presentation
Rdf Overview Presentation
 
A Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic WebA Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic Web
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked Data
 
An Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of DataAn Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of Data
 
Trying SPARQL Anything with MEI
Trying SPARQL Anything with MEITrying SPARQL Anything with MEI
Trying SPARQL Anything with MEI
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked Data
 
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
 

Plus de Kishoj Bajracharya (8)

Comparison of Agent-based platforms
Comparison of Agent-based platformsComparison of Agent-based platforms
Comparison of Agent-based platforms
 
IPv6 examples
IPv6 examplesIPv6 examples
IPv6 examples
 
Network Coding
Network CodingNetwork Coding
Network Coding
 
Galios: Python Programming
Galios: Python Programming Galios: Python Programming
Galios: Python Programming
 
OLSR setup
OLSR setup OLSR setup
OLSR setup
 
DBpedia mobile
DBpedia mobileDBpedia mobile
DBpedia mobile
 
Manual orange
Manual orangeManual orange
Manual orange
 
Random Number Generation
Random Number GenerationRandom Number Generation
Random Number Generation
 

Dernier

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 

Dernier (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 

Tutorial for RDF Graphs

  • 1. Chapter: 2 (Tutorial) 1 RDF Graphs: Give the RDF/XML, Notation 3, triples for the following sentences and also draw the RDF graph. 1. The lecture is attended by Kishoj, Pradeep, Mohan and Dipendra. RDF/XML: <rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex = "http://example.org/" > <rdf:Description rdf:about="http://example.org/lecture"> <ex:isAttendedBy> <rdf:Bag> <rdf:li rdf:resource = "http://example.org/Kishoj"/> <rdf:li rdf:resource = "http://example.org/Pradeep"/> <rdf:li rdf:resource = "http://example.org/Mohan"/> <rdf:li rdf:resource = "http://example.org/Dipendra"/> </rdf:Bag> </ex:isAttendedBy> </rdf:Description> </rdf:RDF> Notation 3: @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix ex: <http://example.org/>. ex:lecture ex:isAttendedBy _:bnode1. _:bnode1 rdf:type rdf:Bag; rdf:_1 ex:Kishoj; rdf:_2 ex:Pradeep; rdf:_3 ex:Mohan; rdf:_4 ex:Dipendra. Triples: _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf- syntax-ns#Bag>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> <http://example.org/Kishoj>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> <http://example.org/Pradeep>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> <http://example.org/Mohan>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> <http://example.org/Dipendra>. <http://example.org/lecture> <http://example.org/isAttendedBy> _:bnode1.
  • 2. Chapter: 2 (Tutorial) 2 2. [RDF-Concept] is studied by Kishoj and Pradeep in order. RDF/XML: <rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex = "http://example.org/" > <rdf:Description rdf:about="http://www.w3.org/TR/rdf-concepts/"> <ex:studiedBy> <rdf:Seq> <rdf:li rdf:resource = "http://example.org/Kishoj"/> <rdf:li rdf:resource = "http://example.org/Pradeep"/> </rdf:Seq> </ex:studiedBy> </rdf:Description> </rdf:RDF> Notation 3: @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix ex: <http://example.org/>. <http://www.w3.org/TR/rdf-concepts/> ex:studiedBy _:bnode1. _:bnode1 rdf:type rdf:Seq; rdf:_1 ex:Kishoj; rdf:_2 ex:Pradeep. Triples: _:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf- syntax-ns#Seq>. _:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> <http://example.org/Kishoj>. _:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> <http://example.org/Pradeep>. <http://www.w3.org/TR/rdf-concepts/> <http://example.org/studiedBy> _:b1.
  • 3. Chapter: 2 (Tutorial) 3 3. The software Mobile Tracker can be downloaded from three links link1or link2 or link3. RDF/XML: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex = "http://example.org/" > <rdf:Description rdf:about="http://example.org/MobileTraker"> <ex:sourceLocation> <rdf:Alt> <rdf:li rdf:resource = "http://example.org/Link1"/> <rdf:li rdf:resource = "http://example.org/Link2"/> <rdf:li rdf:resource = "http://example.org/Link3"/> </rdf:Alt> </ex:sourceLocation> </rdf:Description> </rdf:RDF> Notation 3: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix ex: <http://example.org/>. ex:MobileTraker ex:sourceLocation _:bnode1. _:bnode1 rdf:type rdf:Alt; rdf:_1 ex:Link1; rdf:_2 ex:Link2; rdf:_3 ex:Link3. Triples: _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf- syntax-ns#Alt>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> <http://example.org/Link1>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> <http://example.org/Link2>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> <http://example.org/Link3>. <http://example.org/MobileTraker> <http://example.org/sourceLocation> _:bnode1.
  • 4. Chapter: 2 (Tutorial) 4 Convert the given graph to RDF/XML, Notation 3, turtle, triples and JSON. RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ex="http://example.org/stuff/1.0/"> <rdf:Description rdf:about="http://www.w3.org/TR/rdf-syntax-grammar" dc:title="RDF/XML Syntax Specification (Revised)"> <ex:editor> <rdf:Description ex:fullName="Dave Beckett"> <ex:homePage rdf:resource="http://purl.org/net/dajobe/" /> </rdf:Description> </ex:editor> </rdf:Description> </rdf:RDF> Notation 3: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix dc: <http://purl.org/dc/elements/1.1/>. @prefix ex: <http://example.org/stuff/1.0/>. <http://www.w3.org/TR/rdf-syntax-grammar> ex:editor [ ex:fullName "Dave Beckett"; ex:homePage <http://purl.org/net/dajobe/> ]; dc:title "RDF/XML Syntax Specification (Revised)". Turtle: .ttl extension: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix dc: <http://purl.org/dc/elements/1.1/>.
  • 5. Chapter: 2 (Tutorial) 5 @prefix ex: <http://example.org/stuff/1.0/>. <http://www.w3.org/TR/rdf-syntax-grammar> dc:title "RDF/XML Syntax Specification (Revised)"; ex:editor [ ex:fullname "Dave Beckett"; ex:homePage <http://purl.org/net/dajobe/>]. Triples: <http://www.w3.org/TR/rdf-syntax-grammar> <http://purl.org/dc/elements/1.1/title> "RDF/XML Syntax Specification (Revised)". _:bnode1 <http://example.org/stuff/1.0/fullName> "Dave Beckett". _:bnode1 <http://example.org/stuff/1.0/homePage> <http://purl.org/net/dajobe/>. <http://www.w3.org/TR/rdf-syntax-grammar> <http://example.org/stuff/1.0/editor> _:bnode1. RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Seq rdf:about="http://example.org/favourite-fruit"> <rdf:li rdf:resource="http://example.org/banana"/> <rdf:li rdf:resource="http://example.org/apple"/> <rdf:li rdf:resource="http://example.org/pear"/> </rdf:Seq> </rdf:RDF> Tripes: .nt extension <http://example.org/favourite-fruit> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq>. <http://example.org/favourite-fruit> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> <http://example.org/banana>. <http://example.org/favourite-fruit> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> <http://example.org/apple>. <http://example.org/favourite-fruit> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> <http://example.org/pear>. Turtle to graph: @prefix : <http://example.org/stuff/1.0/>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. :a :b [ rdf:first "apple"; rdf:rest [ rdf:first "banana"; rdf:rest rdf:nil ] ] .
  • 6. Chapter: 2 (Tutorial) 6 RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns="http://example.org/stuff/1.0/"> <rdf:Description rdf:about="http://example.org/stuff/1.0/a"> <ns:b> <rdf:Description> <rdf:first>apple</rdf:first> <rdf:rest> <rdf:Description> <rdf:first>banana</rdf:first> <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" /> </rdf:Description> </rdf:rest> </rdf:Description> </ns:b> </rdf:Description> </rdf:RDF> Triples: <http://example.org/stuff/1.0/a> <http://example.org/stuff/1.0/b> _:bnode1. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple". _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:bnode2. _:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana". _:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax- ns#nil>.
  • 7. Chapter: 2 (Tutorial) 7 RDF collection of nodes using rdf:parseType="Collection" RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.org/stuff/1.0/"> <rdf:Description rdf:about="http://example.org/basket"> <ex:hasFruit rdf:parseType="Collection"> <rdf:Description rdf:about="http://example.org/banana"/> <rdf:Description rdf:about="http://example.org/apple"/> <rdf:Description rdf:about="http://example.org/pear"/> </ex:hasFruit> </rdf:Description> </rdf:RDF> Notation 3: @prefix ex: <http://example.org/stuff/1.0/>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. <http://example.org/basket> ex:hasFruit (<http://example.org/banana> <http://example.org/apple> <http://example.org/pear>). Triple: <http://example.org/basket> <http://example.org/stuff/1.0/hasFruit> _:bnode1. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/banana>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/apple>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:bnode2. _:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/pear>. _:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:bnode3. _:bnode3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax- ns#nil>. Differentiate between two RDF/XML statement. 1. <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Seq rdf:about="http://example.org/favourite-fruit"> <rdf:_1 rdf:resource="http://example.org/banana"/> <rdf:_2 rdf:resource="http://example.org/apple"/> <rdf:_3 rdf:resource="http://example.org/pear"/> </rdf:Seq>
  • 8. Chapter: 2 (Tutorial) 8 </rdf:RDF> 2. <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Seq rdf:about="http://example.org/favourite-fruit"> <rdf:li rdf:resource="http://example.org/banana"/> <rdf:li rdf:resource="http://example.org/apple"/> <rdf:li rdf:resource="http://example.org/pear"/> </rdf:Seq> </rdf:RDF> Both are equivalent and produces same RDF graph as shown below in figure because rdf:li, special property element, is equivalent to rdf:_1, rdf:_2 in order. Complete example of rdf:datatype: RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.org/stuff/1.0/"> <rdf:Description rdf:about="http://example.org/item01"> <ex:size rdf:datatype="http://www.w3.org/2001/XMLSchema#int">123</ex:size> </rdf:Description> </rdf:RDF> Triples: <http://example.org/item01> <http://example.org/stuff/1.0/size> "123"^^<http://www.w3.org/2001/XMLSchema#int>. Notation 3: @prefix eg: <http://example.org/>. @prefix ex: <http://example.org/stuff/1.0/>. eg:item01 ex:size "123". Reification: statements about statements. 1. {:John :Loves :Mary} :accordingTo :Bill. 2. Mary claims that John’s name is “John Smith”. 3. Romeo thought that {Juliet was dead}. Romeo thought that Juliet was dead.
  • 9. Chapter: 2 (Tutorial) 9 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.org/#"> <rdf:Description rdf:about="http://example.org/#romeo"> <ex:thought> <rdf:Description> <rdf:subject> <rdf:Description rdf:about="http://example.org/#juliet"/> </rdf:subject> <rdf:predicate> <rdf:Description rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/> </rdf:predicate> <rdf:object> <rdf:Description rdf:about="http://example.org/#dead"/> </rdf:object> </rdf:Description> </ex:thought> </rdf:Description> </rdf:RDF> <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.org/#"> <rdf:Description rdf:about="http://example.org/romeo"> <ex:thought> <rdf:Description> <rdf:subject> <rdf:Description rdf:about="http://example.org/juliet"/> </rdf:subject> <rdf:predicate> <rdf:Description rdf:about="http://example.org/was"/> </rdf:predicate> <rdf:object> <rdf:Description rdf:about="http://example.org/dead"/> </rdf:object> </rdf:Description> </ex:thought> </rdf:Description> </rdf:RDF> Notation 3:
  • 10. Chapter: 2 (Tutorial) 10 @prefix ex: <http://example.org/#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. ex:romeo ex:thought _:bnode1. _:bnode1 rdf:subject ex:Juliet; rdf:object ex:dead; rdf:predicate rdf:type. Triples: <http://example.org/#romeo> <http://example.org/#thought> _:bnode1. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://example.org/#Juliet>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.w3.org/1999/02/22-rdf- syntax-ns#type>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://example.org/#dead>. John loves Mary, according to Bill. RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.org/"> <rdf:Description rdf:about="http://example.org/bill"> <ex:thought> <rdf:Description> <rdf:subject> <rdf:Description rdf:about="http://example.org/john"/> </rdf:subject> <rdf:predicate> <rdf:Description rdf:about="http://example.org/love"/> </rdf:predicate> <rdf:object> <rdf:Description rdf:about="http://example.org/mary"/> </rdf:object> </rdf:Description> </ex:thought> </rdf:Description> </rdf:RDF> Notation 3: @prefix ex: <http://example.org/>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. ex:bill ex:thought _:bnode1. _:bnode1 rdf:subject ex:john;
  • 11. Chapter: 2 (Tutorial) 11 rdf:predicate ex:love; rdf:object ex:mary. Triples: _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://example.org/john>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://example.org/love>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://example.org/mary>. <http://example.org/bill> <http://example.org/thought> _:bnode1. Mary claims that John’s name is “John Smith”. 〈<#myStatement>, rdf:type, rdf:Statement〉 〈<#myStatement>, rdf:subject, <#john>〉 〈<#myStatement>, rdf:predicate, <#hasName>〉 〈<#myStatement>, rdf:object, ”John Smith”〉 〈<#mary>, <#claims>, <#myStatement>〉 RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.org/"> <rdf:Description rdf:about="http://example.org/mary"> <ex:claim> <rdf:Description> <rdf:subject> <rdf:Description rdf:about="http://example.org/john"/> </rdf:subject> <rdf:predicate> <rdf:Description rdf:about="http://example.org/hasName"/> </rdf:predicate> <rdf:object> John Smith </rdf:object> </rdf:Description> </ex:claim> </rdf:Description> </rdf:RDF> Notation 3: @prefix ex: <http://example.org/>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. ex:mary ex:claim _:bnode1. _:bnode1 rdf:subject ex:john; rdf:predicate ex:hasName; rdf:object “John Smith”. Triples: _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://example.org/john>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://example.org/hasName>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> “John Smith”. <http://example.org/mary> <http://example.org/claim> _:bnode1.
  • 12. Chapter: 2 (Tutorial) 12 RDF Entailment: <http://example.org/#john> rdf:type <http://example.org/#Student> <http://example.org/#> rdfs:subClassOf <http://example.org/#Person> Entails: <http://example.org/#john> rdf:type <http://example.org/#Person> Triples: <http://example.org/#john> <http://example.org/#hasName> "John". <http://example.org/#john> <http://example.org/#marriedTo> <http://example.org/#mary>. RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.org/#"> <rdf:Description rdf:about="http://example.org/#john"> <ex:hasName>John</ex:hasName> <ex:marriedTo rdf:resource = "http://example.org/#mary"/> </rdf:Description> </rdf:RDF> Notation 3: @prefix ex: <http://example.org/#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. ex:john ex:hasName "John"; ex:marriedTo ex:mary. Exercise 1.2: Write the following part of an RDF document in Turtle syntax: <?xml version="1.0"?>
  • 13. Chapter: 2 (Tutorial) 13 <rdf:RDF xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="Jack"> <rdf:type> <owl:Class> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="Person"/> <owl:Class> <owl:complementOf rdf:resource="Parent"/> </owl:Class> </owl:intersectionOf> </owl:Class> </rdf:type> </rdf:Description> </rdf:RDF> Turtle syntax: @prefix owl: <http://www.w3.org/2002/07/owl#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. <Jack> a _:bnode1. <Person> a owl:Class. _:bnode2 a owl:Class; owl:complementOf <Parent>. _:bnode1 a owl:Class; owl:intersectionOf (<Person> _:bnode2). Triples: _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>. <Person> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>. _:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <Person>. _:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:bnode3. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>. _:bnode4 <http://www.w3.org/2002/07/owl#complementOf> <Parent>. _:bnode3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:bnode4. _:bnode3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax- ns#nil>. _:bnode1 <http://www.w3.org/2002/07/owl#intersectionOf> _:bnode2. <Jack> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> _:bnode1. Exercise 1.1 Write the following part of an RDF document in Turtle syntax: <rdf:RDF
  • 14. Chapter: 2 (Tutorial) 14 xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > <owl:Class rdf:about="Parent"> <owl:equivalentClass> <owl:Restriction> <owl:onProperty rdf:resource="hasChild"/> <owl:someValuesFrom rdf:resource="Person"/> </owl:Restriction> </owl:equivalentClass> </owl:Class> </rdf:RDF> Notation 3: @prefix owl: <http://www.w3.org/2002/07/owl#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. <Parent> a owl:Class; owl:equivalentClass _:bnode1. _:bnode1 rdf:type owl:Restriction; owl:onProperty <hasChild>; owl:someValuesFrom <Person>. Triples: <Parent> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>. _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction>. _:bnode1 <http://www.w3.org/2002/07/owl#onProperty> <hasChild>. _:bnode1 <http://www.w3.org/2002/07/owl#someValuesFrom> <Person>. <Parent> <http://www.w3.org/2002/07/owl#equivalentClass> _:bnode1. Exercise 1.5: Write the following Turtle triples in RDF/XML syntax: ([] can be used in Turtle for a blank node.) @prefix owl: <http://www.w3.org/2002/07/owl#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. [] rdf:type owl:NegativePropertyAssertion; owl:sourceIndividual :Bill; owl:assertionProperty :hasDaughter; owl:targetIndividual :Susan. RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax- ns#">
  • 15. Chapter: 2 (Tutorial) 15 <owl:NegativePropertyAssertion> <owl:sourceIndividual rdf:resource="#Bill" /> <owl:assertionProperty rdf:resource="#hasDaughter" /> <owl:targetIndividual rdf:resource="#Susan" /> </owl:NegativePropertyAssertion> </rdf:RDF> Triples: _:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#NegativePropertyAssertion>. _:bnode1 <http://www.w3.org/2002/07/owl#sourceIndividual> <#Bill>. _:bnode1 <http://www.w3.org/2002/07/owl#assertionProperty> <#hasDaughter>. _:bnode1 <http://www.w3.org/2002/07/owl#targetIndividual> <#Susan>. Exercise 1.4 Write the following Turtle triple in RDF/XML syntax: @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix ex: <http://example.org/>. @prefix xsd: <http://www.w3.org/2001/XMLSchema#>. ex:Person rdfs:comment "Represents the set of all people."^^xsd:string . RDF/XML: <?xml version="1.0"?> <rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:ex="http://example.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="http://example.org/Person"> <rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string"> Represents the set of all people. </rdfs:comment> </rdf:Description> </rdf:RDF>
  • 16. Chapter: 2 (Tutorial) 16 Triples: <http://example.org/Person> <http://www.w3.org/2000/01/rdf-schema#comment> "Represents the set of all people."^^<http://www.w3.org/2001/XMLSchema#string>.