Presentation is loading. Please wait.

Presentation is loading. Please wait.

Knowledge Representation Part V RDF

Similar presentations


Presentation on theme: "Knowledge Representation Part V RDF"— Presentation transcript:

1 Knowledge Representation Part V RDF
The representational power of three. Jan Pettersen Nytun, UiA

2 RDF - The Resource Description Framework A Framework For Describing Resources
“Resources can be anything, including documents, people, physical objects, and abstract concepts.” [3]

3 The Semantic Web Language Stack
Hierarchy of languages, where each layer exploits and uses capabilities of the layers below. / XML Schema

4 Agenda Semantic Networks and Triples RDF and Triples
Representing RDF with XML Representing RDF with Turtle Protégé - Turtle Example W3C Technology

5 Associationist … meaning of an object is given in terms of a network of associations with objects…perception mapped into a concept which is connected through relationships to other concepts. Graphs (arcs and nodes) are ideal vehicle for formalizing associationist theories of knowledge. Example: Semantic networks. Background of OWL

6 Semantic Networks Represents knowledge in the form of a graph where:
the nodes correspond to facts or concepts the arcs correspond to relations or associations between the concepts BreastCanser hasSickness Christine hasDiagnosis DiagnosisId_1 High hasDiagnosisProbability

7 The use of triples for representation.
Example: <Christine, hasDiagnosis, DiagnosisId_1> < DiagnosisId_1, hasSickness, BreastCanser> < DiagnosisId_1, hasDiagnosisProbability, High> BreastCanser hasSickness Christine hasDiagnosis diagnosis_id_1 High hasDiagnosisProbability

8 <subject> <predicate> <object> A triple is saying something (object/value), about something (subject), in regard to something (predicate/property).

9 Graphical Representation of Triples
In general: predicate subject object Example: <NursingReport_1, hasPatient, Kenny> hasPatient NursingReport_1 Kenny

10 Agenda RDF and Triples Semantic Networks and Triples
Representing RDF with XML Representing RDF with Turtle Protégé - Turtle Example W3C Technology

11 The Conceptual model of RDF
Triples Semantic networks

12 The following UML class model has been instantiated when the object diagram was made:
teachIn * follows * Student Course Teacher * participant * taughtBy -studentId -name -courseId -teacherId -name Task: How to represent the following object diagram as triples graphically (and textually). s1:Student c1:Course t1:Teacher studentId = 101 name = Ola courseId = IKT413 teacherId = 1 name = Kari s2:Student studentId = 102 name = Olga

13 t1 rdf:type s1 rdf:type Student . s1 studentId 101 . s1 name “Ola” .
c1:Course t1:Teacher studentId = 101 name = Ola courseId = IKT413 teacherId = 1 name = Kari rdf:type s1 rdf:type Student . s1 studentId s1 name “Ola” . s1 follows c1 . …. s2:Student t1 studentId = 102 name = Olga teacherId = 1 Name = “Kari” s1 participant taughtBy rdf:type follows studentId = 101 Name = “Ola” c1 Student follows studentId = 101 Name = “Ola” s2 rdf:type rdf:type studentId = 102 Name = “Olga” participant Teacher

14 RDF Triple[7] An RDF triple contains:
the subject - an RDF URI reference or a blank node the predicate - an RDF URI reference the object - an RDF URI reference, a literal (string, number, etc.) or a blank node blank node = anonymous node

15 Agenda Representing RDF with XML Semantic Networks and Triples
RDF and Triples Representing RDF with XML Representing RDF with Turtle Protégé - Turtle Example W3C Technology

16 XML - Used as Representational Language[6]
<?xml version="1.0"?> <rdf:RDF xmlns:rdf=" xmlns:si =" <rdf:Description rdf:about="   <si:title>W3Schools.com</si:title>   <si:author>Jan Egil Refsnes</si:author> </rdf:Description> </rdf:RDF> Knowledge Representation Part I, JPN, UiA

17 [8]: "there is a Person identified by http://www. w3
[8]: "there is a Person identified by whose name is Eric Miller, whose address is and whose title is Dr." <?xml version="1.0"?> <rdf:RDF xmlns:rdf=" xmlns:contact=" <contact:Person rdf:about=" <contact:fullName>Eric Miller</contact:fullName> <contact:mailbox <contact:personalTitle>Dr.</contact:personalTitle> </contact:Person> </rdf:RDF>

18 Blank Node (Anonymous Resource) From Wikipedia
In RDF, a blank node (also called bnode) is a node in an RDF graph representing a resource for which a URI or literal is not given. <foaf:Person rdf:about=" <foaf:knows> <foaf:Person rdf:nodeID="b1"/> </foaf:knows> </foaf:Person> <foaf:Person rdf:about="

19 Agenda Representing RDF with Turtle Semantic Networks and Triples
RDF and Triples Representing RDF with XML Representing RDF with Turtle Protégé - Turtle Example W3C Technology

20 Terse Language for Triples Turtle
RDF/XML is the originally unique syntax and standard for writing RDF. Turtle is an alternative. Turtle does not rely on XML and is more readable and easier to edit manually than its XML counterpart.

21 A triple is written simply as: Subject Predicate Object .
A URI is often written within angle brackets, e.g., 〈 The URI 〈〉 refers to the current document, e.g., 〈#comp_2347〉 denotes an individual defined in the current document.

22 Example 〈#comp_2347〉 〈#owned_by〉 〈#craig〉 〈#comp_2347〉 〈#model〉 〈#lemon_laptop_10000〉 . 〈#comp_2347〉 〈#brand〉 〈#lemon_computer〉 〈#comp_2347〉 〈#logo〉 〈#lemon_disc〉 〈#comp_2347〉 〈#color〉 〈#brown〉 〈#craig〉 〈#room〉 〈#r107〉 …

23 Turtle Abbreviations A semicolon is used to group predicate-object pairs for the same subject. S P1 O1; P2 O2. is an abbreviation for S P1 O1. S P2 O2. E.g.: 〈#comp_3645〉 〈#owned_by〉 〈#fran〉 ; 〈#color〉 〈#green〉. equals: 〈#comp_3645〉 〈#owned_by〉 〈#fran〉. 〈#comp_3645〉 〈#color〉 〈#green〉.

24 Turtle Abbreviations Continues…
A comma can group objects with the same subject and predicate. S P O1, O2 . is an abbreviation for S P O1 . S P O2 . E.g.: 〈#comp_3645〉 〈#color〉 〈#green〉, 〈#yellow〉 . equals: 〈#comp_3645〉 〈#color〉 〈#green〉 . 〈#comp_3645〉 〈#color〉 〈#yellow〉.

25 Turtle Abbreviations Continues…
Square brackets can be used to define an individual that is not given an identifier, i.e., a blank node. [P1 O1; P2 O2] is an individual that has value O1 on property P1 and has value O2 on property P2.

26 Anonymous individual (blank node) - example:
〈comp_3645〉 〈#managed_by〉 [〈#occupation〉 〈#sys_admin〉]. Equals: 〈comp_3645〉 〈#managed_by〉 〈i2134〉. 〈i2134〉 〈#occupation〉 〈#sys_admin〉. the made-up URI, 〈i2134〉, cannot be referred to outside the document. As we can see, the anonymous individual can be used as the object of a triple.

27 Complex Example 〈comp_3645〉 〈#owned_by〉 〈#fran〉.
〈comp_3645〉 〈#color〉 〈#green〉,〈#yellow〉. 〈comp_3645〉 〈#managed_by〉 [ 〈#occupation〉 〈#sys_admin〉; 〈#serves_building〉 〈#comp_sci〉] . 〈comp_3645〉 〈#owned_by〉 〈#fran〉; 〈#color〉 〈#green〉,〈#yellow〉; 〈#managed_by〉 [ 〈#occupation〉 〈#sys_admin〉; 〈#serves_building〉 〈#comp_sci〉] . 〈comp_3645〉 〈#owned_by〉 〈#fran〉. 〈comp_3645〉 〈#color〉 〈#green〉. 〈comp_3645〉 〈#color〉 〈#yellow〉. 〈comp_3645〉 〈#managed_by〉 <i2134>. <i2134> 〈#occupation〉 〈#sys_admin〉; 〈#serves_building〉 〈#comp_sci〉] . 〈comp_3645〉 〈#owned_by〉 〈#fran〉. 〈comp_3645〉 〈#color〉 〈#green〉. 〈comp_3645〉 〈#color〉 〈#yellow〉. 〈comp_3645〉 〈#managed_by〉 [ 〈#occupation〉 〈#sys_admin〉; 〈#serves_building〉 〈#comp_sci〉] . 〈comp_3645〉 〈#owned_by〉 〈#fran〉. 〈comp_3645〉 〈#color〉 〈#green〉. 〈comp_3645〉 〈#color〉 〈#yellow〉. 〈comp_3645〉 〈#managed_by〉 〈 i2134 〉. 〈 i2134 〉 〈#occupation〉 〈#sys_admin〉. 〈 i2134 〉 〈#serves_building〉 〈#comp_sci〉].

28 Agenda Protégé - Turtle Example Semantic Networks and Triples
RDF and Triples Representing RDF with XML Representing RDF with Turtle Protégé - Turtle Example W3C Technology

29 Example: Some RDF Standard Properties + Turtle Representation

30

31

32

33 Some RDF Standard Properties - Turtle Representation Continues…
@prefix : < . @prefix owl: < . @prefix rdf: < . @prefix xml: < . @prefix xsd: < . @prefix rdfs: < . @base < . < rdf:type owl:Ontology .

34 Some RDF Standard Properties - Turtle Representation Continues…
### :hasName rdf:type owl:DatatypeProperty ; rdfs:range xsd:string . ### :hasPatient rdf:type owl:ObjectProperty . :EHealthRecord rdf:type owl:Class . :Patient rdf:type owl:Class .

35 Some RDF Standard Properties - Turtle Representation Continues…
:ID_JPN rdf:type :Patient , owl:NamedIndividual ; rdfs:label "Jan Pettersen Nytun" ; :hasName "Jan Pettersen Nytun"^^xsd:string . :eHealtRecord_Jan rdf:type :EHealthRecord , rdfs:label "Health Record for Jan Pettersen Nytun" ; :hasPatient :ID_JPN .

36 References [1] Book: David Poole and Alan Mackworth, Artificial Intelligence: Foundations of Computational Agents, Cambridge University Press, 2010, [2] [3] RDF 1.1 Primer, W3C Working Group Note, 24 June 2014


Download ppt "Knowledge Representation Part V RDF"

Similar presentations


Ads by Google