OpenHPI 2.2 - How to Represent Facts - RDF

38
This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0 ) Dr. Harald Sack Hasso Plattner Institute for IT Systems Engineering University of Potsdam Spring 2013 Semantic Web Technologies Lecture 2: Semantic Web - Basic Architecture I 02: How to Represent Facts? - RDF(1)

description

 

Transcript of OpenHPI 2.2 - How to Represent Facts - RDF

Page 1: OpenHPI 2.2 - How to Represent Facts - RDF

This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0)

Dr. Harald Sack

Hasso Plattner Institute for IT Systems Engineering

University of Potsdam

Spring 2013

Semantic Web Technologies

Lecture 2: Semantic Web - Basic Architecture I02: How to Represent Facts? - RDF(1)

Page 2: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

2

Lecture 2: Semantic Web - Basic Architecture I

Open HPI - Course: Semantic Web Technologies

Page 3: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

3

02 How to Represent Facts? - RDF (1)Open HPI - Course: Semantic Web Technologies - Lecture 2: Semantic Web Basic Architecture I

Introduction

Page 4: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Tim Berners-Lee: W3 future directions, Plenary at 1st WWW Conference, 1994, Geneva (Switzerland)

Page 5: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

To a computer, then, the web is a flat, boring world devoid of meaning. This is a pity, as in fact documents on the web describe real objects and imaginary concepts, and give particular relationships between them. For example, a document might describe a person. The title document to a house describes a house and also the ownership relation with a person. [...]

Tim Berners-Lee: W3 future directions, Plenary at 1st WWW Conference, 1994, Geneva (Switzerland)

Page 6: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

2. Semantic Web Basic ArchitectureThe Languages of the Semantic Web - Part 1

Page 7: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

Knowledge Representation... a simple example

Page 8: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

<phonenr> <owner>Harald Sack</owner> <number>++49 (331) 5509-927</number></phonenr>

Knowledge Representation... a simple example

Page 9: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

<phonenr> <owner>Harald Sack</owner> <number>++49 (331) 5509-927</number></phonenr>

<person name=“Harald Sack“> <phonenr>49 (331) 5509-927</phonenr></person>

Knowledge Representation... a simple example

Page 10: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

<phonenr> <owner>Harald Sack</owner> <number>++49 (331) 5509-927</number></phonenr>

<person name=“Harald Sack“> <phonenr>49 (331) 5509-927</phonenr></person>

<person name=“Harald Sack“ phone=“49 (331) 5509-927“ />

Knowledge Representation... a simple example

Page 11: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

<phonenr> <owner>Harald Sack</owner> <number>++49 (331) 5509-927</number></phonenr>

<person name=“Harald Sack“> <phonenr>49 (331) 5509-927</phonenr></person>

<person name=“Harald Sack“ phone=“49 (331) 5509-927“ />

is there a unique (intuitive) way to model knowledge?

Knowledge Representation... a simple example

Page 12: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Harald Sack

Knowledge Representation... a simple example

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

Page 13: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Harald Sack

has the phone number

Knowledge Representation... a simple example

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

Page 14: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Harald Sack

has the phone number

++49 (331) 5509-927

Knowledge Representation... a simple example

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

Page 15: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Knowledge Representation... a simple example

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

■ Intuitive knowledge representation with directed graphs

Page 16: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Harald Sackhas phone number

++49 (331) 5509-927

Knowledge Representation... a simple example

■How do I represent:

„Harald Sack has the phone number ++49 (331) 5509-927“

■ Intuitive knowledge representation with directed graphs

Page 17: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Level 1(objects)

XMLXMLSchema

Knowledge Representation in the Semantic Web

Page 18: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Level 1(objects)

XMLXMLSchema

RDF &RDFSchema

Level 2(knowledge about

objects)

Knowledge Representation in the Semantic Web

Page 19: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

Level 1(objects)

XMLXMLSchema

Level 3(entire worlds)

OWL & Rules

RDF &RDFSchema

Level 2(knowledge about

objects)

Knowledge Representation in the Semantic Web

Page 20: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

10

RDF

Page 21: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

11

Resource■ can be everything (in principle)...

■must be uniquely identified and be referencable

■ ...simply via URI

Resource Description Framework

Page 22: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

12

Resource Description Framework

Description■ = Descriptions of resources

■ ...via representing properties and relationships among resources

■ ...relationships can be represented as graphs

Page 23: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

13

Resource Description Framework

Framework■ = Combination of web based protocols (URI, HTTP, XML,...)

■ based on formal model (semantics)

■ defines all allowed relationships among resources

Page 24: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

14

Resource Description Framework

Harald Sack

has phone number

++49 (331) 5509-927

Subject

Property

Object

Page 25: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

15

Resource Description Framework

Harald Sack

has phone number

++49 (331) 5509-927

■ Knowledge in RDF is expressed as a list of statements

■ all RDF statements follow the same simple schema

Page 26: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

16

Resource Description Framework

Harald Sack

has phone number

++49 (331) 5509-927

Subject

Property

Object

Page 27: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

17

Resource Description Framework

• Resources:Objects that can be addressed via URI

• Properties:Attributes for the description of resources

• Statements (RDF-Triple):Resource + Property + Object / Value

URI URI URI / Literal

Page 28: OpenHPI 2.2 - How to Represent Facts - RDF

Constituents of the RDF-Graph• URI:

• to reference resources uniquely

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

18

Resource Description Framework

http://hpi-web.de/HaraldSack http://semweb2013.blogspot.com/

http://hpi-web.de/Personal#writesBlog

S

P

O

Page 29: OpenHPI 2.2 - How to Represent Facts - RDF

Constituents of the RDF-Graphen• Literals:

• describe data values that do not have a separate existence

• strings, interpretation via datatype

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

19

Resource Description Framework

http://hpi-web.de/HaraldSack ++49-331-5509-927

http://hpi-web.de/Personal#hasPhoneNumber

S

P

O

Page 30: OpenHPI 2.2 - How to Represent Facts - RDF

Constituents of the RDF-Graphen• Literals:

• typed literals can be expressed via XML Schema datatypes

• Namespace for typed literals: http://www.w3.org/2001/XMLSchema#

• Example: “Semantics“^^<http://www.w3.org/2001/XMLSchema#string>

• Language Tags denote the (natural) language of the text:

• Example: “Semantik“@de , “Semantics“@en

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

20

Resource Description Framework

Page 31: OpenHPI 2.2 - How to Represent Facts - RDF

Constituents of the RDF-Graphen• Blank Nodes:

• Denotes existence of an individual with specific attributes, but without providing an identification or reference

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

21

Resource Description Framework

S

http://www.hpi-web.de/personal#person

rdf:typeP

O

Page 32: OpenHPI 2.2 - How to Represent Facts - RDF

RDF Representations• Node-Edge-Node Triple

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

22

Resource Description Framework

http://hpi-web.de/HaraldSack

http://hpi-web.de/Personal#writesBlog

S

P

O

http://semweb2013.blogspot.com/

Page 33: OpenHPI 2.2 - How to Represent Facts - RDF

RDF Representations• N3 Notation

•Simple listing of triples

• { http://hpi-web.de/HaraldSack, http://hpi-web.de/Personal#writesBlog, http://semweb2013.blogspot.com/ }

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

23

Resource Description Framework

Page 34: OpenHPI 2.2 - How to Represent Facts - RDF

RDF Representations• Turtle (Terse RDF Tripel Language)• Extension of N3

• URIs in angle brackets• Literals in quotation marks

• Triple ends with a period

• Whitespaces will be ignored

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

24

Resource Description Framework

<Subject> <Property> <Object> .<Subject> <Property> “Object“ .

Page 35: OpenHPI 2.2 - How to Represent Facts - RDF

RDF Representations• Turtle (Terse RDF Tripel Language)

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

25

Resource Description Framework

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#writesBlog> <http://semweb2013.blogspot.com/>.

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hasPhoneNumber> “++49-331-5509-927“.

Page 36: OpenHPI 2.2 - How to Represent Facts - RDF

RDF Representations• Turtle (Terse RDF Tripel Language)

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

26

Resource Description Framework

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .@prefix dc: <http://purl.org/dc/elements/1.1/> .@prefix ex: <http://example.org/stuff/1.0/> .

<http://www.w3.org/TR/rdf-syntax-grammar> dc:title "RDF/XML Syntax Specification (Revised)"@en ; ex:editor [ ex:fullname "Dave Beckett"^^xsd:string ; ex:homePage <http://purl.org/net/dajobe/> ] .

Page 37: OpenHPI 2.2 - How to Represent Facts - RDF

RDF Representations• RDF XML-Serialization

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

27

Resource Description Framework

<xml version=“1.0“ encoding=“utf-8“><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#“ xmlns:pers=“http://hpi-web.de/Personal#“>

<rdf:Description rdf:about=“http://hpi-web.de/HaraldSack“> <pers:hasPhoneNr>++49-331-5509-927</pers:hasPhoneNumber> </rdf:Description>

<rdf:Description rdf:about=“http://hpi-web.de/HaraldSack“> <pers:writesBlog> <rdf:Description rdf:about=“http://semweb2013.blogspot.com/“></rdf:Description> </pers:writesBlog> </rdf:Description></rdf:RDF>

Page 38: OpenHPI 2.2 - How to Represent Facts - RDF

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

28

03 How to Represent Facts? - RDF (2)Open HPI - Course: Semantic Web Technologies - Lecture 2: Semantic Web Basic Architecture I

Simple Facts in RDF