tmql tutorial - part 2

49
Einführung in Topic Maps topicmapslab.de Topic Maps Query Language Sven Krosse M. Sc. Topic Maps Lab an der Universität Leipzig [email protected] Session 2

Upload: lutz-maicher

Post on 19-May-2015

909 views

Category:

Technology


2 download

DESCRIPTION

In this second part of TMQL tutorials you learn some more basics of the standards: the navigation concept part 2 and the TMQL 2010 draft. All slides are in German.

TRANSCRIPT

Page 1: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de

Topic Maps Query Language

Sven Krosse M. Sc.

Topic Maps Lab an der Universität Leipzig

[email protected]

Session 2

Page 2: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de

Agenda

1. Navigationskonzept II

2. Path-Language – Draft 2010 ( kurzer Einblick )

Page 3: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de

SprachbestandteileNavigationskonzept

Page 4: TMQL tutorial - part 2

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 )

Page 5: TMQL tutorial - part 2

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 ]

Page 6: TMQL tutorial - part 2

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

Page 7: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de7

Achse - indicators

http://en.wikipedia.org/wiki/Puccini >> indicators

“http://en.wikipedia.org/wiki/Puccini” << indicators

Page 8: TMQL tutorial - part 2

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

Page 9: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de9

Achse - locators

http://en.wikipedia.org/wiki/Puccini >> locators

“http://en.wikipedia.org/wiki/Puccini” << locators

Page 10: TMQL tutorial - part 2

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

Page 11: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de11

Achse - item

http://en.wikipedia.org/wiki/Puccini >> item

“http://en.wikipedia.org/wiki/Puccini” << item

Page 12: TMQL tutorial - part 2

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

Page 13: TMQL tutorial - part 2

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

Page 14: TMQL tutorial - part 2

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

Page 15: TMQL tutorial - part 2

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

Page 16: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de16

TMQL – Typhierarchie

e1

A

B CD

E F G

e2 g1 g2

Page 17: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de17

e1

A

B CD

E F G

e2 g1 g2

TMQL – Typhierarchie

TMQL-Query: e1 >> types

Page 18: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de18

e1

A

B CD

E F G

e2 g1 g2

TMQL – Typhierarchie

TMQL-Query: E >> supertypes

Page 19: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de19

e1

A

B CD

E F G

e2 g1 g2

TMQL – Typhierarchie

TMQL-Query: A >> instances

Page 20: TMQL tutorial - part 2

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

Page 21: TMQL tutorial - part 2

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

Page 22: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de22

e1

Name 1

Name 2

t

g

Occurrence 1

Occurrence 2

t

g

TMQL – characteristics axis

Page 23: TMQL tutorial - part 2

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

Page 24: TMQL tutorial - part 2

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

Page 25: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de25

Achse - atomify

http://en.wikipedia.org/wiki/Puccini >> characteristics >> atomify

“Puccini” << atomify << characteristics

Page 26: TMQL tutorial - part 2

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

Page 27: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de27

Achse - players

http://en.wikipedia.org/wiki/Puccini << players

http://psi.ontopia.net/music/composed-by >> players

Page 28: TMQL tutorial - part 2

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

Page 29: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de29

Achse - roles

http://psi.ontopia.net/literature/work << roles

http://psi.ontopia.net/music/composed-by >> roles

Page 30: TMQL tutorial - part 2

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

Page 31: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de31

Achse - traverse

http://en.wikipedia.org/wiki/Puccini >> traverse

http://psi.ontopia.net/music/composed-by << traverse

Page 32: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de32

r1 a1

p1 p3p2

r2 r3 r4a2

TMQL – association axes

Page 33: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de33

TMQL – association axes

TMQL-Query: p2 << players >> roles [ . >> players == p2 ]

r1 a1

p1 p3p2

r2 r3 r4a2

Page 34: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de34

r1 a1

p1 p3p2

r2 r3 r4a2

TMQL – association axes

TMQL-Query: a1 >> players

Page 35: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de35

r1 a1

p1 p3p2

r2 r3 r4a2

TMQL – association axes

TMQL-Query: p2 >> traverse

Page 36: TMQL tutorial - part 2

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

Page 37: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de37

Achse - scope

http://psi.ontopia.net/opera/web << scope

http://psi.ontopia.net/music/composed-by >> scope

Page 38: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de38

Achse - reifier

● kein optionaler Typ

● vorwärts: der Reifier des Konstrukts

● rückwärts: das reifizierte Element

Page 39: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de39

Achse - reifier

http://psi.ontopia.net/opera/web << reifier

http://psi.ontopia.net/music/composed-by >> reifier

Page 40: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de

SprachbestandteileDraft 2010

Page 41: TMQL tutorial - part 2

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)

Page 42: TMQL tutorial - part 2

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 ')'

Page 43: TMQL tutorial - part 2

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

Page 44: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de44

Draft 2010

● Assoziationsachsen

role, player

● Eigenschaften

name, occurrence, variant, value, datatype

● Topic-Map-Achsen

topic, association

Page 45: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de45

Draft 2010

● Sonstige Achsen

parent, scope, reifier

Page 46: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de46

Draft 2010

● Beispiel

/ topic::composer / composed-by ( composer -> work )

Page 47: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de47

Draft 2010

● Beispiel

/ topic::composer / composed-by ( composer -> work )

alle Topics vom Typ composer

Page 48: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de48

Draft 2010

● Beispiel

/ topic::composer / composed-by ( composer -> work )

alle Rollenspieler

Page 49: TMQL tutorial - part 2

Einführung in Topic Maps

topicmapslab.de

ENDE