Graph Pattern Semantik Michael Schmidt, 06.05.2008 1.

Slides:



Advertisements
Ähnliche Präsentationen
Rekursion: Rekurrenz: Algorithmen rufen sich selbst (rekursiv) auf.
Advertisements

Inhalt Saarbrücken,.
Algebraische Zahlen: Exaktes Rechnen mit Wurzeln
Einführung in die Informatik: Programmierung und Software-Entwicklung
Zusammenfassung der Vorwoche
B-Bäume.
Modelle und Methoden der Linearen und Nichtlinearen Optimierung (Ausgewählte Methoden und Fallstudien) U N I V E R S I T Ä T H A M B U R G November 2012.
Grammatiken, Definitionen
Verifizieren versus Berechnen
Terminierung und Deadlocks Enkhbat Daginaa Betreuerin Prof. Heike Wehrheim Totale Korrektheit.
Design by Contract with JML - Teil 2
Objektrelationales Mapping mit JPA Entity Mapping Jonas Bandi Simon Martinelli.
Standortfaktoren INTERN - Ausdrucksstark präsentieren.
Kapitel 4 Syntaktische Analyse: LR Parsing.
Der Einstieg in das Programmieren
Algorithmentheorie 04 –Hashing
WS Algorithmentheorie 13 - Kürzeste (billigste) Wege Prof. Dr. Th. Ottmann.
Geometrisches Divide and Conquer
Welcome DTD. Document Type Definition Graphic Services/Everything you already know about presentations Was ist eine DTD? DTD ist eine Schemasprache.
Fakten, Regeln und Anfragen
Friedhelm Meyer auf der Heide 1 HEINZ NIXDORF INSTITUTE University of Paderborn Algorithms and Complexity Algorithmen und Komplexität Teil 1: Grundlegende.
PKJ 2005/1 Stefan Dissmann Zusammenfassung Bisher im Kurs erarbeitete Konzepte(1): Umgang mit einfachen Datentypen Umgang mit Feldern Umgang mit Referenzen.
PG 520 Intelligence Service – gezielte Informationen aus dem Internet
Kapitel 19 Astronomie Autor: Bennett et al. Unsere Galaxis, die Milchstraße Kapitel 19 Unsere Galaxis, die Milchstraße © Pearson Studium 2010 Folie: 1.
Wir suchen ‘ mit m = m    ‘ c  ‘ mod 26
Normalformen Normalisieren Schlüssel
6 Normalformen Normalisieren Schlüssel
Ralf KüstersDagstuhl 2008/11/30 2 Ralf KüstersDagstuhl 2008/11/30 3.
1 XQuery Informationssysteme, Vortragender: Michael Schmidt.
20:00.
PowerPoint.
Passive Angriffe ... nicht-invasiv.
Einführung in die Programmierung Wintersemester 2010/11 Prof. Dr. Günter Rudolph Lehrstuhl für Algorithm Engineering Fakultät für Informatik TU Dortmund.
Funktionen Johannes-Kepler-Gymnasium Plenum Funktionen
...ich seh´es kommen !.
Information und Kommunikation Hartmut Klauck Universität Frankfurt SS
Beweissysteme Hartmut Klauck Universität Frankfurt WS 06/
Information und Kommunikation
Polynome und schnelle Fourier-Transformation
Entity Mapping Persistente Domänenmodelle mit JPA 2.0 und Bean Validation.
Advanced Mapping Persistente Domänenmodelle mit JPA 2.0 und Bean Validation.
Präsentation läuft auch vollautomatisch ab … wie du möchtest
Auslegung eines Vorschubantriebes
F-Sharp (F#) Eine multiparadigmatische Sprache. Merkmale von F# Multiparadigmatisch.NET-Sprache Skalierbar und effizient Als Forschungsprojekt von Microsoft.
WEKA MEDIA GmbH & Co. KG Technische Hilfeleistung ENDE HILFE Folien p.de.
HORIZONT 1 XINFO ® Das IT - Informationssystem PL/1 Scanner HORIZONT Software für Rechenzentren Garmischer Str. 8 D München Tel ++49(0)89 / 540.
Erläuterung der wichtigsten Befehle
ADAT©2004 Dipl. - Ing. Walter SabinSeite: 1 Version 1.0a Einführung in Reguläre Ausdrücke.
Relationentheorie AIFB SS Relationen in 1NF und relationale Datenbanken(1/5) Attribut a Wertebereichdom(a) (domain) AttributemengeA = {a 1,...,
Das IT - Informationssystem
Das Bernoulli-Prinzip
CuP - Java Vierte Vorlesung Entspricht ungefähr Kapitel 2.1 des Skriptums Montag, 14. Oktober 2002.
Analyseprodukte numerischer Modelle
2014 Januar 2014 So Mo Di Mi Do Fr Sa So
Marti – Partner – Finanzblog - SchmiedruedFinanzblog.

Foto: Stephan Marti - FinanzblogFinanzblog Fernwärme.
Schutzvermerk nach DIN 34 beachten 20/05/14 Seite 1 Grundlagen XSoft Lösung :Logische Grundschaltung IEC-Grundlagen und logische Verknüpfungen.
Pflanzenlernkartei 3 Autor: Rudolf Arnold. Pflanze 1 Gattung Merkmale Schädigung Bekämpfung.
Pflanzenlernkartei 2 Autor: Rudolf Arnold. Pflanze 1 Gattung Merkmale Schädigung Bekämpfung.
Foto: Stephan Marti - FinanzblogFinanzblog Fernwärme.
Implementierung eines RDF Stores
Der Erotik Kalender 2005.
1 Tagesüberblick 4 Lösung Hausaufgabe/Fragen Mustervergleiche.
Analyse der Laufzeit von Algorithmen
TEST. 2 SK / Ressort Regeltechnik Täter Gegenspieler Zuschauer Mitspieler.
1 Tagesüberblick 5 Lösung Hausaufgabe/Fragen Assoziative Felder Funktionen zu Variablenbehandlung.
Monatsbericht Ausgleichsenergiemarkt Gas – Oktober
WS 2014/15 Datenbanksysteme D0 15:15 – 16:45 R Vorlesung #6 SQL (Teil 3)
Kleines 1x1 ABCD Aufgaben Kleines 1x1 A · 8 = Lösung.
 Präsentation transkript:

Graph Pattern Semantik Michael Schmidt,

RDF Formalisierung 3 disjunkte Mengen URIs (U) Blank Nodes (B) Literale (L) Wir schreiben UB für die Vereinigung von U und B usw. RDF Tripel (s,p,o) UB x U x UBL RDF Datenbank: Menge von Tripeln 2

Basic Graph Patterns Unendliche Menge von Variablen V Basic Graph Pattern (t 1, t 2, t 3 ) UV x UV x ULV Beispiele für Basic Graph Patterns (?person, rdf:type, foaf:Person) (lx:Person1, ?y, ?z) (?x,?y,?z) (lx:Person1, foaf:name, Linus Torvalds) 3

Filter-Bedingungen Atomare Filter-Bedingungen (A op B), where A ULV B ULV op { =,>} Filter-Bedingungen Verknüpfung von atomaren Filter-Bedingungen durch Operatoren && (and), || (or), or ! (not) Beispiele: Atomar: (?a = test), (?a < ?b) Zusammengesetzt: ((?a = a) && !(?b < ?c)) 4

Allgemeine Graph Patterns Rekursive Definition Ein Basic Graph Pattern ist ein Graph Pattern Wenn G 1 und G 2 Graph Patterns sind, dann auch G 1 UNION G 2 Wenn G 1 und G 2 Graph Patterns sind, dann auch G 1 AND G 2 Wenn G 1 und G 2 Graph Pattern sind, dann auch G 1 OPTIONAL G 2 Wenn G ein Graph Pattern ist, und R eine (ggf. atomare) Filter-Bedingung, dann ist auch G FILTER R ein Graph Pattern 5

Mappings zur Ergebnisrepräsentation Graph Patterns werden auf RDF Dokumenten ausgewertet Darstellung einer möglichen Lösung als Mapping von Variablen im Graph Pattern zu Elementen im Eingabegraphen Mapping ist eine partielle Funktion μ : V UBL 6

Beispiel: Mapping ?person ms:Person1 ?name Bill Gates ?type foaf:Person μ myns:salary 7

Mappings Domäne eines Mappings Menge der Variablen, für die die Abbildung definiert ist Für das Mapping oben: dom(μ)={?person,?name,?type} ?person ms:Person1 ?name Bill Gates ?type foaf:Person μ 8

Mapping: Kompatibilität Zwei Mappings μ 1, μ 2 kompatibel, wenn für alle x dom(μ 1 ) dom(μ 2 ): μ 1 (x)=μ 2 (x) ?person ms:Person1 ?name Bill Gates ?type foaf:Person ?person ms:Person1 ?name Bill Gates ?salary μ1μ1 μ2μ2 dom(μ 1 )={?person,?name,?type) dom(μ 2 )={?person,?name,?salary) dom(μ 1 ) dom(μ 2 )={?person,?name) μ 1 (?person) = μ 2 (?person) = ms:Person1 μ 1 (?name) = μ 2 (?name) = Bill Gates 9 kompatibel

Mapping: Kompatibilität ?person lx:Person1 μ2μ2 ?person ms:Person1 ?name Bill Gates ?type foaf:Person μ1μ1 dom(μ 1 )={?person,?name,?type) dom(μ 2 )={?person) dom(μ 1 ) dom(μ 2 )={?person) μ 1 (?person) = ms:Person1 μ 2 (?person) = lx:Person1 Zwei Mappings μ 1, μ 2 kompatibel, wenn für alle x dom(μ 1 ) dom(μ 2 ): μ 1 (x)=μ 2 (x) 10 nicht kompatibel

Auswertung von Graph Patterns Ergebnis: Menge von Mappings Beispiel: (?x,rdf:type,foaf:Person) ?x ms:Person1 μ1μ1 ?x lx:Person1 μ2μ2 Ergebnis S={μ 1, μ 2 } 11

Auswertung von Graph Patterns Ergebnis: Menge von Mappings Beispiel: (?x,rdf:type,foaf:Person) ?x ms:Person1 μ1μ1 ?x lx:Person1 μ2μ2 S={{?x -> ms:Person1}, {?x -> lx:Person1}} 12

Operationen auf Mapping-Mengen UNION JOIN SETMINUS LEFTJOIN 13

UNION von Mapping-Mengen {{?a -> x}, {?a -> x, ?b -> y}} {{?a -> x}, {?b -> y}} = {{?a -> x}, {?a -> x, ?b -> y}, {?b -> y}} UNION Beispiel 14

JOIN von Mapping-Mengen JOIN {{?a -> w}, {?a -> x, ?b -> y}} {{?a -> y}, {?b -> y, ?c -> z}} = {{?a -> w, ?b -> y, ?c -> z}, {?a -> x, ?b -> y, ?c -> z}} Beispiel 15

MINUS von Mapping-Mengen SETMINUS {{?a -> w}, {?a -> x, ?b -> y}} \ {{?a -> y}, {?a -> x, ?b -> y, ?c -> z}} = {{?a -> w}} Beispiel 16

LEFTJOIN von Mapping-Mengen LEFTJOIN {{?a -> w}, {?a -> x, ?b -> y}} {{?a -> y}, {?a -> x, ?b -> y, ?c -> z}} = ({{?a -> w}, {?a -> x, ?b -> y}} {{?a -> y}, {?a -> x, ?b -> y, ?c -> z}}) ({{?a -> w}, {?a -> x, ?b -> y}} \ {{?a -> y}, {?a -> x, ?b -> y, ?c -> z}}) = {{?a -> x, ?b -> y, ?c -> z}} {{?a -> w}} = {{?a -> x, ?b -> y, ?c -> z}}, {{?a -> w}} Beispiel 17

Graph Pattern Semantik Definiert mit Hilfe der vorher diskutierten Operatoren Basic Graph Pattern t, Graph Patterns P i, Dokument D μ(t) := ersetze Variablen in t nach μ 18

Beispiel Graph Pattern Semantik D={ (ms:Person1,rdf:type,foaf:Person), (ms:Person1,foaf:name,Bill Gates), (ms:Person1,foaf:knows,lx:Person1), (ms:Person1,myns:salary,_:salary1), (_:salary1,rdf:value, ), (_:salary1,myns:unit,US Dollar), (lx:Person1,rdf:type,foaf:Person), (lx:Person1,foaf:knows,ms:Person1) (lx:Person1,foaf:name,Linus Torvalds), (lx:Person1,foaf:knows,lx:Person2) } ((?person,rdf:type,foaf:Person) AND (?person,foaf:name,?name)) OPTIONAL ((?person,myns:salary,?s1) AND (?s1,rdf:value,?s2)) Dokument Graph Pattern 19

Ergebnis und Ergebnisdarstellung ((?person,rdf:type,foaf:Person) AND (?person,foaf:name,?name)) OPTIONAL ((?person,myns:salary,?s1) AND (?sal1,rdf:value,?s2)) Graph Pattern P [[P]] D ={{?person -> ms:Person1, ?name -> Bill Gates, ?s1 -> _:salary1, ?s2 -> }, {?person -> lx:Person1, ?name -> Linus Thorvals}} Ergebnis ?person?name?s1?s2 ms:Person1Bill Gates_:salary lx:Person1Linus Thorvals Ergebnis in tabellarischer Form 20

Ergebniscodierung in Implementierung Ausgabe in tabellarischer Form in CSV-Format Zeile 1: Variablennamen in beliebiger Reihenfolge, durch Kommata getrennt Folgende Zeilen: Ergebnistupel in beliebiger Reihenfolge ?name;?person;?s1;?s2 Linus Thorvals;lx:Person1;; Bill Gates;ms:Person1;_:salary1; Mögliche Programmausgabe 21

Erfülltheit von Filter-Bedingungen Sei R eine Filter-Bedingung. μ erfüllt Bedingung R (μ |= R), wenn Sei R eine Filter-Bedingung. μ erfüllt Bedingung R (μ |= R), wenn Analog zum zweiten Fall: =, > 22

Semantik von Filter-Bedingungen Erhalte Mappings, die Bedingung erfüllen P FILTER (?person = lx:Person1) Graph Pattern P FILTER R [[P]] D ={{?person -> ms:Person1, ?name -> Bill Gates, ?s1 -> _:salary1, ?s2 -> }, {?person -> lx:Person1, ?name -> Linus Thorvals}} P FILTER (?person = ms:Person1) = {{?person -> lx:Person1, ?name -> Linus Thorvals}} Ergebnis 23

Implementierung Einlesen von Graph Patterns aus Datei GraphPattern ::= SimpleGraphPattern | ComposedGraphPattern | FilterGraphPattern SimpleGraphPattern ::= ( Subject, Predicate, Object ) ComposedGraphPattern ::= SimpleGraphPattern Operator SimpleGraphPattern FilterGraphPattern ::= SimpleGraphPattern FILTER FilterCondition Subject ::= URI | Variable Predicate ::= URI | Variable Object ::= URI | Literal | Variable FilterCondition ::= FilterSubexp FilterOperator FilterSubexp FilterSubExp ::= URI | Literal | Variable Operator ::= AND | UNION | OPTIONAL FilterOperator ::= | >=, wobei URI eine URI ist (möglicherweise in Prefix-Notation), Literal ein String in Anführungszeichen, und Variable eine Variable der Form ?[a-zA-Z]+ (z.B. ?name, ?x, ?abcD) 24

Aufgaben Berechne auf dem Datensatz D (Folie 19): (a) [[(?person1,foaf:knows,?person2) AND (?person2,foaf:knows,?person1]] D (b) [[(?person1,rdf:type,foaf:Person) OPTIONAL ((?person1,foaf:knows,?person2) AND (?person2,myns:salary,?sal1) AND (?sal1,rdf:value,?sal2))]] D Was berechnen die Anfragen (in Worten)? 25