Knowledge Representation Part V RDF The representational power of - - PowerPoint PPT Presentation

knowledge representation
SMART_READER_LITE
LIVE PREVIEW

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,


slide-1
SLIDE 1

1

Knowledge Representation Part V RDF

Jan Pettersen Nytun, UiA

The representational power of three.

slide-2
SLIDE 2

S O

P

RDF - The Resource Description Framework A Framework For Describing Resources

“Resources can be anything, including documents, people, physical objects, and abstract concepts.” [3]

Jan Pettersen Nytun, UiA, Ontologies, page 2

slide-3
SLIDE 3

S O

P

Jan Pettersen Nytun, UiA, Ontologies, page 3

The Semantic Web Language Stack

Hierarchy of languages, where each layer exploits and uses capabilities of the layers below.

/ XML Schema

slide-4
SLIDE 4

S O

P

Jan Pettersen Nytun, UiA, Ontologies, page 4

Ag Agen enda da

  • Semantic Networks and Triples
  • RDF and Triples
  • Representing RDF with XML
  • Representing RDF with Turtle
  • Protégé - Turtle Example
slide-5
SLIDE 5

S O

P

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.

Jan Pettersen Nytun, UiA, Ontology, page 5

slide-6
SLIDE 6

S O

P

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

Jan Pettersen Nytun, UiA, Ontology, page 6

Christine DiagnosisId_1 hasDiagnosis BreastCanser hasSickness High hasDiagnosisProbability

slide-7
SLIDE 7

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

slide-8
SLIDE 8

S O

P

Jan Pettersen Nytun, UiA, Ontology, page 8

<sub ubject> ject> < <pr pred edicat icate> e> < <ob

  • bjec

ject> t> A tr triple ple is say aying ng som

  • met

ethin hing g (ob

  • bject

ject/valu /value) e),

, ab about

  • ut some
  • meth

thing ing (s

(subject bject),

, in n reg egard ard to to so some meth thing ing (p

(predicat redicate/property e/property).

slide-9
SLIDE 9

S O

P

Jan Pettersen Nytun, UiA, Ontology, page 9

predicate

In general: Example: <NursingReport_1, hasPatient, Kenny>

Graphical Representation

  • f Triples

subject

  • bject

hasPatient NursingReport_1 Kenny

slide-10
SLIDE 10

S O

P

Jan Pettersen Nytun, UiA, Ontologies, page 10

Ag Agen enda da

  • Semantic Networks and Triples
  • RDF and Triples
  • Representing RDF with XML
  • Representing RDF with Turtle
  • Protégé - Turtle Example
slide-11
SLIDE 11

S O

P

The Conceptual model

  • f RDF
  • Triples
  • Semantic networks

Jan Pettersen Nytun, UiA, Ontology, 11

slide-12
SLIDE 12

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

  • studentId
  • name

* Course

  • courseId

* Teacher

  • teacherId
  • name

* * s1:Student studentId = 101 name = Ola c1:Course courseId = IKT413 t1:Teacher teacherId = 1 name = Kari

Task: How to represent the following object

diagram as triples graphically (and textually).

follows teachIn s2:Student studentId = 102 name = Olga participant taughtBy

slide-13
SLIDE 13

s1:Student studentId = 101 name = Ola c1:Course courseId = IKT413 t1:Teacher teacherId = 1 name = Kari s2:Student studentId = 102 name = Olga

s1

studentId = 101 Name = “Ola”

s2

studentId = 102 Name = “Olga”

Student

rdf:type rdf:type

c1

studentId = 101 Name = “Ola”

follows follows participant participant

t1

teacherId = 1 Name = “Kari”

Student

rdf:type

Teacher

rdf:type taughtBy s1 rdf:type Student . s1 studentId 101 . s1 name “Ola” . s1 follows c1 . ….

slide-14
SLIDE 14

S O

P

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

Jan Pettersen Nytun, UiA, Ontology, 14

slide-15
SLIDE 15

S O

P

Jan Pettersen Nytun, UiA, Ontologies, page 15

Agen enda da

  • Semantic Networks and Triples
  • RDF and Triples
  • Representing RDF with XML
  • Representing RDF with Turtle
  • Protégé - Turtle Example
slide-16
SLIDE 16

S O

P

XML - Used as Representational Language[6]

<?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

slide-17
SLIDE 17

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."

slide-18
SLIDE 18

S O

P

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.

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>

slide-19
SLIDE 19

S O

P

Jan Pettersen Nytun, UiA, Ontologies, page 19

Agen enda da

  • Semantic Networks and Triples
  • RDF and Triples
  • Representing RDF with XML
  • Representing RDF with Turtle
  • Protégé - Turtle Example
slide-20
SLIDE 20

S O

P

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.

Jan Pettersen Nytun, UiA, Ontologies, page 20

slide-21
SLIDE 21

S O

P

A triple is written simply as: Subject Predicate Object .

  • A URI is often written within angle brackets, e.g.,

〈http://aispace.org〉.

  • The URI 〈〉 refers to the current document, e.g.,

〈#comp_2347〉 denotes an individual defined in the current document.

Jan Pettersen Nytun, UiA, Ontologies, page 21

slide-22
SLIDE 22

S O

P

Example

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〉 . …

slide-23
SLIDE 23

S O

P

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〉.

Jan Pettersen Nytun, UiA, Ontologies, page 23

slide-24
SLIDE 24

S O

P

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〉.

Jan Pettersen Nytun, UiA, Ontologies, page 24

slide-25
SLIDE 25

S O

P

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.

Jan Pettersen Nytun, UiA, Ontologies, page 25

Turtle Abbreviations Continues…

slide-26
SLIDE 26

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

  • bject of a triple.

Jan Pettersen Nytun, UiA, Ontologies, page 26

Anonymous individual (blank node) - example:

slide-27
SLIDE 27

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〉].

slide-28
SLIDE 28

S O

P

Jan Pettersen Nytun, UiA, Ontologies, page 28

Agen enda da

  • Semantic Networks and Triples
  • RDF and Triples
  • Representing RDF with XML
  • Representing RDF with Turtle
  • Protégé - Turtle Example
slide-29
SLIDE 29

S O

P

Example: Some RDF Standard Properties + Turtle Representation

Jan Pettersen Nytun, UiA, Ontologies, page 29

slide-30
SLIDE 30

S O

P

Jan Pettersen Nytun, UiA, Ontologies, page 30

slide-31
SLIDE 31

S O

P

Jan Pettersen Nytun, UiA, Ontologies, page 31

slide-32
SLIDE 32

S O

P

Jan Pettersen Nytun, UiA, Ontologies, page 32

slide-33
SLIDE 33

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…

slide-34
SLIDE 34

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 .

slide-35
SLIDE 35

S O

P

Some RDF Standard Properties - Turtle Representation Continues…

Jan Pettersen Nytun, UiA, Ontologies, page 35

:ID_JPN rdf:type :Patient ,

  • wl:NamedIndividual ;

rdfs:label "Jan Pettersen Nytun" ; :hasName "Jan Pettersen Nytun"^^xsd:string . :eHealtRecord_Jan rdf:type :EHealthRecord ,

  • wl:NamedIndividual ;

rdfs:label "Health Record for Jan Pettersen Nytun" ; :hasPatient :ID_JPN .

slide-36
SLIDE 36

S O

P

References

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