03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

99
Vorlesung Dr. Harald Sack Hasso-Plattner-Institut für Softwaresystemtechnik Universität Potsdam Wintersemester 2009/10 Semantic Web http://sw0910.blogspot.com / Blog zur Vorlesung: http://sewe0910.blogspot.com / Die nichtkommerzielle Vervielfältigung, Verbreitung und Bearbeitung dieser Folien ist zulässig (Lizenzbestimmungen CC-BY-NC ).

Transcript of 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Page 1: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Vorlesung

Dr. Harald Sack

Hasso-Plattner-Institut für Softwaresystemtechnik

Universität Potsdam

Wintersemester 2009/10

Semantic Web

http://sw0910.blogspot.com/

Blog zur Vorlesung: http://sewe0910.blogspot.com/Die nichtkommerzielle Vervielfältigung, Verbreitung und Bearbeitung dieser Folien ist zulässig (Lizenzbestimmungen CC-BY-NC).

Page 2: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

1. Einführung

2. Semantic Web BasisarchitekturDie Sprachen des Semantic Web - Teil 1

3. Wissensrepräsentation und LogikDie Sprachen des Semantic Web - Teil 2

4. Ontology Engineering

5. Semantic Web Applications

2

Semantic Web - Vorlesungsinhalt

Page 3: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

Semantic Web Architektur3

URI / IRI

XML / XSDData Interchange: RDF

RDFS

Ontology: OWL Rule: RIF

Query:SPARQL

Proof

Unifying Logic

Cry

pto

Trust

Interface & Application

2. Semantic Web Basisarchitektur

Page 4: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

43.11.2009 – Vorlesung Nr. 31 2 4 5 6 7 8 9 1110 12

13

2. Semantic Web BasisarchitekturDie Sprachen des Semantic Web - Teil 1

2.1.Uniform Resource Identifier - URI

2.2.XML und XMLSchema

2.3.Resource Description Framework - RDF

2.4.RDF Schema

2.5.Wie kommt die Semantik ins WWW?

2.6.Abfragesprache SPARQL

2.7.Warum reicht RDF(S) noch nicht aus?

14

Semantic Web - Vorlesungsinhalt

Page 5: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

5

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

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

Page 6: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

5

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

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

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

Page 7: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Wissensrepräsentation - ein Beispiel■Wie repräsentiere ich folgende Aussage:

„Harald Sack hat die Telefonnummer ++49 (331) 5509-527“

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

6

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Page 8: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Wissensrepräsentation - ein Beispiel■Wie repräsentiere ich folgende Aussage:

„Harald Sack hat die Telefonnummer ++49 (331) 5509-527“

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

6

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<telefonnr> <inhaber>Harald Sack</inhaber> <nummer>++49 (331) 5509-527</nummer></telefonnr>

Page 9: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Wissensrepräsentation - ein Beispiel■Wie repräsentiere ich folgende Aussage:

„Harald Sack hat die Telefonnummer ++49 (331) 5509-527“

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

6

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<telefonnr> <inhaber>Harald Sack</inhaber> <nummer>++49 (331) 5509-527</nummer></telefonnr>

<person name=“Harald Sack“> <telefonnr>49 (331) 5509-527</telefonnr></person>

Page 10: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Wissensrepräsentation - ein Beispiel■Wie repräsentiere ich folgende Aussage:

„Harald Sack hat die Telefonnummer ++49 (331) 5509-527“

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

6

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<telefonnr> <inhaber>Harald Sack</inhaber> <nummer>++49 (331) 5509-527</nummer></telefonnr>

<person name=“Harald Sack“> <telefonnr>49 (331) 5509-527</telefonnr></person>

<person name=“Harald Sack“ tel=“49 (331) 5509-527“ />

Page 11: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Wissensrepräsentation - ein Beispiel■Wie repräsentiere ich folgende Aussage:

„Harald Sack hat die Telefonnummer ++49 (331) 5509-527“

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

6

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<telefonnr> <inhaber>Harald Sack</inhaber> <nummer>++49 (331) 5509-527</nummer></telefonnr>

<person name=“Harald Sack“> <telefonnr>49 (331) 5509-527</telefonnr></person>

<person name=“Harald Sack“ tel=“49 (331) 5509-527“ />

Problem: intuitive Form der Wissensmodellierung?

Page 12: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

7

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation■Wie repräsentiere ich folgende Aussage:

„Harald Sack hat die Telefonnummer ++49 (331) 5509-527“

■ Intuitive Form der Wissensrepräsentation mit Hilfe von gerichteten Graphen

Page 13: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

7

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation■Wie repräsentiere ich folgende Aussage:

„Harald Sack hat die Telefonnummer ++49 (331) 5509-527“

■ Intuitive Form der Wissensrepräsentation mit Hilfe von gerichteten Graphen

Harald Sackhat Telefonnr.

++49 (331) 5509-527

Page 14: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

8

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation und Kommunikation

Senderverwendet Schema A

Empfängerverwendet Schema A

XML-basierte Kommunikation

verwendet Schema A

XML-Parser

Conceptual Domain ModelObjects and Relations

<xsd:schema xmlns:xsd="http://..."><xsd:annotation> A-Schema</xsd:...</xsd:schema>

XML DTD / XML Schema

wird übersetzt in

Deployment

Page 15: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

9

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation und Kommunikation■ Problem: neue Kommunikationspartner können sich nicht

verstehen

Senderverwendet Schema A

Empfängerverwendet Schema A

XML-basierte Kommunikation

verwendet Schema A

XML-Parser

NeuerKommunikationspartner

verwendet Schema B

NeuerKommunikationspartnerverwendet Schema C

???

??? ???

Page 16: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

10

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation und Kommunikation■ Modelle müssen untereinander angepasst werden

Reengineering deskonzeptionellen

Modells

Matching

XML DocumentTranslation

Generation (XSLT)

XML DocumentTranslation

Schemata A <-> B

<xsd:schema xmlns:xsd="http://..."><xsd:annotation> A-Schema</xsd:...</xsd:schema>

<xsd:schema xmlns:xsd="http://..."><xsd:annotation> B-Schema</xsd:...</xsd:schema>

Schema A Schema B

<xsl:stylesheet version="1.0”xmlns:xsl="http://....Transform"<xsl:template match="/">....</xsl:template></xsl:stylesheet>

<xsl:stylesheet version="1.0”xmlns:xsl="http://....Transform"<xsl:template match="/">....</xsl:template></xsl:stylesheet>

Page 17: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

11

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation und Kommunikation■ Modelle müssen untereinander angepasst werden

■ Probleme:

□ Reengineering ist kostenaufwändig und kompliziert

□ Reengineering ist unnötig, wenn konzeptionelle Definitionssprache verwendet wird

□ Generierung von Übersetzungen (XSLT) ist ebenfalls aufwändig und unnötig

Page 18: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

11

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation und Kommunikation■ Modelle müssen untereinander angepasst werden

■ Probleme:

□ Reengineering ist kostenaufwändig und kompliziert

□ Reengineering ist unnötig, wenn konzeptionelle Definitionssprache verwendet wird

□ Generierung von Übersetzungen (XSLT) ist ebenfalls aufwändig und unnötig

Nutze abstrakte Ebene oberhalb von XML

Page 19: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

11

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation und Kommunikation■ Modelle müssen untereinander angepasst werden

■ Probleme:

□ Reengineering ist kostenaufwändig und kompliziert

□ Reengineering ist unnötig, wenn konzeptionelle Definitionssprache verwendet wird

□ Generierung von Übersetzungen (XSLT) ist ebenfalls aufwändig und unnötig

Nutze abstrakte Ebene oberhalb von XML

Resource Description Framework (RDF)• einfach und erweiterbar

Page 20: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

12

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation im Semantic Web

Level 1(Objekte)

XMLXMLSchema

Page 21: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

12

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation im Semantic Web

Level 1(Objekte)

XMLXMLSchema

RDFRDFSchema

Level 2(Wissen über

Objekte)

Page 22: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

12

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Wissensrepräsentation im Semantic Web

Level 1(Objekte)

XMLXMLSchema

RDFRDFSchema

Level 2(Wissen über

Objekte)

Level 3(abgeschlossene

Welten)

OWL

Page 23: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

Semantic Web Architektur13

URI / IRI

XML / XSDData Interchange: RDF

RDFS

Ontology: OWL Rule: RIF

Query:SPARQL

Proof

Unifying Logic

Cry

pto

Trust

Interface & Application

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Page 24: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

14

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/harald-sack.htm http://hpi-web.de/ws0910/semanticweb.htm

WebPage

URL

Page 25: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

14

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/harald-sack.htm http://hpi-web.de/ws0910/semanticweb.htm

WebPage

URL

Annotation <swrc:Dozent rdf:ID=„hs1"><swrc:name>Harald Sack</swrc:name>

...</swrc:Dozent >

<swrc:betreut rdf:resource ="http://hpi-web.de/WS0910/sw#sw"/>

<swrc:Vorlesung rdf:ID=“sw"><swrc:titel>Semantic Web</swrc:titel> ...</swrc:Vorlesung >

Links haben explizite Bedeutung!

Page 26: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

14

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/harald-sack.htm http://hpi-web.de/ws0910/semanticweb.htm

WebPage

URL

Person Lehrveranstaltung

Dozent

rdfs:subClassOf

Vorlesung

rdfs:subClassOfbetreut

rdfs:domain

rdfs:range

Ontologie

rdfs:typerdfs:typeAnnotation <swrc:Dozent rdf:ID=„hs1">

<swrc:name>Harald Sack</swrc:name>

...</swrc:Dozent >

<swrc:betreut rdf:resource ="http://hpi-web.de/WS0910/sw#sw"/>

<swrc:Vorlesung rdf:ID=“sw"><swrc:titel>Semantic Web</swrc:titel> ...</swrc:Vorlesung >

Links haben explizite Bedeutung!

Page 27: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

15

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Resource Description Format – RDF■ Ursprünglich entwickelt zur Angabe von Metadaten für

Web-Ressourcen

■ 1995-1997: proprietäres Meta Content Framework (Netscape)

■ 1997 RDF als allgemeine Sprachdefinition für Metadaten, W3C Draft

■ 1998 erste RDF W3C Recommendation (http://www.w3c.org/RDF)

■ 2004 überarbeitete RDF W3C Recommendation

■ Festlegung einer XML-Untermenge mit fest vorgeschriebener Semantik (machine readable machine understandable)

■ Syntaktische Konvention eines einfachen, universellen semantischen Datenmodells

■ RDF ist geeignet zur Beschreibung aller möglichen Web-Ressourcen

■ Mit RDF soll ein möglichst hohes Maß an Interoperabilität ermöglicht werden

Page 28: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Resource Description Framework - RDF• definiert Datenmodell zur Beschreibung maschinen-

verarbeitbarer Semantik von Daten

• erlaubt Assoziation einfacher Semantik mit verwendeten Elementen

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

16

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Objekt(Ressource)

URI

Page 29: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Resource Description Framework - RDF• definiert Datenmodell zur Beschreibung maschinen-

verarbeitbarer Semantik von Daten

• erlaubt Assoziation einfacher Semantik mit verwendeten Elementen

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

16

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Objekt(Ressource)

Eigenschaften(Properties)

URI

Page 30: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Resource Description Framework - RDF• definiert Datenmodell zur Beschreibung maschinen-

verarbeitbarer Semantik von Daten

• erlaubt Assoziation einfacher Semantik mit verwendeten Elementen

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

16

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Objekt(Ressource)

Eigenschaften(Properties)

Wertzuweisungen(Ressource / Literal)

URI

Page 31: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Resource Description Framework - RDF• definiert Datenmodell zur Beschreibung maschinen-

verarbeitbarer Semantik von Daten

• erlaubt Assoziation einfacher Semantik mit verwendeten Elementen

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

16

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Aussage(Statement)

Objekt(Ressource)

Eigenschaften(Properties)

Wertzuweisungen(Ressource / Literal)

URI

Page 32: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

17

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Resource Description Framework - RDF• Ressourcen:

Dinge/Objekte, die über eine URI adressiert werden können

• Properties:Attribute/Eigenschaften zur Beschreibung der Ressource

• Statements (RDF-Tripel):Ressource + Property + zugehöriger Wert

T(s,p,o)

Page 33: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

18

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Bestandteile des RDF-Graphen• URI:

• Zur eindeutigen Referenzierung von Ressourcen

• Literale:

• beschreiben Datenwerte, denen keine separate Existenz zukommt

• Zeichenketten, Interpretation erfolgt durch Datentyp

• Leere Knoten:

• Erlauben Existenzaussagen über ein Individuum mit gewissen Eigenschaften, ohne dieses zu benennen

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

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

S

P

O

Page 34: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

19

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF Darstellungsvarianten• Knoten-Kante-Knoten Tripel:

• Notation3 (N3):

• Direkte Auflistung der Tripel

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

•Turtle (Terse RDF Triple Language):

• Erweiterung von N3

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

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

S

P

O

Page 35: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatBlog> <http://sewe0910.blogspot.com/>.

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatTelefonNr> “+331-5509-527“.

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

20

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF Darstellungsvarianten• Turtle (Terse RDF Triple Language):

• Erweiterung von N3

• URIs in spitzen Klammern

• Literale in Anführungszeichen

• Tripel durch Punkt abgeschlossen

• Leerzeichen und Zeilenumbrüche außerhalb von Bezeichnern werden ignoriert

• Ganz einfaches Beispiel:

Page 36: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatBlog> <http://sewe0910.blogspot.com/>.

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatTelefonNr> “+331-5509-527“.

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

20

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF Darstellungsvarianten• Turtle (Terse RDF Triple Language):

• Erweiterung von N3

• URIs in spitzen Klammern

• Literale in Anführungszeichen

• Tripel durch Punkt abgeschlossen

• Leerzeichen und Zeilenumbrüche außerhalb von Bezeichnern werden ignoriert

• Ganz einfaches Beispiel:

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatBlog> <http://sewe0910.blogspot.com/>.

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatTelefonNr> “+331-5509-527“.

Page 37: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatBlog> <http://sewe0910.blogspot.com/>.

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatTelefonNr> “+331-5509-527“.

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

20

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF Darstellungsvarianten• Turtle (Terse RDF Triple Language):

• Erweiterung von N3

• URIs in spitzen Klammern

• Literale in Anführungszeichen

• Tripel durch Punkt abgeschlossen

• Leerzeichen und Zeilenumbrüche außerhalb von Bezeichnern werden ignoriert

• Ganz einfaches Beispiel:

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatBlog> <http://sewe0910.blogspot.com/>.

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatTelefonNr> “+331-5509-527“.

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatBlog> <http://sewe0910.blogspot.com/>.

<http://hpi-web.de/HaraldSack> <http://hpi-web.de/Personal#hatTelefonNr> “+331-5509-527“ .

Page 38: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

21

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF Darstellungsvarianten• Turtle (Terse RDF Triple Language):

• komplexeres Beispiel:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@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)" ; ex:editor [ ex:fullname "Dave Beckett"; ex:homePage <http://purl.org/net/dajobe/> ] .

Page 39: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

22

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF Darstellungsvarianten• XML-Serialisierung:

• am weitesten verbreitet, beste Tool-Unterstützung

• Beispiel:

<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:hatTelefonNr>+331-5509-527</pers:hatTelefonNr> <rdf:Description>

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

Page 40: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

23

RDF Darstellungsvarianten• XML-Serialisierung:

hatTelefonNr. +331-5509-527

http://hpi-web.de/HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

<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:hatTelefonNr>+331-5509-527</pers:hatTelefonNr> <rdf:Description>

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

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Ressource

Page 41: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

24

RDF Darstellungsvarianten• XML-Serialisierung:

hatTelefonNr. +331-5509-527

http://hpi-web.de/HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

<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:hatTelefonNr>+331-5509-527</pers:hatTelefonNr> <rdf:Description>

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

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Ressource

Page 42: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

25

RDF Darstellungsvarianten• XML-Serialisierung:

hatTelefonNr. +331-5509-527

http://hpi-web.de/HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

<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:hatTelefonNr>+331-5509-527</pers:hatTelefonNr> <rdf:Description>

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

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Ressource

Page 43: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

26

RDF Darstellungsvarianten• XML-Serialisierung:

hatTelefonNr. +331-5509-527

http://hpi-web.de/HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

<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:hatTelefonNr=“+331-5509-527“> <pers:hatBlog rdf:resource=http://sewe0910.blogspot.com/“/> </rdf:Description></rdf:RDF>

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Ressource

Page 44: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

27RDF Darstellungsvarianten• XML-Serialisierung:

• Abgekürzte Schreibweisen:

• Ein Subjekt-Element kann mehrere Property-Elemente enthalten

• Darstellung von Literalen als XML-Attribute(pers:hatTelefonNr=“...“)

•Attribut-Name wird dabei Property-URI

• Objekt-Element (Ressource) kann als rdf:resource Attribut im Property-Element angegeben werden(rdf:resource=“http://...“)

• Objekt-Elemente können als Subjekt für ein weiteres RDF-Tripel dienen

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Page 45: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

28

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

XML-Serialisierung• Basis-URIs:

<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#“ xml:base=“http://hpi-web.de/“>

<rdf:Description rdf:about=“HaraldSack“ pers:hatTelefonNr=“+331-5509-527“> <pers:hatBlog rdf:resource=“http://sewe0910.blogspot.com/“/>

</rdf:Description></rdf:RDF>

hatTelefonNr. +331-5509-527

http://hpi-web.de/HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

Ressource

Page 46: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

28

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

XML-Serialisierung• Basis-URIs:

<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#“ xml:base=“http://hpi-web.de/“>

<rdf:Description rdf:about=“HaraldSack“ pers:hatTelefonNr=“+331-5509-527“> <pers:hatBlog rdf:resource=“http://sewe0910.blogspot.com/“/>

</rdf:Description></rdf:RDF>

hatTelefonNr. +331-5509-527

http://hpi-web.de/HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

Ressource

Syntactic Sugar!

Page 47: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

29

RDF Darstellungsvarianten• Turtle

hatTelefonNr. +331-5509-527

http://hpi-web.de/HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix pers: <http://hpi-web.de/Personal#> .@base <http://hpi-web.de/>

<HaraldSack> pers:hatTelefonNr “+331-5509-527“ .<HaraldSack> pers:hatBlog <http://sewe0910.blogspot.com/> .

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Ressource

Page 48: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

29

RDF Darstellungsvarianten• Turtle

hatTelefonNr. +331-5509-527

http://hpi-web.de/HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix pers: <http://hpi-web.de/Personal#> .@base <http://hpi-web.de/>

<HaraldSack> pers:hatTelefonNr “+331-5509-527“ .<HaraldSack> pers:hatBlog <http://sewe0910.blogspot.com/> .

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Ressource

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix pers: <http://hpi-web.de/Personal#> .@base <http://hpi-web.de/>

<HaraldSack> pers:hatTelefonNr “+331-5509-527“ ; pers:hatBlog <http://sewe0910.blogspot.com/> .

Abgekürzte Schreibweise

Page 49: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

30

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF - Ressourcen• Fragment-Identifier

<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#“ xml:base=“http://hpi-web.de/Dozenten#“

<rdf:Description rdf:ID=“HaraldSack“ pers:hatTelefonNr=“+331-5509-527“> <pers:hatBlog rdf:resource=“http://sewe0910.blogspot.com/“/>

</rdf:Description></rdf:RDF>

hatTelefonNr. +331-5509-527

http://hpi-web.de/Dozenten#HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

Ressource

Datei http://hpi-web.de/Dozenten.rdf

Page 50: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

30

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF - Ressourcen• Fragment-Identifier

<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#“ xml:base=“http://hpi-web.de/Dozenten#“

<rdf:Description rdf:ID=“HaraldSack“ pers:hatTelefonNr=“+331-5509-527“> <pers:hatBlog rdf:resource=“http://sewe0910.blogspot.com/“/>

</rdf:Description></rdf:RDF>

hatTelefonNr. +331-5509-527

http://hpi-web.de/Dozenten#HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

Ressource

Datei http://hpi-web.de/Dozenten.rdf

Page 51: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

31

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF - Ressourcen• Fragment-Identifier in Turtle

hatTelefonNr. +331-5509-527

http://hpi-web.de/Dozenten#HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

Ressource

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix pers: <http://hpi-web.de/Personal#> .

:HaraldSack pers:hatTelefonNr “+331-5509-527“ ; pers:hatBlog <http://sewe0910.blogspot.com/> .

Datei http://hpi-web.de/Dozenten.rdf

Page 52: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

31

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF - Ressourcen• Fragment-Identifier in Turtle

hatTelefonNr. +331-5509-527

http://hpi-web.de/Dozenten#HaraldSack

http://sewe0910.blogspot.com/hatBlog

Ressource

Literal

Ressource

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix pers: <http://hpi-web.de/Personal#> .

:HaraldSack pers:hatTelefonNr “+331-5509-527“ ; pers:hatBlog <http://sewe0910.blogspot.com/> .

Datei http://hpi-web.de/Dozenten.rdf

Page 53: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

32

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Datentypen in RDF

2http://hpi-web.de/LehrVeranstaltung#SWS

http://hpi-web.de/LehrVeranstaltung#Name

http://hpi-web.de/ws0910#semanticweb

Semantic Web

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

<rdf:Description rdf:about=“http://hpi-web.de/ws0910#semanticweb“> <lv:Name rdf:datatype=“http://www.w3c.org/2001/XMLSchema#string“> Semantic Web </lv:Name> <lv:SWS rdf:datatype= “http://www.w3c.org/2001/XMLSchema#integer“> 2 </lv:SWS> </rdf:Description></rdf:RDF>

Page 54: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

33

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Datentypen in RDF

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix lv: <http://hpi-web.de/LehrVeranstaltung#> .

<http://hpi.web.de/ws0910#semanticweb> lv:Name “Semantic Web“^^xsd:string ; lv:SWS “2“^^xsd:integer .

2http://hpi-web.de/LehrVeranstaltung#SWS

http://hpi-web.de/LehrVeranstaltung#Name

http://hpi-web.de/ws0910#semanticweb

Semantic Web

Page 55: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

33

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Datentypen in RDF

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix lv: <http://hpi-web.de/LehrVeranstaltung#> .

<http://hpi.web.de/ws0910#semanticweb> lv:Name “Semantic Web“^^xsd:string ; lv:SWS “2“^^xsd:integer .@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

@prefix lv: <http://hpi-web.de/LehrVeranstaltung#> .

<http://hpi.web.de/ws0910#semanticweb> lv:Name “Semantic Web“; lv:SWS 2 .

Abgekürzte Schreibweise

2http://hpi-web.de/LehrVeranstaltung#SWS

http://hpi-web.de/LehrVeranstaltung#Name

http://hpi-web.de/ws0910#semanticweb

Semantic Web

Page 56: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

34 Mehrwertige Beziehungen und Leere Knoten• Beispiel:

• Eine Lehrveranstaltung findet zwei mal die Woche in zwei unterschiedlichen Räumen statt

• Wie soll man dies mit RDF modellieren?

Semantic Web

HS 2

http://hpi-web.de/LehrVeranstaltung#Raum

http://hpi-web.de/LehrVeranstaltung#SWS

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 57: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

34 Mehrwertige Beziehungen und Leere Knoten• Beispiel:

• Eine Lehrveranstaltung findet zwei mal die Woche in zwei unterschiedlichen Räumen statt

• Wie soll man dies mit RDF modellieren?

A 2.1

http://hpi-web.de/LehrVeranstaltung#Raum

Do, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

Semantic Web

HS 2

http://hpi-web.de/LehrVeranstaltung#Raum

http://hpi-web.de/LehrVeranstaltung#SWS

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 58: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

34 Mehrwertige Beziehungen und Leere Knoten• Beispiel:

• Eine Lehrveranstaltung findet zwei mal die Woche in zwei unterschiedlichen Räumen statt

• Wie soll man dies mit RDF modellieren?

A 2.1

http://hpi-web.de/LehrVeranstaltung#Raum

Do, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

Semantic Web

HS 2

http://hpi-web.de/LehrVeranstaltung#Raum

http://hpi-web.de/LehrVeranstaltung#SWS

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

Problem: keine eindeutige Zuordnung

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 59: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

35 Mehrwertige Beziehungen und Leere Knoten• Beispiel:

• Eine Lehrveranstaltung findet zwei mal die Woche in zwei unterschiedlichen Räumen statt

Semantic Webhttp://hpi-web.de/LehrVeranstaltung#SWS

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 60: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

35 Mehrwertige Beziehungen und Leere Knoten• Beispiel:

• Eine Lehrveranstaltung findet zwei mal die Woche in zwei unterschiedlichen Räumen statt

Semantic Webhttp://hpi-web.de/LehrVeranstaltung#SWS

A 2.1

http://hpi-web.de/LehrVeranstaltung#Raum

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

http://hpi-web.de/LehrVeranstaltung#hatTermin

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 61: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

35 Mehrwertige Beziehungen und Leere Knoten• Beispiel:

• Eine Lehrveranstaltung findet zwei mal die Woche in zwei unterschiedlichen Räumen statt

Semantic Webhttp://hpi-web.de/LehrVeranstaltung#SWS

http://hpi-web.de/LehrVeranstaltung#Raum

Do, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

HS 2

http://hpi-web.de/LehrVeranstaltung#hatTermin A 2.1

http://hpi-web.de/LehrVeranstaltung#Raum

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

http://hpi-web.de/LehrVeranstaltung#hatTermin

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 62: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

36 Leere Knoten• Leere Knoten (Blank Nodes, Bnodes) können eingeführt werden, um

mehrwertige Beziehungen darstellen zu können

• Leere Knoten können für Ressourcen eingeführt werden, die nicht benannt werden müssen (Hilfsknoten)

A 2.1

http://hpi-web.de/LehrVeranstaltung#Raum

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

http://hpi-web.de/LehrVeranstaltung#hatTermin

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 63: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

37 Leere Knoten• Anonyme leere Knoten

A 2.1

http://hpi-web.de/LehrVeranstaltung#Raum

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

http://hpi-web.de/LehrVeranstaltung#hatTermin

<rdf:Description rdf:about=“http://hpi-web.de/ws0910#semanticweb“> <lv:hatTermin rdf:parseType=“Resource“/> <lv:Termin>Di, 13.30-15.00</lv:Termin> <lv:Raum>A 2.1</lv:Raum> </lv:hatTermin> </rdf:Description>

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 64: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

38 Leere Knoten• Anonyme leere Knoten - Turtle Syntax

A 2.1

http://hpi-web.de/LehrVeranstaltung#Raum

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

http://hpi-web.de/LehrVeranstaltung#hatTermin

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix lv: <http://hpi-web.de/LehrVeranstaltung#> .

<http://hpi-web.de/ws0910#semanticweb> lv:hatTermin [ lv:Termin “Di, 13.30-15.00“; lv:Raum “A 2.1“ ] .

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 65: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

39 Leere Knoten• Dereferenzierbare leere Knoten

A 2.1

http://hpi-web.de/LehrVeranstaltung#Raum

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

http://hpi-web.de/LehrVeranstaltung#hatTermin

<rdf:Description rdf:about=“http://hpi-web.de/ws0910#semanticweb“> <lv:hatTermin rdf:nodeID=“ID1“/> <rdf:Description>

<rdf:Description rdf:nodeID=“ID1“> <lv:Termin>Di, 13.30-15.00</lv:Termin> <lv:Raum>A 2.1<li:Raum> </rdf:Description></rdf:RDF>

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

ID1

Leerer Knoten wird innerhalb des Dokuments dereferenzierbar als ID1

http://hpi-web.de/ws0910#semanticweb

Page 66: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

40 Leere Knoten• Dereferenzierbare leere Knoten - Turtle Syntax

A 2.1

http://hpi-web.de/LehrVeranstaltung#Raum

Di, 13.30-15.00

http://hpi-web.de/LehrVeranstaltung#Termin

http://hpi-web.de/LehrVeranstaltung#hatTermin

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

ID1

Leerer Knoten wird im Dokument dereferenzierbar als _:ID1

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix lv: <http://hpi-web.de/LehrVeranstaltung#> .

<http://hpi-web.de/ws0910#semanticweb> lv:hatTermin _:ID1 .

_:ID1 lv:Termin “Di, 13.30-15.00“; lv:Raum “A 2.1“ .

http://hpi-web.de/ws0910#semanticweb

Page 67: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

41 Listen• Allgemeine Datenstrukturen zur Aufzählung von beliebigen Ressourcen

und Literalen

• Dienen lediglich einer verkürzten Schreibweise (keine zusätzliche semantische Ausdruckskraft)

• Unterscheide

• Container offene Listen, d.h. Hinzufügen neuer Einträge möglich

• Collectionsgeschlossene Listen, d.h. Hinzufügen neuer Einträge nicht möglich

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Page 68: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

42 RDF-Container

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

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

http://hpi-web.de/LehrVeranstaltung#Teilnehmer

http://hpi-web.de/SchmidtJoseph

http://hpi-web.de/SchulzeEgon

http://hpi-web.de/MuellerFranz

http://hpi-web.de/BurgerAntonhttp://www.w3.org/1999/02/22-rdf-syntax-ns#_1

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

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

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

<rdf:Description rdf:about=“http://hpi-web.de/ws0910#semanticweb“> <lv:Teilnehmer> <rdf:Seq> <rdf:li rdf:resource=“http://hpi-web.de/BurgerAnton“ /> <rdf:li rdf:resource=“http://hpi-web.de/MuellerFranz“ /> <rdf:li rdf:resource=“http://hpi-web.de/SchmidtJoseph“ /> <rdf:li rdf:resource=“http://hpi-web.de/SchulzeEgon“ /> </rdf:Seq> </lv:Teilnehmer> </rdf:Description>

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

Page 69: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

43 RDF-Container•via rdf:Type wird dem Wurzelknoten des Containers ein bestimmter

Container-Typ zugewiesen

• rdf:Bagungeordnete Zusammenfassung von Einzelelementen,Reihenfolge ist ohne Bedeutung

• rdf:Seqgeordnete Zusammenfassung von Einzelelementen,Reihenfolge ist von Bedeutung

• rdf:Altdefiniert Auswahl zwischen verschiedenen Einzelelementen,nur ein Element der Auswahl ist für die vorgesehene Anwendung relevant

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Page 70: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

44 RDF-Container in Turtle

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

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

http://hpi-web.de/LehrVeranstaltung#Teilnehmer

http://hpi-web.de/SchmidtJoseph

http://hpi-web.de/SchulzeEgon

http://hpi-web.de/MuellerFranz

http://hpi-web.de/BurgerAntonhttp://www.w3.org/1999/02/22-rdf-syntax-ns#_1

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

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

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

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix lv: <http://hpi-web.de/LehrVeranstaltung#> .@base <http://hpi-web.de/>

<http://hpi-web.de/ws0910#semanticweb> lv:Teilnehmer [ a rdf:Seq; rdf:_1 <BurgerAnton>; rdf:_2 <MuellerFranz>; rdf:_3 <SchmidtJoseph>; rdf:_4 <SchulzeEgon> . ] .

http://hpi-web.de/ws0910#semanticweb

Page 71: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

45 RDF-Collection

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

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

http://hpi-web.de/LehrVeranstaltung#Teilnehmer

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

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

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

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

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

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

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

Rekursive Zerlegung der Liste in Kopfelement und (ev. leere) Restliste.

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/SchmidtJoseph

http://hpi-web.de/SchulzeEgon

http://hpi-web.de/MuellerFranz

http://hpi-web.de/BurgerAnton

http://hpi-web.de/ws0910#semanticweb

Page 72: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

46 RDF-Collection

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<rdf:Description rdf:about=“http://hpi-web.de/ws0910#semanticweb“> <lv:Teilnehmer rdf:parseType=“Collection“> <rdf:Description rdf:about=“http://hpi-web.de/BurgerAnton“ /> <rdf:Description rdf:about=“http://hpi-web.de/MuellerFranz“ /> <rdf:Description rdf:about=“http://hpi-web.de/SchmidtJoseph“ /> <rdf:Description rdf:rabout=“http://hpi-web.de/SchulzeEgon“ /> </lv:Teilnehmer> </rdf:Description>

Page 73: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

47 RDF-Collection - Turtle

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix lv: <http://hpi-web.de/LehrVeranstaltung#> .@base <http://hpi-web.de/>

<http://hpi-web.de/ws0910#semanticweb> lv:Teilnehmer [ rdf:first <BurgerAnton>; rdf:rest [ rdf:first <MuellerFranz>; rdf:rest [ rdf:first <SchmidtJoseph>; rdf:rest [ rdf:first <SchulzeEgon>; rdf:rest rdf:nil .] ] ] ] .

Page 74: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

48 RDF-Collection - Turtle

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix lv: <http://hpi-web.de/LehrVeranstaltung#> .@base <http://hpi-web.de/>

<http://hpi-web.de/ws0910#semanticweb> lv:Teilnehmer ( <BurgerAnton> <MuellerFranz> <SchmidtJoseph> <SchulzeEgon>) .

Page 75: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

49

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF-Reification• RDF erlaubt die Schachtelung von Statements, d.h. Statements über

Statements zu machen

• Bsp.:

• Sherlock Holmes vermutet, dass der Gärtner den Butler ermordet hat•Teil 1: Der Gärtner hat den Butler ermordet

•Teil 2: Sherlock Holmes hat eine Vermutung

<rdf:Description rdf:about=“http://example.org/Gaertner“> <exv:hatErmordet rdf:resource=“http://example.org/Butler“ /> </rdf:Description>

<rdf:Description rdf:about=“http://example.org/SherlockHolmes“> <exv:hatVermutung> ...???... </exv:hatVermutung></rdf:Description>

Page 76: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

50

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF-Reification• rdf:Statement

definiert eine RDF-Aussage (Statement), bestehend aus Subjekt, Prädikat und Objekt

• rdf:subject - die beschriebene Ressource

• rdf:predicate - das originale Property

• rdf:object - der Wert des Properties in der Aussage

<rdf:Description rdf:about=“http://example.org/StatementOnGaertner“> <rdf:subject rdf:resource=“http://example.org/Gaertner“ /> <rdf:predicate rdf:resource=“http://example.org/Verbrechen#hatErmordet“ /> <rdf:object rdf:resource=“http://example.org/Butler“ /> <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" /></rdf:Description>

Page 77: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

RDF-Reification

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

51

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<rdf:Description rdf:about=“http://example.org/StatementOnGaertner“> <rdf:subject rdf:resource=“http://example.org/Gaertner“ /> <rdf:predicate rdf:resource=“http://example.org/Verbrechen#hatErmordet“ /> <rdf:object rdf:resource=“http://example.org/Butler“ /> <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" /></rdf:Description>

<rdf:Description rdf:about=“http://example.org/SherlockHolmes“> <exv:hatVermutung rdf:resource=“http://example.org/StatementOnGaertner“ /> </rdf:Description>

SherlockHolmes

exv:hatVermutung

StatementOnGaertner

Gaertner

exv:hatErmordet

Butler

rdf:subject

rdf:predicate

rdf:object

Page 78: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

52

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF-Reification - Turtle

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@exv <http://example.org/Verbrechen#>

<SherlockHolmes> exv:hatVermutung <StatementOnGaertner> .<StatementOnGaertner> a rdf:Statement ; rdf:subject <Gaertner> ; rdf:predicate exv:hatErmordet ; rdf:object <Butler> .

SherlockHolmes

exv:hatVermutung

StatementOnGaertner

Gaertner

exv:hatErmordet

Butler

rdf:subject

rdf:predicate

rdf:object

Page 79: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

53

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF-Reification• Ist Reification wirklich notwendig?

• Möglichkeit, um Zuverlässigkeit (Vertrauen, Trust) zu formalisieren

• Möglichkeit, um Metadaten über Aussagen (Assertions, Statements) zu definieren

• In der Wissensrepräsentation (Ontologie-Erstellung):

• Umwandlung von Relationen in Ontologieklassen

Page 80: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

54 RDF - ein etwas komplizierteres Beispiel

Telefonnr.++49 (3641) 9-46316

betreutLehrveranstaltung betreut

Lehrveranstaltung

OrtUmfang(SWS)

Harald SackName

Name Umfang(SWS)

NameOrt

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://hpi-web.de/ws0910#semanticweb

http://hpi-web.de/HaraldSack

http://hpi-web.de/ws0910#linkeddata

Semantic Web Linked DataEngineeringHS 2 A 2.12 2

Page 81: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

55

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<?xml version="1.0" encoding="utf-8"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:hpi="http://hpi-web.de/WS0910“>

<rdf:Description rdf:about="http://hpi-web.de/HaraldSack“> <hpi:name>Dr. Harald Sack </hpi:name> <hpi:telefonnr>+331-5509-527</hpi:telefonnr> <hpi:betreutLehrveranstaltung rdf:resource=“#semanticweb“ /> <hpi:betreutLehrveranstaltung rdf:resource=“#linkeddata“ /></rdf:Description>

<rdf:Description rdf:ID=“#semanticweb> <rdf:type rdf:ID="http://hpi-web.de/Lehrveranstaltung“ /> <hpi:LehrveranstaltungName>Semantic Web</hpi:LehrveranstaltungName> <hpi:LehrveranstaltungOrt>HS 3</hpi:LehrveranstaltungOrt> <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Description>

<rdf:Description rdf:ID=“#linkeddata"> <rdf:type rdf:ID="http://hpi-web.de/Lehrveranstaltung“ /> <hpi:LehrveranstaltungName>Linked Data Engineering</hpi:LehrveranstaltungName> <hpi:LehrveranstaltungOrt>A 2.1</hpi:LehrveranstaltungOrt> <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Description>

</rdf:RDF>Datei http://hpi-web.de/ws0910.rdf

Page 82: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

56

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<?xml version="1.0" encoding="utf-8"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:hpi="http://hpi-web.de/WS0910“>

<rdf:Description rdf:about="http://hpi-web.de/HaraldSack“> <hpi:name>Dr. Harald Sack </hpi:name> <hpi:telefonnr>+331-5509-527</hpi:telefonnr> <hpi:betreutLehrveranstaltung rdf:resource=“#semanticweb“ /> <hpi:betreutLehrveranstaltung rdf:resource=“#linkeddata“ /></rdf:Description>

<rdf:Description rdf:ID=“#semanticweb> <rdf:type rdf:ID="http://hpi-web.de/Lehrveranstaltung“ /> <hpi:LehrveranstaltungName>Semantic Web</hpi:LehrveranstaltungName> <hpi:LehrveranstaltungOrt>HS 3</hpi:LehrveranstaltungOrt> <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Description>

<rdf:Description rdf:ID=“#linkeddata"> <rdf:type rdf:ID="http://hpi-web.de/Lehrveranstaltung“ /> <hpi:LehrveranstaltungName>Linked Data Engineering</hpi:LehrveranstaltungName> <hpi:LehrveranstaltungOrt>A 2.1</hpi:LehrveranstaltungOrt> <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Description>

</rdf:RDF>Datei http://hpi-web.de/ws0910.rdf

RDF Abkürzungsmöglichkeiten (revisited):

(1)kinderlose Property-Elemente könnendurch XML-Attribute ersetzt werden

(2) rdf:Description-Elemente mit Typisierungkönnen durch das in rdf:type angegebeneElement ersetzt werden

Page 83: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

57

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<?xml version="1.0" encoding="utf-8"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:hpi="http://hpi-web.de/WS0910“>

<rdf:Description rdf:about="http://hpi-web.de/HaraldSack“ hpi:name=“Dr. Harald Sack“ hpi:telefonnr=“+331-5509-527“> <hpi:betreutLehrveranstaltung rdf:resource=“#semanticweb“ /> <hpi:betreutLehrveranstaltung rdf:resource= “#linkeddata“ /></rdf:Description>

<rdf:Description rdf:ID=“#semanticweb> <rdf:type rdf:ID="http://hpi-web.de/Lehrveranstaltung“ /> <hpi:LehrveranstaltungName>Semantic Web</hpi:LehrveranstaltungName> <hpi:LehrveranstaltungOrt>HS 3</hpi:LehrveranstaltungOrt> <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Description>

<rdf:Description rdf:ID=“#linkeddata"> <rdf:type rdf:ID="http://hpi-web.de/Lehrveranstaltung“ /> <hpi:LehrveranstaltungName>Linked Data Engineering</hpi:LehrveranstaltungName> <hpi:LehrveranstaltungOrt>A 2.1</hpi:LehrveranstaltungOrt> <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Description>

</rdf:RDF>Datei http://hpi-web.de/ws0910.rdf

Page 84: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

58

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<?xml version="1.0" encoding="utf-8"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:hpi="http://hpi-web.de/WS0910“>

<rdf:Description rdf:about="http://hpi-web.de/HaraldSack“ hpi:name=“Dr. Harald Sack“ hpi:telefonnr=“+331-5509-527“> <hpi:betreutLehrveranstaltung rdf:resource=“#semanticweb“ /> <hpi:betreutLehrveranstaltung rdf:resource= “#linkeddata“ /></rdf:Description>

<rdf:Description rdf:ID=“#semanticweb> <rdf:type rdf:ID="http://hpi-web.de/Lehrveranstaltung“ /> <hpi:LehrveranstaltungName>Semantic Web</hpi:LehrveranstaltungName> <hpi:LehrveranstaltungOrt>HS 3</hpi:LehrveranstaltungOrt> <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Description>

<rdf:Description rdf:ID=“#linkeddata"> <rdf:type rdf:ID="http://hpi-web.de/Lehrveranstaltung“ /> <hpi:LehrveranstaltungName>Linked Data Engineering</hpi:LehrveranstaltungName> <hpi:LehrveranstaltungOrt>A 2.1</hpi:LehrveranstaltungOrt> <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Description>

</rdf:RDF>Datei http://hpi-web.de/ws0910.rdf

RDF Abkürzungsmöglichkeiten (revisited):

(1)kinderlose Property-Elemente könnendurch XML-Attribute ersetzt werden

(2) rdf:Description-Elemente mit Typisierungkönnen durch das in rdf:type angegebeneElement ersetzt werden

Page 85: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

59

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

<?xml version="1.0" encoding="utf-8"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:hpi="http://hpi-web.de/WS0910“>

<rdf:Description rdf:about="http://hpi-web.de/HaraldSack“ hpi:name=“Dr. Harald Sack“ hpi:telefonnr=“+331-5509-527“> <hpi:betreutLehrveranstaltung rdf:resource=“#semanticweb“ /> <hpi:betreutLehrveranstaltung rdf:resource= “#linkeddata“ /></rdf:Description>

<hpi:Lehrveranstaltung rdf:ID=“#semanticweb“ hpi:LehrveranstaltungName=“Semantic Web“ hpi:LehrveranstaltungOrt=“HS 3“ > <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Lehrveranstaltung>

<hpi:Lehrveranstaltung rdf:ID=“#linkeddata" hpi:LehrveranstaltungName=“Linked Data Engineering“ hpi:LehrveranstaltungOrt=“A 2.1“ > <hpi:LehrveranstaltungUmfang rdf:datatype="&xsd;integer">2</hpi:LehrveranstaltungUmfang></rdf:Lehrveranstaltung>

</rdf:RDF>

Datei http://hpi-web.de/ws0910.rdf

Page 86: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

60

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF Charakteristika - Zusammenfassung• Unabhängigkeit:

da eine Property eine Ressource ist, kann jeder seine eigenen erfinden

• Austauschbarkeit da RDF auf XML basiert, kann es leicht kommuniziert werden

• Skalierbarkeitda ein Statement nur aus den drei Teilen (Ressource, Property, Wert) besteht, können diese in großen Mengen maschinell verarbeitet werden

• Properties sind Ressourcenda Properties selbst wieder Ressourcen sind, können sie eigene Properties haben und diese können per RDF automatisch verarbeitet werden

• Werte können Resourcen seinda Werte selbst wieder Ressourcen sein können, können sie auch wieder eigene Properties haben

• Statements können Ressourcen seinda Statements selbst wieder Ressourcen sein können, können sie auch wieder eigene Properties haben

Page 87: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

61

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF und Datenintegration• Einfaches Beispiel: Bibliografie-Datenbank

ID Autor Titel Verlag Jahr

ISBN 0-00-651409-X HS-123 WWW S-001 2004

ID Name Homepage

HS-123 Harald Sack http://hpi-web.de/HaraldSack.html

ID Verlagname Ort

S-001 Springer Heidelberg

Page 88: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

62 RDF und Datenintegration• Export der Datenbank in eine einfache Menge von Relationen

http://.../isbn/000651409X

a:autor

Harald Sack

http://hpi-web.de/HaraldSack.htmla:homepage

a:name

Springer

Heidelberga:verlag

a:v_name

a:v_ort

WWW-…

2004

a:titel

a:jahr

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Page 89: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

63 RDF und Datenintegration• Export der Datenbank in eine einfache Menge von Relationen

http://.../isbn/000651409X

a:autor

Harald Sack

http://hpi-web.de/HaraldSack.htmla:homepage

a:name

Springer

Heidelberga:verlag

a:v_name

a:v_ort

WWW-…

2004

a:titel

a:jahr

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://.../isbn/000651409X

Harald Sack

u:author

u:name

http://.../a-very-important-paper

u:cites

Web 2.0

u:title

Page 90: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

64 RDF und Datenintegration• Export der Datenbank in eine einfache Menge von Relationen

http://.../isbn/000651409X

a:autor

Harald Sack

http://hpi-web.de/HaraldSack.htmla:homepage

a:name

Springer

Heidelberga:verlag

a:v_name

a:v_ort

WWW-…

2004

a:titel

a:jahr

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://.../isbn/000651409X

Harald Sack

u:author

u:name

http://.../a-very-important-paper

u:cites

Web 2.0

u:title

Page 91: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

64 RDF und Datenintegration• Export der Datenbank in eine einfache Menge von Relationen

http://.../isbn/000651409X

a:autor

Harald Sack

http://hpi-web.de/HaraldSack.htmla:homepage

a:name

Springer

Heidelberga:verlag

a:v_name

a:v_ort

WWW-…

2004

a:titel

a:jahr

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

http://.../isbn/000651409X

Harald Sack

u:author

u:name

http://.../a-very-important-paper

u:cites

Web 2.0

u:title

gleiche URI = gleiche Ressource

Page 92: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

65 RDF und Datenintegration• Export der Datenbank in eine einfache Menge von Relationen

http://.../isbn/000651409X

a:autor

Harald Sack

http://hpi-web.de/HaraldSack.htmla:homepage

a:name

Springer

Heidelberga:verlag

a:v_name

a:v_ort

WWW-…

2004

a:titel

a:jahr

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Harald Sack

u:author

u:name

http://.../a-very-important-paper

u:cites

Web 2.0

u:title

Page 93: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

RDF-Modell -- Zusammenfassung• Ein RDF-Model ist eine Menge von Statements

• Statement := (subject, predicate, object)

• Predicate ist eine Ressource

• Subject ist eine Ressource

• Object ist entweder Ressource oder Literal

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

66

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Page 94: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

Bewertung von RDF• Weitläufig unterstützter Standard (W3C Recommendation) für

Datenarchivierung und Datenaustausch

• RDF-Tools

• RDF APIs (Jena, Redland, ...)

• RDF Stores / Triple-Stores (Virtuoso, Sesame, Oracle...)

• Grundlage für RSS 1.0, XMP (Adobe), SVG, ...

• Ermöglicht weitgehend syntaxunabhängige Darstellung verteilter Informationen in einem graphbasierten Datenmodell

• RDF bietet keine Möglichkeit zur Kodierung von Schemawissen...

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

67

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Page 95: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

68

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

RDF Vocabulary Description Language

= RDFS

Page 96: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

Semantic Web Architektur69

URI / IRI

XML / XSDData Interchange: RDF

RDFS

Ontology: OWL Rule: RIF

Query:SPARQL

Proof

Unifying Logic

Cry

pto

Trust

Interface & Application

2. Semantic Web Basisarchitektur

Page 97: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

703.11.2009 – Vorlesung Nr. 31 2 4 5 6 7 8 9 1110 12

13

2. Semantic Web BasisarchitekturDie Sprachen des Semantic Web - Teil 1

2.1.Uniform Resource Identifier - URI

2.2.XML und XMLSchema

2.3.Resource Description Framework - RDF

2.4.RDF Schema

2.5.Wie kommt die Semantik ins WWW?

2.6.Abfragesprache SPARQL

2.7.Warum reicht RDF(S) noch nicht aus?

14

Semantic Web - Vorlesungsinhalt

Page 98: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

71

Literatur

»P. Hitzler, M. Krötzsch, S. Rudolph, Y. Sure Semantic Web Grundlagen, Springer, 2008.

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF

Page 99: 03.11.2009, 03-Resource Description Framework (RDF), Vorlesung Semantic Web

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

72

Literatur

□Bloghttp://sewe0910.blogspot.com/

□Materialien-Webseitehttp://www.hpi.uni-potsdam.de/meinel/teaching/semantic_web_ws0910.html

□bibsonomy - Bookmarkshttp://www.bibsonomy.org/user/lysander07/sw0910_03

2. Semantic Web Basisarchitektur2.3 Resource Description Framework - RDF