In its history, Topic Maps developed from a syntax-based standard to a pure data model without any syntax defined within its core data model. The syntaxes defined by the ISO for the exchange of Topic Maps are conforming to the generic data model, one of them, XTM, being based on XML. The usage of XTM without a Topic Maps engine is cumbersome because of the generalized schema and the merging rules. For example, extracting useful information from XTM using XSLT requires to query for the typing topics, which is a new subquery just for selecting the right subject whereas it was the entity name in a domain specific XML format. Querying the properties, called Names and Occurrences in Topic Maps, requires additional subqueries because their types and scopes are again Topics and not simple XML entity- and attribute names. The Topic Maps Query Language which is the latest draft in the ISO standardization presented here allows formulating queries against a Topic Maps store in a concise way and outputting the result in various representations. Our implementation TMQL4J uses any TMAPI-compatible store to operate on and allows optimized queries and outputting domain-specific XML. This is demonstrated by generating an ATOM feed for the subject identity record service subj3ct.com.
24. SUBJECT CENTRIC MODELING
"real" world
has name Leipzig model
has name Lipsia
has name Lipsk (in pl)
25. SUBJECT CENTRIC MODELING
"real" world
has name Leipzig model
has name Lipsia
has name Lipsk (in pl)
was founded 1165
26. SUBJECT CENTRIC MODELING
"real" world
has name Leipzig model
has name Lipsia
has name Lipsk (in pl)
was founded 1165
27. SUBJECT CENTRIC MODELING
"real" world
has name Leipzig model
has name Lipsia
has name Lipsk (in pl)
has name Clara Wieck
was founded 1165
28. SUBJECT CENTRIC MODELING
"real" world
has name Leipzig model
has name Lipsia
has name Lipsk (in pl)
has name Clara Wieck
was founded 1165
29. SUBJECT CENTRIC MODELING
"real" world
has name Leipzig model
has name Lipsia
has name Lipsk (in pl)
has name Clara Wieck
was founded 1165
30. SUBJECT CENTRIC MODELING
"real" world
has name Leipzig model
has name Lipsia
has name Lipsk (in pl)
has name Clara Wieck
was founded 1165
31. SUBJECT CENTRIC MODELING
"real" world
has name Leipzig model
has name Lipsia
has name Lipsk (in pl)
has name Clara Wieck
was founded 1165
has name Lipsko (in cs)
has webseite http://www.leipzig.de
32. SUBJECT CENTRIC MODELING
"real" world
has name Leipzig model
has name Lipsia
has name Lipsk (in pl)
has name Clara Wieck
was founded 1165
has name Lipsko (in cs)
has webseite http://www.leipzig.de
54. XTM: XML TOPIC MAPS 2.0
topic = element topic { id,
(itemIdentity | subjectLocator | subjectIdentifier)*,
instanceOf?, (name | occurrence)* }
name = element name { reifiable, type?, scope?, value, variant* }
association = element association { reifiable, type, scope?, role+ }
role = element role { reifiable, type, topicRef }
58. TOPIC MAPS QUERY
LANGUAGE (TMQL)
•3 Styles:
• Path expressions, similar to XPath
• Select: similar to SQL
• FLWOR: For-Let-Where-Order-Return, similar to XQuery
68. CHECK IT OUT
• http://code.google.com/p/tmql/ (Code in Java, APL 2.0)
• http://tmql4j.topicmapslab.de/ (Documentation)
• http://rubygems.org/gems/rtm-tmql (Adapter for JRuby)
69. RTM-TMQL: FIRST STEPS
• Download + Install JRuby from http://jruby.org
• sudo jgem install rtm-tmql rtm-ontopia
• jirb
• require 'rtm-tmql'
• con = RTM.connect
• tm = con.from_xtm("some_topic_map.xtm")