tmql tutorial - part 2
Post on 19-May-2015
909 Views
Preview:
DESCRIPTION
TRANSCRIPT
Einführung in Topic Maps
topicmapslab.de
Topic Maps Query Language
Sven Krosse M. Sc.
Topic Maps Lab an der Universität Leipzig
krosse@informatik.uni-leipzig.de
Session 2
Einführung in Topic Maps
topicmapslab.de
Agenda
1. Navigationskonzept II
2. Path-Language – Draft 2010 ( kurzer Einblick )
Einführung in Topic Maps
topicmapslab.de
SprachbestandteileNavigationskonzept
Einführung in Topic Maps
topicmapslab.de4
Navigationskonzept
● basiert auf dem Proxy-Konzept des TMRM
● Modell der Topic Map als abstrakter bidirektionaler Graph
● Definition von 12 Achsen ( +2 NCL )
Einführung in Topic Maps
topicmapslab.de5
Navigationskonzept - Syntax
DIRECTION ::= '<<' | '>>'
AXIS-NAME ::= 'item' | 'indicators' | 'locators' | 'traverse' |
'players' | 'roles' | 'types' | 'reifier' | 'atomify' |
'characteristics' | 'supertypes' | 'scope'
STEP ::= DIRECTION AXIS-NAME [ TOPIC-REF ]
Einführung in Topic Maps
topicmapslab.de6
Achse - indicators
● keine optionalen Typen
● vorwärts: alle Subject-Identifier eines Topics
● rückwärts: Adressierung eines Topics mittels Subject-Identifier
Einführung in Topic Maps
topicmapslab.de7
Achse - indicators
http://en.wikipedia.org/wiki/Puccini >> indicators
“http://en.wikipedia.org/wiki/Puccini” << indicators
Einführung in Topic Maps
topicmapslab.de8
Achse - locators
● keine optionalen Typen
● vorwärts: alle Subject-Locator eines Topics
● rückwärts: Adressierung eines Topics mittels Subject-Locator
Einführung in Topic Maps
topicmapslab.de9
Achse - locators
http://en.wikipedia.org/wiki/Puccini >> locators
“http://en.wikipedia.org/wiki/Puccini” << locators
Einführung in Topic Maps
topicmapslab.de10
Achse - item
● keine optionalen Typen
● ohne Pluralisierung!
→ items
● vorwärts: alle Item-Identifier eines Topics
● rückwärts: Adressierung eines Topics mittels Item-Identifier
Einführung in Topic Maps
topicmapslab.de11
Achse - item
http://en.wikipedia.org/wiki/Puccini >> item
“http://en.wikipedia.org/wiki/Puccini” << item
Einführung in Topic Maps
topicmapslab.de12
Achse - types
● keine optionalen Typen
● vorwärts: alle Typen eines Topics oder der Typ eines Topic Maps
Konstruktes
● rückwärts: alle Instanzen eines Topic Typs
● NCL: instances – Achse
● vorwärts: alle Instanzen eines Topics Typs
● rückwärts: alle Typen einer Topics oder der Typ eines Topic
Maps Konstruktes
Einführung in Topic Maps
topicmapslab.de13
Achse - types
http://en.wikipedia.org/wiki/Puccini >> types
http://psi.ontopia.net/music/composer << types
http://en.wikipedia.org/wiki/Puccini << instances
http://psi.ontopia.net/music/composer >> instances
Einführung in Topic Maps
topicmapslab.de14
Achse - supertypes
● keine optionalen Typen
● vorwärts: alle Super-Typen eines Topic Typs
● rückwärts: alle Sub-Typen eines Topic Typs
● NCL: subtypes – Achse
● vorwärts: alle Sub-Typen eines Topic Typs
● rückwärts: alle Super-Typen eines Topic Typs
Einführung in Topic Maps
topicmapslab.de15
Achse - supertypes
http://psi.ontopia.net/music/composer >> supertypes
http://psi.ontopia.net/music/musician << supertypes
http://psi.ontopia.net/music/composer << subtypes
http://psi.ontopia.net/music/musician >> subtypes
Einführung in Topic Maps
topicmapslab.de16
TMQL – Typhierarchie
e1
A
B CD
E F G
e2 g1 g2
Einführung in Topic Maps
topicmapslab.de17
e1
A
B CD
E F G
e2 g1 g2
TMQL – Typhierarchie
TMQL-Query: e1 >> types
Einführung in Topic Maps
topicmapslab.de18
e1
A
B CD
E F G
e2 g1 g2
TMQL – Typhierarchie
TMQL-Query: E >> supertypes
Einführung in Topic Maps
topicmapslab.de19
e1
A
B CD
E F G
e2 g1 g2
TMQL – Typhierarchie
TMQL-Query: A >> instances
Einführung in Topic Maps
topicmapslab.de20
Achse - characteristics
● vorwärts: alle Eigenschaften eines Topics
● rückwärts: das Topic mit der Eigenschaft
● vordefinierte Typen
● alle Name tm:name
● alle Occurrences tm:occurrence
Einführung in Topic Maps
topicmapslab.de21
Achse - characteristics
http://en.wikipedia.org/wiki/Puccini >> characteristics
http://en.wikipedia.org/wiki/Puccini >> characteristics tm:name
http://en.wikipedia.org/wiki/Puccini >> characteristics tm:occurrence
Einführung in Topic Maps
topicmapslab.de22
e1
Name 1
Name 2
t
g
Occurrence 1
Occurrence 2
t
g
TMQL – characteristics axis
Einführung in Topic Maps
topicmapslab.de23
e1
Name 1
Name 2
t
g
Occurrence 1
Occurrence 2
t
g
TMQL – characteristics axis
TMQL-Query: e1 >> characteristics g
Einführung in Topic Maps
topicmapslab.de24
Achse - atomify
● vorwärts: Literal des konkreten Objektes
● unterstützt Names, Occurrences und Locators
● rückwärts: Locator, Name oder Occurrence mit dem Literal
● Mehrdeutigkeit möglich
Einführung in Topic Maps
topicmapslab.de25
Achse - atomify
http://en.wikipedia.org/wiki/Puccini >> characteristics >> atomify
“Puccini” << atomify << characteristics
Einführung in Topic Maps
topicmapslab.de26
Achse - players
● vorwärts: alle Spieler einer Assoziation
● auch von Topic Typ einer Assoziation aus
● optionaler Typ = Rollentyp
● rückwärts: alle Assoziation mit dem Spieler
● optionaler Typ = Rollentyp
Einführung in Topic Maps
topicmapslab.de27
Achse - players
http://en.wikipedia.org/wiki/Puccini << players
http://psi.ontopia.net/music/composed-by >> players
Einführung in Topic Maps
topicmapslab.de28
Achse - roles
● vorwärts: alle Rollentypen einer Assoziation
● auch von Topic Typ einer Assoziation aus
● rückwärts: alle Assoziation mit dem Rollentyp
● optionaler Typ = Assoziationstyp
Einführung in Topic Maps
topicmapslab.de29
Achse - roles
http://psi.ontopia.net/literature/work << roles
http://psi.ontopia.net/music/composed-by >> roles
Einführung in Topic Maps
topicmapslab.de30
Achse - traverse
● vorwärts: alle verketteten Spieler
● Verkettung über eine Assoziation zwischen zwei Topics
● optionaler Typ = Assoziationstyp
● rückwärts: alle verketteten Assoziation
● Verkettung über gemeinsamen Spieler
● optionaler Typ = Typ des Spielers
Einführung in Topic Maps
topicmapslab.de31
Achse - traverse
http://en.wikipedia.org/wiki/Puccini >> traverse
http://psi.ontopia.net/music/composed-by << traverse
Einführung in Topic Maps
topicmapslab.de32
r1 a1
p1 p3p2
r2 r3 r4a2
TMQL – association axes
Einführung in Topic Maps
topicmapslab.de33
TMQL – association axes
TMQL-Query: p2 << players >> roles [ . >> players == p2 ]
r1 a1
p1 p3p2
r2 r3 r4a2
Einführung in Topic Maps
topicmapslab.de34
r1 a1
p1 p3p2
r2 r3 r4a2
TMQL – association axes
TMQL-Query: a1 >> players
Einführung in Topic Maps
topicmapslab.de35
r1 a1
p1 p3p2
r2 r3 r4a2
TMQL – association axes
TMQL-Query: p2 >> traverse
Einführung in Topic Maps
topicmapslab.de36
Achse - scope
● kein optionaler Typ
● vorwärts: alle Themes eines Konstrukts
● rückwärts: alle Konstrukte im Scope mit der Theme
Einführung in Topic Maps
topicmapslab.de37
Achse - scope
http://psi.ontopia.net/opera/web << scope
http://psi.ontopia.net/music/composed-by >> scope
Einführung in Topic Maps
topicmapslab.de38
Achse - reifier
● kein optionaler Typ
● vorwärts: der Reifier des Konstrukts
● rückwärts: das reifizierte Element
Einführung in Topic Maps
topicmapslab.de39
Achse - reifier
http://psi.ontopia.net/opera/web << reifier
http://psi.ontopia.net/music/composed-by >> reifier
Einführung in Topic Maps
topicmapslab.de
SprachbestandteileDraft 2010
Einführung in Topic Maps
topicmapslab.de41
Draft 2010
● nur Path-Expression
● Änderungen
● ähnliches Navigationskonzept mit veränderter Syntax
● Achsenrichtung entfernt
● zusätzliche Achsen
● Entfernen einiger Achsen
● Syntax noch näher an XPath
● Standardachsen für jeden Konstrukt-Typ (Achsen optional)
Einführung in Topic Maps
topicmapslab.de42
Draft 2010
● Syntax
pathstep → '/' pathspec filter *
pathspec → axis '::' anyref | axis '::' | anyref | assocpattern
filter → boolfilter | scopefilter
assocpattern → anyref '(' anyref '->' anyref ')'
Einführung in Topic Maps
topicmapslab.de43
Draft 2010
● Typ-Instanz-Achsen
type, direct-type, instance, direct-instance
● Supertyp-Subtyp-Achsen
supertype, direct-supertype, subtype, direct-subtype
● Identifier-Achsen
subject-identifier, subject-locator, item-identifier
Einführung in Topic Maps
topicmapslab.de44
Draft 2010
● Assoziationsachsen
role, player
● Eigenschaften
name, occurrence, variant, value, datatype
● Topic-Map-Achsen
topic, association
Einführung in Topic Maps
topicmapslab.de45
Draft 2010
● Sonstige Achsen
parent, scope, reifier
Einführung in Topic Maps
topicmapslab.de46
Draft 2010
● Beispiel
/ topic::composer / composed-by ( composer -> work )
Einführung in Topic Maps
topicmapslab.de47
Draft 2010
● Beispiel
/ topic::composer / composed-by ( composer -> work )
alle Topics vom Typ composer
Einführung in Topic Maps
topicmapslab.de48
Draft 2010
● Beispiel
/ topic::composer / composed-by ( composer -> work )
alle Rollenspieler
Einführung in Topic Maps
topicmapslab.de
ENDE
top related