1
Knowledge Representation Part V RDF
Jan Pettersen Nytun, UiA
Knowledge Representation Part V RDF The representational power of - - PowerPoint PPT Presentation
Knowledge Representation Part V RDF The representational power of three. Jan Pettersen Nytun, UiA 1 S O P RDF - The Resource Description Framework A Framework For Describing Resources Resources can be anything, including documents,
1
Jan Pettersen Nytun, UiA
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 2
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 3
/ XML Schema
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 4
S O
P
network of associations with objects…perception mapped into a concept which is connected through relationships to other concepts.
formalizing associationist theories of knowledge. Example: Semantic networks.
Jan Pettersen Nytun, UiA, Ontology, page 5
S O
P
Jan Pettersen Nytun, UiA, Ontology, page 6
Christine DiagnosisId_1 hasDiagnosis BreastCanser hasSickness High hasDiagnosisProbability
S O
P
The use of triples for representation. Example: <Christine, hasDiagnosis, DiagnosisId_1> < DiagnosisId_1, hasSickness, BreastCanser> < DiagnosisId_1, hasDiagnosisProbability, High>
Jan Pettersen Nytun, UiA, Ontology, page 7
Christine diagnosis_id_1 hasDiagnosis BreastCanser hasSickness High hasDiagnosisProbability
S O
P
Jan Pettersen Nytun, UiA, Ontology, page 8
S O
P
Jan Pettersen Nytun, UiA, Ontology, page 9
predicate
In general: Example: <NursingReport_1, hasPatient, Kenny>
subject
hasPatient NursingReport_1 Kenny
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 10
S O
P
Jan Pettersen Nytun, UiA, Ontology, 11
S O
P
Jan Pettersen Nytun, UiA, Ontology, page 12
The following UML class model has been instantiated when the object diagram was made:
Student
* Course
* Teacher
* * s1:Student studentId = 101 name = Ola c1:Course courseId = IKT413 t1:Teacher teacherId = 1 name = Kari
follows teachIn s2:Student studentId = 102 name = Olga participant taughtBy
s1:Student studentId = 101 name = Ola c1:Course courseId = IKT413 t1:Teacher teacherId = 1 name = Kari s2:Student studentId = 102 name = Olga
studentId = 101 Name = “Ola”
studentId = 102 Name = “Olga”
rdf:type rdf:type
studentId = 101 Name = “Ola”
follows follows participant participant
teacherId = 1 Name = “Kari”
rdf:type
rdf:type taughtBy s1 rdf:type Student . s1 studentId 101 . s1 name “Ola” . s1 follows c1 . ….
S O
P
– 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
Jan Pettersen Nytun, UiA, Ontology, 14
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 15
S O
P
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:si ="http://www.w3schools.com/rdf/"> <rdf:Description rdf:about="http://www.w3schools.com"> <si:title>W3Schools.com</si:title> <si:author>Jan Egil Refsnes</si:author> </rdf:Description> </rdf:RDF>
Knowledge Representation Part I, JPN, UiA
16
S O
P
17
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#"> <contact:Person rdf:about="http://www.w3.org/People/EM/contact#me"> <contact:fullName>Eric Miller</contact:fullName> <contact:mailbox rdf:resource="mailto:em@w3.org"/> <contact:personalTitle>Dr.</contact:personalTitle> </contact:Person> </rdf:RDF>
[8]: "there is a Person identified by
http://www.w3.org/People/EM/contact#me,
whose name is Eric Miller, whose email address is em@w3.org, and whose title is Dr."
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 18
<foaf:Person rdf:about="http://example.org/Person#John"> <foaf:knows> <foaf:Person rdf:nodeID="b1"/> </foaf:knows> </foaf:Person> <foaf:Person rdf:about="http://example.org/Person#Mary"> <foaf:knows> <foaf:Person rdf:nodeID="b1"/> </foaf:knows> </foaf:Person>
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 19
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 20
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 21
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 22
〈#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〉 . …
S O
P
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〉.
Jan Pettersen Nytun, UiA, Ontologies, page 23
S O
P
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〉.
Jan Pettersen Nytun, UiA, Ontologies, page 24
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 25
S O
P
〈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
Jan Pettersen Nytun, UiA, Ontologies, page 26
S O
P
Complex Example
Jan Pettersen Nytun, UiA, Ontologies, page 27
〈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〉,〈#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〉 [ 〈#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〉 〈 i2134 〉. 〈 i2134 〉 〈#occupation〉 〈#sys_admin〉. 〈 i2134 〉 〈#serves_building〉 〈#comp_sci〉].
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 28
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 29
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 30
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 31
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 32
S O
P
Jan Pettersen Nytun, UiA, Ontologies, page 33
@prefix : <http://www.uia.no/janpn/medical_1#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <http://www.uia.no/janpn/medical_1> . <http://www.uia.no/janpn/medical_1> rdf:type owl:Ontology . Some RDF Standard Properties - Turtle Representation Continues…
S O
P
Some RDF Standard Properties - Turtle Representation Continues…
Jan Pettersen Nytun, UiA, Ontologies, page 34
### http://www.uia.no/janpn/medical_1#hasName :hasName rdf:type owl:DatatypeProperty ; rdfs:range xsd:string . ### http://www.uia.no/janpn/medical_1#hasPatient :hasPatient rdf:type owl:ObjectProperty . :EHealthRecord rdf:type owl:Class . :Patient rdf:type owl:Class .
S O
P
Some RDF Standard Properties - Turtle Representation Continues…
Jan Pettersen Nytun, UiA, Ontologies, page 35
:ID_JPN rdf:type :Patient ,
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 .
S O
P
Jan Pettersen Nytun, UiA, Propositional Calculus, page 36
[1] Book: David Poole and Alan Mackworth, Artificial Intelligence: Foundations of Computational Agents, Cambridge University Press, 2010, http://artint.info/ [2] http://www.w3.org/TR/swbp-n-aryRelations/ [3] RDF 1.1 Primer, W3C Working Group Note, 24 June 2014