RDF Syntax and examples ดร. มารุต บูรณรัช [email protected]...

43
RDF Syntax and examples ดด.ดดดดด ดดดดดดด [email protected] 269618: ดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดด ดดดดดดด - ดดดดดดดดดดดดดดดดดดดดดดดดด (Special Topics in Advanced Information Technology – Semantic Web Technology) ดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดดด ดดดดดดดด ดดดดดดดดดดดดดด ดดดดดดดดดดดดดดดดด ดดดดดดดดดดดดดด 2 ดดดดดดดดดด 2557

Transcript of RDF Syntax and examples ดร. มารุต บูรณรัช [email protected]...

Page 1: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF Syntax and examples

ดร.มาร�ต บูรณร�ช [email protected]

269618: หั�วข้�อพิ�เศษด�านเทคโนโลยี�สารสนเทศข้��นสง - เทคโนโลยี�เว!บูเช�งความหัมายี (Special Topics in Advanced Information Technology – Semantic Web Technology)

ภาคว�ชาว�ทยีาการคอมพิ�วเตอร$และเทคโนโลยี�สารสนเทศคณะว�ทยีาศาสตร$ มหัาว�ทยีาล�ยีนเรศวรภาคการศ'กษาท�( 2 ปี*การศ'กษา 2557

Page 2: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF Syntax

RDF Graph RDF/XML N-Triples Turtle (Terse RDF Triple Language)

2

Page 3: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Examples Adding triple with object as a resource Adding triple with object as literal (string) Adding triple with object as literal (integer) Adding triple with “rdf:type” property Adding triple for the same property with

different values Different syntaxes for “rdf:about”, “rdf:ID”,

“rdf:type”3

Page 4: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Adding triple withobject as a resource

Page 5: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Example RDF Triple

“John Doe is a father of Jack Doe”

Subject http://www.mydomain.com/person#john_doe

Predicate http://www.mydomain.com/vocab#father-of

Object http://www.mydomain.com/person#jack_doe

5

Page 6: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF Graph

http://www.mydomain.com/person#john_doe

http://www.mydomain.com/person#jack_doe

http://www.mydomain.com/vocab#father-of

6

Page 7: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF/XML<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:x="http://www.mydomain.com/vocab#"> <rdf:Description rdf:about="http://www.mydomain.com/person#john_doe"> <x:father-of rdf:resource="http://www.mydomain.com/person#jack_doe"/> </rdf:Description> </rdf:RDF>

7

Page 8: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

N-Triples

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#father-of> <http://www.mydomain.com/person#jack_doe> .

8

Page 9: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Turtle

@prefix x: <http://www.mydomain.com/vocab#>.

@prefix person: <http://www.mydomain.com/person#>.

person:john_doe x:father-of person:jack_doe.

9

Page 10: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Adding triple withobject as literal (string)

Page 11: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Adding new triple

Subject http://www.mydomain.com/person#john_doe

Predicate http://www.mydomain.com/vocab#has_name

Object “John Doe”@en

Note: “@” is optional for specifying language code of a string.

11

Page 12: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF Graph

http://www.mydomain.com/person#john_doe

http://www.mydomain.com/person#jack_doe

http://www.mydomain.com/vocab#father-of

“John Doe”@en

http://www.mydomain.com/vocab#has_name

12

Page 13: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF/XML

<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:x="http://www.mydomain.com/vocab#"> <rdf:Description rdf:about="http://www.mydomain.com/person#john_doe"> <x:father-of rdf:resource="http://www.mydomain.com/person#jack_doe"/> <x:has_name xml:lang=“en”>John Doe</x:has_name></rdf:Description> </rdf:RDF>

13

Page 14: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

N-Triples

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#father-of> <http://www.mydomain.com/person#jack_doe> .

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#has_name> "John Doe" @en .

14

Page 15: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Turtle

@prefix x: <http://www.mydomain.com/vocab#>.

@prefix person: <http://www.mydomain.com/person#>.

person:john_doe x:father-of person:jack_doe ; x:has_name "John Doe"@en .

15

Page 16: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Adding triple withobject as literal (integer)

Page 17: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Adding new triple

Subject http://www.mydomain.com/person#john_doe

Predicate http://www.mydomain.com/vocab#has_birthyear

Object “1970”^^http://www.w3.org/2001/XMLSchema#integer

Note: “^^” is optional for specifying data type of a literal. If not specified, the default data type is string.

17

Page 18: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF Graph

http://www.mydomain.com/person#john_doe

http://www.mydomain.com/person#jack_doe

http://www.mydomain.com/vocab#father-of

“John Doe”@en

“1970”^^http://www.w3.org/2001/XMLSchema#integer

http://www.mydomain.com/vocab#has_name

http://www.mydomain.com/vocab#has_birthyear

18

Page 19: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF/XML<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:x="http://www.mydomain.com/vocab#"> <rdf:Description rdf:about="http://www.mydomain.com/person#john_doe"> <x:father-of rdf:resource="http://www.mydomain.com/person#jack_doe"/> <x:has_name xml:lang=“en”>John Doe</my:has_name> <x:has_birthyear rdf:datatype=“http://www.w3.org/2001/XMLSchema#integer”>1970</x:has_birthyear></rdf:Description> </rdf:RDF>

19

Page 20: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

N-Triples

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#father-of> <http://www.mydomain.com/person#jack_doe> .

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#has_name> "John Doe" @en .

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#has_birthyear> "1970"^^http://www.w3.org/2001/XMLSchema#integer .

20

Page 21: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Turtle

@prefix x: <http://www.mydomain.com/vocab#>.

@prefix person: <http://www.mydomain.com/person#>.

@prefix xsd:<http://www.w3.org/2001/XMLSchema#>.

person:john_doe x:father-of person:jack_doe ; x:has_name "John Doe"@en ;

x:has_birthyear "1970"^^xsd:integer .

21

Page 22: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Adding triple with “rdf:type” property

Page 23: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Adding new triple

Subject http://www.mydomain.com/person#jack_doe

Predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type

Object http://www.mydomain.com/vocab#student

23

Page 24: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF Graph

http://www.mydomain.com/person#john_doe

http://www.mydomain.com/person#jack_doe

http://www.mydomain.com/vocab#father-of

“John Doe”@en

“1970”^^http://www.w3.org/2001/XMLSchema#integer

http://www.mydomain.com/vocab#has_name

http://www.mydomain.com/vocab#has_birthyear

http://www.mydomain.com/vocab#student

http://www.w3.org/1999/02/22-rdf-syntax-ns#type

24

Page 25: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF/XML<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:x="http://www.mydomain.com/vocab#">

<rdf:Description rdf:about="http://www.mydomain.com/person#john_doe">

<x:father-of rdf:resource="http://www.mydomain.com/person#jack_doe"/>

<x:has_name xml:lang=“en”>John Doe</x:has_name>

<x:has_birthyear rdf:datatype=“http://www.w3.org/2001/XMLSchema#integer”>1970</x:has_birthyear>

</rdf:Description>

<rdf:Description rdf:about="http://www.mydomain.com/person#jack_doe">

<rdf:type rdf:resource="http://www.mydomain.com/vocab#student"/>

</rdf:Description>

</rdf:RDF> 25

Page 26: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

N-Triples<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#father-of> <http://www.mydomain.com/person#jack_doe> .

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#has_name> "John Doe"@en.

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#has_birthyear> "1970"^^http://www.w3.org/2001/XMLSchema#integer.

<http://www.mydomain.com/person#jack_doe> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.mydomain.com/vocab#student> .

26

Page 27: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Turtle@prefix x: <http://www.mydomain.com/vocab#>.

@prefix person: <http://www.mydomain.com/person#>.

@prefix xsd:<http://www.w3.org/2001/XMLSchema#>.

person:john_doe x:father-of person:jack_doe ;x:has_name "John Doe"@en ;

x:has_birthyear "1970"^^xsd:integer .

person:jack_doe a x:student .

27

Page 28: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Adding triple for the same property with different values

Page 29: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Adding new triple

Subject http://www.mydomain.com/person#john_doe

Predicate http://www.mydomain.com/vocab#has_name

Object “จอหั$น โด”@th

Note: “@” is optional for specifying language code of a string.

29

Page 30: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF Graph

http://www.mydomain.com/person#john_doe

http://www.mydomain.com/person#jack_doe

http://www.mydomain.com/vocab#father-of

“John Doe”@en

“1970”^^http://www.w3.org/2001/XMLSchema#integer

http://www.mydomain.com/vocab#has_name

http://www.mydomain.com/vocab#has_birthyear

http://www.mydomain.com/vocab#student

http://www.w3.org/1999/02/22-rdf-syntax-ns#type

http://www.mydomain.com/vocab#has_name

“จอหั$น โด”@th

30

Page 31: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

RDF/XML<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:x="http://www.mydomain.com/vocab#">

<rdf:Description rdf:about="http://www.mydomain.com/person#john_doe">

<x:father-of rdf:resource="http://www.mydomain.com/person#jack_doe"/>

<x:has_name xml:lang="en">John Doe</x:has_name>

<x:has_birthyear rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1970</x:has_birthyear>

<x:has_name xml:lang="th">จอหั$น โด</x:has_name>

</rdf:Description>

<rdf:Description rdf:about="http://www.mydomain.com/person#jack_doe">

<rdf:type rdf:resource="http://www.mydomain.com/vocab#student"/>

</rdf:Description>

</rdf:RDF> 31

Page 32: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

N-Triples<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#father-of> <http://www.mydomain.com/person#jack_doe> .

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#has_name> "John Doe"@en.

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#has_birthyear> "1970"^^http://www.w3.org/2001/XMLSchema#integer.

<http://www.mydomain.com/person#jack_doe> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.mydomain.com/vocab#student> .

<http://www.mydomain.com/person#john_doe> <http://www.mydomain.com/vocab#has_name> “จอหั$น โด"@th .

32

Page 33: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Turtle

@prefix x: <http://www.mydomain.com/vocab#>.

@prefix person: <http://www.mydomain.com/person#>.

@prefix xsd:<http://www.w3.org/2001/XMLSchema#>.

person:john_doe x:father-of person:jack_doe ;x:has_name "John Doe"@en , “จอหั$น โด"@th ;

x:has_birthyear "1970"^^xsd:integer .

person:jack_doe a x:student .

33

Page 34: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Different syntaxes for “rdf:about”, “rdf:ID”, “rdf:type”

Page 35: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

The following RDF..<rdf:RDF

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:x="http://www.mydomain.com/vocab#">

<rdf:Description rdf:about="http://www.mydomain.com/person#joe_clark">

<x:has_name xml:lang="en">Joe Clark</x:has_name>

<rdf:type rdf:resource="http://www.mydomain.com/vocab#student"/>

</rdf:Description>

</rdf:RDF>

35

Page 36: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

is equivalent to<rdf:RDF

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:x="http://www.mydomain.com/vocab#"

xml:base="http://www.mydomain.com/person">

<rdf:Description rdf:ID="joe_clark">

<x:has_name xml:lang="en">Joe Clark</x:has_name>

<rdf:type rdf:resource="http://www.mydomain.com/vocab#student"/>

</rdf:Description>

</rdf:RDF>

36

Page 37: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

is equivalent to (2)

<rdf:RDF

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:x="http://www.mydomain.com/vocab#">

<x:student rdf:about ="http://www.mydomain.com/person#joe_clark">

<x:has_name xml:lang="en">Joe Clark</x:has_name>

</x:student>

</rdf:RDF>

37

Page 38: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

is equivalent to (3)

<rdf:RDF

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:x="http://www.mydomain.com/vocab#"

xml:base="http://www.mydomain.com/person">

<x:student rdf:ID="joe_clark">

<x:has_name xml:lang="en">Joe Clark</x:has_name>

</x:student>

</rdf:RDF>

38

Page 39: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Summary

RDF triples can be represented in multiple syntaxes RDF/XML is a current standard although it is

more complex than other syntaxes. Turtle is an extension of N-Tripples syntax and is

a subset of Notation 3 (N3) syntax. Turtle gains more popularity due to its simplicity

and has just become a standard. Turtle syntax is compatible with SPARQL syntax

which makes it easier to use with SPARQL.

39

Page 40: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Lab

1. Please create the example RDF/XML data in a file “person.rdf”1.1 Validate the created RDF data in W3C RDF Validation Service - http://www.w3.org/RDF/Validator/

1.2 Show the results in RDF triples and graph

2. Create the above RDF data in using N-Triples and Turtle syntax and validate the data using http://rdf.greggkellogg.net/distiller

40

Page 41: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Exercise 1:

Add the following information to the above RDF data Full name of ‘person:jack_doe’ as “Jack Doe” (in English)

and “แจ!ค โด” (in Thai) Add 2 phone numbers of ‘person:jack_doe’ as “082-111-

5555” and “02-123-1111” using property ‘x:has_phone’ Add birthdate of ‘person:jack_doe’ as “1970-11-11” using

property ‘x:has_birthdate’ with ‘xsd:date’ datatype. Add a triple that ‘person:john_doe’ has property ‘rdf:type’

of ‘x:doctor’.

41

Page 42: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Exercise 1:

Show the new RDF data in the following formats:1) RDF Graph

2) RDF/XML

3) N-Triples

4) Turtle

42

Page 43: RDF Syntax and examples ดร. มารุต บูรณรัช marut.bur@nectec.or.th marut.bur@nectec.or.th 269618: หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง

Exercise: 2

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

xml:base="http://www.mydomain.com/vocab#">

<rdfs:Class rdf:ID="Person" />

<rdfs:Class rdf:ID="Student">

<rdfs:subClassOf rdf:resource="#Person" />

</rdfs:Class>

<rdfs:Class rdf:ID="Doctor">

<rdfs:subClassOf rdf:resource="#Person" />

</rdfs:Class>

<rdf:Property rdf:ID="father-of">

<rdfs:domain rdf:resource="#Person" />

<rdfs:range rdf:resource="#Person" />

</rdf:Property>

<rdf:Property rdf:ID="has_name">

<rdfs:domain rdf:resource="#Person" />

</rdf:Property>

<rdf:Property rdf:ID="has_birthyear">

<rdfs:domain rdf:resource="#Person" />

</rdf:Property>

</rdf:RDF>

Show this RDF data that makes use of RDF schema vocabulary in RDF Graph form

43