ctm - the compact topic map notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf ·...

31
CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps Lab Natural Language Processing Group Department of Computer Science University of Leipzig 03.12.2009 / TMRA09 Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 1/20

Upload: others

Post on 20-Sep-2019

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

CTM - The Compact Topic Map Notation

Dipl.-Inf. Hannes Niederhausen

Topic Maps LabNatural Language Processing Group

Department of Computer ScienceUniversity of Leipzig

03.12.2009 / TMRA09

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 1/20

Page 2: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Outline

Einf[Pleaseinsertintopreamble]hrung

Kommentare in CTM

Deklarationen in CTM

Topics in CTM

Associationen in CTM

Templates in CTM

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 2/20

Page 3: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Einführung I

I Standard Serialisierung XTM2 XML basiert ⇒ sehr aufgebläht

I Standardisierung einer kompakteren Notation: Compact Topic Maps(CTM)) ISO 13250-6

I Standardisierung noch nicht beendet

I Syntax ist aber stabil

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 3/20

Page 4: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Einführung II

XTM Beispiel<?xml version="1.0" encoding="utf-8" standalone="yes"?><topicMap xmlns="http://www.topicmaps.org/xtm/" version="2.0">

<topic id="id-2"><subjectIdentifierhref="http://exampel.topicmapslab.de/vorlesung/lutz-maicher"/>

<name><value>Lutz Maicher</value>

</name></topic>

</topicMap>

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 4/20

Page 5: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

CTM Beispiel%prefix vl <http://exampel.topicmapslab.de/vorlesung/>vl:lutz-maicher

- "Lutz Maicher".

CTM Beispielhttp://exampel.topicmapslab.de/vorlesung/lutz-maicher

- "Lutz Maicher".

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 5/20

Page 6: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

CTM Bestandteile

I Deklarationen

I Topicblöcke

I Assoziationen

I Template-Deklarationen und -Aufrufe

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 6/20

Page 7: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Kommentare in CTM

I CTM unterstützt einzeilige ung mehrzeilige Kommentare

I Einzeilige beginnen mit # enden am Zeilenende

I Mehrzelige Kommentare sind eingebettet in: #( und )#

Beispiel für Kommentare# Ein einzeiliger Kommentar#( Dieser Kommentar gehtüber mehrere Zeilen, weil ich michnicht kurz fassen kann.)#

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 7/20

Page 8: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Kommentare in CTM

I CTM unterstützt einzeilige ung mehrzeilige Kommentare

I Einzeilige beginnen mit # enden am Zeilenende

I Mehrzelige Kommentare sind eingebettet in: #( und )#

Beispiel für Kommentare# Ein einzeiliger Kommentar#( Dieser Kommentar gehtüber mehrere Zeilen, weil ich michnicht kurz fassen kann.)#

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 7/20

Page 9: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Deklarationen in CTM I

I %include - läd eine Topic Map

I Topic Map Serialisierung wird angegeben mittels IRI. Die angegebeneDatei muss eine CTM Datei sein.

Beispiel für include-Deklaration%include http://www.topicmaps.org/tmcl/templates.ctm

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 8/20

Page 10: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Deklarationen in CTM I

I %include - läd eine Topic Map

I Topic Map Serialisierung wird angegeben mittels IRI. Die angegebeneDatei muss eine CTM Datei sein.

Beispiel für include-Deklaration%include http://www.topicmaps.org/tmcl/templates.ctm

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 8/20

Page 11: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Deklarationen in CTM II

I %mergemap - merged eine Topic Map

I Ähnlich %include nur kann angegebene Datei auch andere TMSerialisierung sein

I Serialisierungstyp muss angegeben werden, wenn es sich nicht um CTMhandelt

Beispiel für mergemap-Deklaration%mergemap http://www.externamaps.org/example.ctm CTM%mergemap http://www.externamaps.org/example.xtm XTM%mergemap http://www.externamaps.org/example.ctm

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 9/20

Page 12: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Deklarationen in CTM II

I %mergemap - merged eine Topic Map

I Ähnlich %include nur kann angegebene Datei auch andere TMSerialisierung sein

I Serialisierungstyp muss angegeben werden, wenn es sich nicht um CTMhandelt

Beispiel für mergemap-Deklaration%mergemap http://www.externamaps.org/example.ctm CTM%mergemap http://www.externamaps.org/example.xtm XTM%mergemap http://www.externamaps.org/example.ctm

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 9/20

Page 13: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Deklarationen in CTM III

I %prefix - spezifiziert einen Präfix für Identifikatoren

I Verhält sich ähnlich XML namespace

Beispiel für prefix-Deklaration%prefix vl http://exampel.topicmapslab.de/vorlesung/

vl:person . # == http://exampel.topicmapslab.de/vorlesung/person

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 10/20

Page 14: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Deklarationen in CTM III

I %prefix - spezifiziert einen Präfix für Identifikatoren

I Verhält sich ähnlich XML namespace

Beispiel für prefix-Deklaration%prefix vl http://exampel.topicmapslab.de/vorlesung/

vl:person . # == http://exampel.topicmapslab.de/vorlesung/person

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 10/20

Page 15: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IIdentifikatoren I

I Topicblöcke beginnen mit einem Identifikator

I Identifikatoren sind IRI

I Unterscheidung des Identifikatortyps mittels voranstehenden Zeichens:

subject identifier= subject locator∧ item identifier

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 11/20

Page 16: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IIdentifikatoren II

Einfache Topicdeklaration mit subject identifierlutz-maicher isa person .

Einfache Topicdeklaration mit item identifier∧lutz-maicher isa person .

Einfache Topicdeklaration mit subject locator=http://wikipedia.org isa website .

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 12/20

Page 17: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IIdentifikatoren II

Einfache Topicdeklaration mit subject identifierlutz-maicher isa person .

Einfache Topicdeklaration mit item identifier∧lutz-maicher isa person .

Einfache Topicdeklaration mit subject locator=http://wikipedia.org isa website .

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 12/20

Page 18: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IIdentifikatoren II

Einfache Topicdeklaration mit subject identifierlutz-maicher isa person .

Einfache Topicdeklaration mit item identifier∧lutz-maicher isa person .

Einfache Topicdeklaration mit subject locator=http://wikipedia.org isa website .

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 12/20

Page 19: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IINamen I

I Namen beginnen mit -

I Darauf folgt, falls benutzt, ein Identifikator eines Namentypen

I Nach einem Doppelpunkt der Inhalt des Namen in Anführungszeichen

I Optional folgt: Scope (beginnt mit @) und Reifier (beginnt mit ~)

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 13/20

Page 20: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IINamen II

Topic mit Namenlutz-maicher isa person;

- “Lutz Maicher” .

Topic mit typisierten Namenlutz-maicher isa person;

- official-name: “Dr. Lutz Maicher” .

Topic mit Namen und Scopelutz-maicher isa person;

- “Lutz Maicher”;- “Maicher, Lutz” @sort;

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 14/20

Page 21: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IINamen II

Topic mit Namenlutz-maicher isa person;

- “Lutz Maicher” .

Topic mit typisierten Namenlutz-maicher isa person;

- official-name: “Dr. Lutz Maicher” .

Topic mit Namen und Scopelutz-maicher isa person;

- “Lutz Maicher”;- “Maicher, Lutz” @sort;

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 14/20

Page 22: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IINamen II

Topic mit Namenlutz-maicher isa person;

- “Lutz Maicher” .

Topic mit typisierten Namenlutz-maicher isa person;

- official-name: “Dr. Lutz Maicher” .

Topic mit Namen und Scopelutz-maicher isa person;

- “Lutz Maicher”;- “Maicher, Lutz” @sort;

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 14/20

Page 23: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IIIOccurrences I

I Occurrrences beginnen mit dem Typ der Belegstelle

I Darauf folgt der Wert; Strings in Anführungszeichen

I Optional: Scope (beginnt mit @) und Reifier (beginnt mit ~)

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 15/20

Page 24: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IIIOccurrences II

Topic mit Occurrence mit typ "‘age"’uni-leipzig isa organisation;

age: 600 .

Topic mit Occurrence mit Scopelutz-maicher isa person;

room: “0-05” @work;phone: “+49-341-97-32303” .

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 16/20

Page 25: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Topics in CTM IIIOccurrences II

Topic mit Occurrence mit typ "‘age"’uni-leipzig isa organisation;

age: 600 .

Topic mit Occurrence mit Scopelutz-maicher isa person;

room: “0-05” @work;phone: “+49-341-97-32303” .

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 16/20

Page 26: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Associationen in CTM

I Associations werden außerhalb von Topicblöcken definiert

I Optional: Scope (beginnt mit @) und Reifier (beginnt mit ~)

Association in CTMworks-for(employer: uni-leipzig, employee: lutz-maicher)hn isa person;

- "Hannes Niederhausen".lives-in(place: leipzig, habitant: hn) @year2009,year2008 ~ address

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 17/20

Page 27: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Templates in CTM

I Templates dienen zur Kapselung von Befehlen

I Haben optional Parameter, sind nicht getypt

I Können innerhalb von Topicblöcken eingebunden werden ⇒ die Topic isterster Parameter im Template

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 18/20

Page 28: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Templates in CTM II

Template Definitiondef works($person, $employer)

works-for(employer: $employer, employee: $person)end

Template Ausführung außerhalb eines Topicblockesworks(lutz-maicher, uni-leipzig)

Template Ausführung außerhalb eines Topicblockeslutz-maicher isa person;

works(uni-leipzig);room: "0-05" @work.

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 19/20

Page 29: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Templates in CTM II

Template Definitiondef works($person, $employer)

works-for(employer: $employer, employee: $person)end

Template Ausführung außerhalb eines Topicblockesworks(lutz-maicher, uni-leipzig)

Template Ausführung außerhalb eines Topicblockeslutz-maicher isa person;

works(uni-leipzig);room: "0-05" @work.

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 19/20

Page 30: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Templates in CTM II

Template Definitiondef works($person, $employer)

works-for(employer: $employer, employee: $person)end

Template Ausführung außerhalb eines Topicblockesworks(lutz-maicher, uni-leipzig)

Template Ausführung außerhalb eines Topicblockeslutz-maicher isa person;

works(uni-leipzig);room: "0-05" @work.

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 19/20

Page 31: CTM - The Compact Topic Map Notationasv.informatik.uni-leipzig.de/document/file_link/149/ctm.pdf · CTM - The Compact Topic Map Notation Dipl.-Inf. Hannes Niederhausen Topic Maps

Fragen?

I Fragen?

Dipl.-Inf. Hannes Niederhausen (Topic Maps Lab) 03.12.2009 / TMRA09 20/20