knowledge graphs - wiki.uib.no · • 1 pechakucha (15slidesx20’’) • 1 follow-up meeting...

56
Knowledge Graphs INFO216 Marc Gallofré Ocaña [email protected] UNIVERSITY OF BERGEN

Upload: others

Post on 06-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Knowledge Graphs

INFO216

Marc Gallofré Ocañ[email protected]

UNIVERSITY OF BERGEN

Page 2: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

INFO216

Organization

Page 3: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Course information

• Course language: English

• Course materials and information:

– mitt.uib.no

– wiki.uib.no/info216

• 14 weeks course (tentative planning)

– 12-14 lecture sessions

– 12-14 lab sessions

• You learn programming (mostly) through the lab exercises and project!

UNIVERSITY OF BERGEN

PAGE 3

Page 4: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Course recommended knowldege

• Good programming skills

– Java is recommended

• SQL basic skills

• Semantic Technologies course (INFO116)

• Class or DBs modeling concepts (either UML,

EER or others)

UNIVERSITY OF BERGEN

PAGE 4

Page 5: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Course grading

• Group final project (40%)

– Mandatory presentations

– Graded on deliveries and progress

– Follow-up meetings/presentations

• 3 hours individual written final exam (60%)

– Exam requirements:• Submitted programming project

• Participation in 80% of labs

– Exam pass grade is 50 points

UNIVERSITY OF BERGEN

PAGE 5

Page 6: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Follow-up meetings and

presentations

• 3 project presentations during lab sessions

– The last one is the final project presentation,

during the last lab session.

• 1 elevator pitch (2min)

• 1 PechaKucha (15slidesx20’’)

• 1 Follow-up meeting

UNIVERSITY OF BERGEN

PAGE 6

Page 7: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Course organization

• Lectures

– Mondays 14:15 to 16:00 from January 14th

until April 8th (last lecture date can change)

• Labs (2 groups) Starting Tuesday 22nd

– Group 1: Tuesday 08:15 - 10:00

– Group 2: Wednesday 14:15 - 16:00

• Question sessions Starting Tuesday 22nd

– Tuesday 14:15 - 16:00

UNIVERSITY OF BERGEN

PAGE 7

Page 8: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Course organization

• Lectures: BC Aud 128

• Labs (2 groups): Ulrikke Pihl PC 202 xor UP

PC 205

• Question sessions: BC Aud 128

UNIVERSITY OF BERGEN

PAGE 8

Page 9: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Labs organization

• Labs

– 3 lab days used for project presentations and

discussions.

– The rest are practical assignments

– 80% mandatory attendance, including all

the presentation days

UNIVERSITY OF BERGEN

PAGE 9

Page 10: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Project organization

• Groups

– Groups of 3 people.

– In case of not multiple of 3, we will do a group of 2 people.

– All group members should register themself intothe same lab group

– In case of other subjects overlaps with labschedules, the last group registered will be changed allowing the attendance of the othergroup.

UNIVERSITY OF BERGEN

PAGE 10

Page 11: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Important dates

• Final project submission

– 14:00 on May 24th through Inspera

• Final exam

– 09:00 on June 13th (date and time can

change)

UNIVERSITY OF BERGEN

PAGE 11

Page 12: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Semantic web

history

Page 13: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Semantic web and WWW history

UNIVERSITY OF BERGEN

PAGE 13

WWW

Tim Berners-Lee

12 march 1989

Tim Berners-Lee

published

«The Semantic Web»

2001

Weaving the Web (1999)The original design and ultimate destiny of

the World Wide Web, by its inventorhttps://www.w3.org/People/Berners-Lee/Weaving/Overview.html

DBpedia

2007

Wikidata

2012

From the «Web of Documents»

to the «Web of Data»

Tim Berners-Lee: http://www.youtube.com/watch?v=HeUrEh-nqtU

Information Management: A Proposal: https://cds.cern.ch/record/369245/files/dd-89-001.pdf

Information Management:

A Proposal

Tim Berners-Lee, CERN

Page 14: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Tim Berners-Lee

Semantic Web of Data

UNIVERSITY OF BERGEN

PAGE 14

Page 15: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Industrial

Solutions

Page 16: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Google Knowledge Graph (2012)

Google uses Knowledge Graph to enhance its

search engine's results with information gathered

from a variety of sources.

UNIVERSITY OF BERGEN

PAGE 16https://www.google.com/intl/bn/search/about

Page 17: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Facebook Graph Search (2013)

Facebook Graph Search was a semantic search

designed to give answers to user natural

language queries rather than a list of links.

UNIVERSITY OF BERGEN

PAGE 17

https://www.facebook.com

Page 18: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Amazon Neptune (2017)

Amazon Neptune is a graph database service

that supports W3C's RDF and SPARQL among

others.

UNIVERSITY OF BERGEN

PAGE 18

https://aws.amazon.com/neptune/

Page 19: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

BBC Ontologies

BBC is using ontologies and its own vocabulary

to support their news.

UNIVERSITY OF BERGEN

PAGE 19

https://www.bbc.co.uk/ontologies

Page 20: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

UiB-SSIS

Research

Page 21: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

UBIMOB-Ubiquitous Data-Driven

Urban Mobility

To analyse and interlink data for being utilized to

understand, optimise and manage mobility and

make it more efficient, sustainable and smart.

UNIVERSITY OF BERGEN

PAGE 21

https://www.uib.no/fg/ssis/111998/ubimob-ubiquitous-data-driven-urban-mobility

Page 22: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

BDEM-Big Data for Emergency

Management

Aims to leverage open and big data to assist

strategic and operational deciding and acting

during all phases of emergency management,

from preparation, detection, rescue, relief, and

rebuilding.

UNIVERSITY OF BERGEN

PAGE 22

https://www.uib.no/fg/ssis/111999/bdem-big-data-emergency-management

Page 23: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

NewsAngler

To develop tools that can help journalists finding

new and unexpected background information,

angles and stories, from news, big data and

social media sources.

UNIVERSITY OF BERGEN

PAGE 23

https://www.uib.no/en/rg/ssis/114224/discovering-unexpected-connections-news

Page 24: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Semantic web

conecepts

Page 25: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Basic conecepts

• AAA: anyone can say anything about anytopic.– Two theories: Flat earth (https://theflatearthsociety.org)

and Spherical Earth (https://en.wikipedia.org/wiki/Spherical_Earth)

• Nonunique Naming Assumption: we have to assume that some Web resource might be referred to using different names by different people.– A star can have diferent names: Sirius or HD 48915 or

HR 2491

UNIVERSITY OF BERGEN

PAGE 25

Page 26: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Basic conecepts

Open world assumption: an open world in this

sense is one in which we must assume that at

any time any new information could come to light,

and we may draw no conclusions that rely on

assuming that the information available at any

one point is all the information available.

UNIVERSITY OF BERGEN

PAGE 26

Page 27: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

URI and IRI

Uniform Resource Identifier and Internationalized

Resource Identifier. Is a string of characters that

unambiguously identifies a particular resource.

URI works only with English alphabet (US-ASCII)

and IRI uses Unicode/ISO 10646.

UNIVERSITY OF BERGEN

PAGE 27

https://www.ietf.org/rfc/rfc3986.txt

https://www.ietf.org/rfc/rfc3987.txt

foo://example.com:8042/over/there?name=ferret#nose

Page 28: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF

Resource Description Framework. Basic

framework that the Semantic Web is based on.

• Treated as a set of triples

• The relations form a directed graph

– “Nodes”: represent resources

– “Leaf nodes”: can contain literal values

– “Arrows”: relations between resources or literals

UNIVERSITY OF BERGEN

PAGE 28

Page 29: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Resource

Resources may be physical phenomena

(including people and artefacts), information

resources, concepts, constructs, and information

about all of them.

● Can be the subject or object in a statement

but only rdf:Property can be predicate

● Can be named by an IRI or anonymous (blank

node)

● Resources can have one or more rdf:type

UNIVERSITY OF BERGEN

PAGE 29

Page 30: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Basic conecepts

Semantic Graph: is a collection of

triples/statements (possibly zero).

Data set: a collection of at least one graph

– One of the graphs is default/unnamed

– the others are named

UNIVERSITY OF BERGEN

PAGE 30

Page 31: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Blank node (anonymous resource)

• Some nodes have no IRIs:

– cannot be referenced by other data sets

– can be referenced by graphs in same data set

• Can have a (non-IRI) identifier, but local identifier only meaningful inside the data set

• Cannot be used to merge nodes from different data sets

• Uses:

– you are not sure of the IRI

– you do not want to provide an IRI

– logical grouping of related properties

– not supported by all RDF technologies

UNIVERSITY OF BERGEN

PAGE 31

Page 32: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Vocabulary

Semantic web use vocabulary to express the

meaning of concepts:

– IRIs for resource types

– IRIs for properties

– Standard types for literals

– Rules about how they combine

Other open semantic datasets define standard

IRIs for individual resources

UNIVERSITY OF BERGEN

PAGE 32

Page 33: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Vocabulary

• RDFS (RDF Schema) is a general-purpose language for representing simple RDF vocabularies on the Web

• OWL (Web Ontology Language) is a Semantic Web language designed to represent knowledge about things, groups of things, and relations between things.

• SKOS (Simple Knowledge Organization System) is a common data model for sharing and linking knowledge organization systems via the Web.

UNIVERSITY OF BERGEN

PAGE 33

Page 34: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Qnames

A QName is a simplified version of a IRI

abbreviation scheme. A QName concisely

associates the IRI of a resource namespace with

the local name in that namespace.

owl: <http://www.w3.org/2002/07/owl#> .

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

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

skos: <http://www.w3.org/2004/02/skos/core#> .

UNIVERSITY OF BERGEN

PAGE 34

Page 35: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Qnames

A QName has two parts: a namespace and a

identifier, written with a colon between

(namespace : identifier).

owl:sameAs→ http://www.w3.org/2002/07/owl#sameAs

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

UNIVERSITY OF BERGEN

PAGE 35

Page 36: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

TBox and ABox

• TBox (“T from term”) are statements that describe a domain of interest by defining classes and properties as a domain vocabulary.

All students are Persons

• ABox (“A from assertion”) are facts associated with a conceptual model or ontologies within a knowledge base.

John is a Student

John is a Person

UNIVERSITY OF BERGEN

PAGE 36

Page 37: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF

Page 38: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF triples

• The basic form of a RDF block is called triple.

• A triple has a subject, predicate and object

(as a grammatical sentence).

Jonh bought apple

| | |

subject predicate object

UNIVERSITY OF BERGEN

PAGE 38

Page 39: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF triples

• Subject: represents what the statement is about

– the IRI of a semantic resource

• Predicate: represents a property of the subject

resource

– the IRI of a semantic property

• Object: represents the value of a property for a

subject

– the IRI of a semantic resource

– a literal (number, string, boolean...)

UNIVERSITY OF BERGEN

PAGE 39

Page 40: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF Triples

• Triples of subject predicate object or subjectpredicate literal

– The subject:• must be a resource (→rdfs:Resource)

• named by an IRI or anonymous (blank node)

– The predicate:• must be a property (→rdf:Property)

• properties are resources too!

– The object:• either a resource (named or anonymous/blank) or a

constant value (→rdfs:Literal)

UNIVERSITY OF BERGEN

PAGE 40

A resource

can be either

a subject or

object or

predicate

Page 41: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF Triples

UNIVERSITY OF BERGEN

PAGE 41

:John :bought :Apple

:Apple :from :Norway

:Apple :brand “NorgeEpler”

Page 42: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Triples

Author Title

Mary Shelley Frankenstein

Shakespeare Macbeth

UNIVERSITY OF BERGEN

PAGE 42

Subject Predicate Object

Mary Shelley wrote Frankenstein

Shakespeare wrote Macbeth

Representing data as triples

Page 43: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Triples exercise

Author Book Year

Mary Shelley Frankenstein 1818

Isaac Asimov Foundation 1942

UNIVERSITY OF BERGEN

PAGE 43

Individual (5 minutes): Transform the given table into a triples table

(subject – predicate – object)

Page 44: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

Triples solution

UNIVERSITY OF BERGEN

PAGE 44

Subject Predicate Object

Mary Shelley wrote Frankenstein

Isaac Asimov wrote Foundation

Frankenstein publishedIn 1818

Foundation publishedIn 1942

Individual (5 minutes): Transform the given table into a triples table

(subject – predicate – object)

Page 45: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF triples

UNIVERSITY OF BERGEN

PAGE 45

Subject Predicate Object

lit:Mary Shelley lit:wrote lit:Frankenstein

lit:Isaac Asimov lit:wrote lit:Foundation

lit:Mary Shelley rdf:type lit:Writer

lit:Foundation lit:author lit:Isaac Asimov

Based on the previous exercise using RDF triples and Qnames.

lit: → referencing to literature schema resources

http://www.INFO216.org/foo/literature

Page 46: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF/XML description

UNIVERSITY OF BERGEN

PAGE 46

1: <?xml version="1.0"?>

2: <rdf:RDF

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

4: xmlns:lit="http://www.INFO216.org/foo/literature#">

5: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Mary_Shelly">

6: <lit:wrote>

7: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Frankenstein"/>

8: </lit:wrote>

9: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

10: </rdf:Description>

11: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov">

12: <lit:wrote>

13: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Fundation">

14: <lit:author>

15: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov"/>

16: </lit:author>

17: </rdf:Description>

18: </lit:wrote>

19: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

20: </rdf:Description>

21: </rdf:RDF>

Qname

Page 47: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF/XML description

UNIVERSITY OF BERGEN

PAGE 47

1: <?xml version="1.0"?>

2: <rdf:RDF

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

4: xmlns:lit="http://www.INFO216.org/foo/literature#">

5: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Mary_Shelly">

6: <lit:wrote>

7: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Frankenstein"/>

8: </lit:wrote>

9: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

10: </rdf:Description>

11: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov">

12: <lit:wrote>

13: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Fundation">

14: <lit:author>

15: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov"/>

16: </lit:author>

17: </rdf:Description>

18: </lit:wrote>

19: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

20: </rdf:Description>

21: </rdf:RDF>

Subject

Page 48: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF/XML description

UNIVERSITY OF BERGEN

PAGE 48

1: <?xml version="1.0"?>

2: <rdf:RDF

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

4: xmlns:lit="http://www.INFO216.org/foo/literature#">

5: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Mary_Shelly">

6: <lit:wrote>

7: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Frankenstein"/>

8: </lit:wrote>

9: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

10: </rdf:Description>

11: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov">

12: <lit:wrote>

13: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Fundation">

14: <lit:author>

15: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov"/>

16: </lit:author>

17: </rdf:Description>

18: </lit:wrote>

19: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

20: </rdf:Description>

21: </rdf:RDF>

Predicate

Page 49: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF/XML description

UNIVERSITY OF BERGEN

PAGE 49

1: <?xml version="1.0"?>

2: <rdf:RDF

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

4: xmlns:lit="http://www.INFO216.org/foo/literature#">

5: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Mary_Shelly">

6: <lit:wrote>

7: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Frankenstein"/>

8: </lit:wrote>

9: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

10: </rdf:Description>

11: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov">

12: <lit:wrote>

13: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Fundation">

14: <lit:author>

15: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov"/>

16: </lit:author>

17: </rdf:Description>

18: </lit:wrote>

19: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

20: </rdf:Description>

21: </rdf:RDF>

Object

Page 50: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF/XML description

UNIVERSITY OF BERGEN

PAGE 50

1: <?xml version="1.0"?>

2: <rdf:RDF

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

4: xmlns:lit="http://www.INFO216.org/foo/literature#">

5: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Mary_Shelly">

6: <lit:wrote>

7: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Frankenstein"/>

8: </lit:wrote>

9: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

10: </rdf:Description>

11: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov">

12: <lit:wrote>

13: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Fundation">

14: <lit:author>

15: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov"/>

16: </lit:author>

17: </rdf:Description>

18: </lit:wrote>

19: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

20: </rdf:Description>

21: </rdf:RDF>

Page 51: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF/XML description

UNIVERSITY OF BERGEN

PAGE 51

1: <?xml version="1.0"?>

2: <rdf:RDF

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

4: xmlns:lit="http://www.INFO216.org/foo/literature#">

5: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Mary_Shelly">

6: <lit:wrote>

7: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Frankenstein"/>

8: </lit:wrote>

9: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

10: </rdf:Description>

11: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov">

12: <lit:wrote>

13: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Fundation">

14: <lit:author>

15: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Isaac_Asimov"/>

16: </lit:author>

17: </rdf:Description>

18: </lit:wrote>

19: <rdf:type rdf:resource="http://www.INFO216.org/foo/literature#Writer"/>

20: </rdf:Description>

21: </rdf:RDF>

Nested description

Page 52: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF graph

UNIVERSITY OF BERGEN

PAGE 52

https://www.w3.org/TR/rdf-syntax-grammar/

https://www.w3.org/RDF/Validator/rdfval

Page 53: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF/XML exercise

UNIVERSITY OF BERGEN

PAGE 53

1: <?xml version="1.0"?>

2: <rdf:RDF

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

4: xmlns:lit="http://www.INFO216.org/foo/literature#">

Groups of 3 (5 minutes): Write the RDF/XML statement which represents the

following graph.

Page 54: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF/XML solution I

UNIVERSITY OF BERGEN

PAGE 54

1: <?xml version="1.0"?>

2: <rdf:RDF

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

4: xmlns:lit="http://www.INFO216.org/foo/literature#">

5: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Mary_Shelly">

6: <lit:wrote>

7: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#Frankenstein">

8: <lit:character>

9: <rdf:Description

rdf:about="http://www.INFO216.org/foo/literature#Victor_Frankenstein"/>

10 </lit:character>

11: </rdf:Description>

12: </lit:wrote>

13: </rdf:Description>

14: </rdf:RDF>

Groups of 3 (5 minutes): Write the RDF/XML statement which represents the

following graph.

Page 55: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

RDF/XML solution II

UNIVERSITY OF BERGEN

PAGE 55

1: <?xml version="1.0"?>

2: <rdf:RDF

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

4: xmlns:lit="http://www.INFO216.org/foo/literature#">

5: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#:Mary_Shelly">

6: <lit:wrote>

7: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#:Frankenstein"/>

8: </lit:wrote>

9: </rdf:Description>

10: <rdf:Description rdf:about="http://www.INFO216.org/foo/literature#:Frankenstein">

11: <lit:character>

12: <rdf:Description

rdf:about="http://www.INFO216.org/foo/literature#:Victor_Frankenstein"/>

13: </lit:character>

14: </rdf:Description>

15: </rdf:RDF>

Groups of 3 (5 minutes): Write the RDF/XML statement which represents the

following graph.

Page 56: Knowledge Graphs - wiki.uib.no · • 1 PechaKucha (15slidesx20’’) • 1 Follow-up meeting UNIVERSITY OF BERGEN PAGE 6. Course organization • Lectures

UNIVERSITY OF BERGEN