[topicmapmail] Compact Topic Maps Syntax -- A modest proposal

Steve Pepper pepper@ontopia.net
Tue, 14 Feb 2006 14:52:25 +0100


[This is a slightly updated version of a note sent to the
WG3 mailing list.]

I've been playing around with CTM [1] and come up with a
(partial) syntax that I think seems promising. It is
essentially an amalgam of the best in LTM and AsTMa=, with
certain features inspired by the RDF N3 syntax.

Here's an example. Some explanation follows, but I think
the example is mostly self-explanatory -- which is an
important goal for CTM, I think.

---------

@prefix music:  <http://psi.ontopia.net/music/#> .
@prefix music2: <http://www.kanzaki.com/ns/music#/> .
@prefix wiki:   <http://en.wikipedia.org/wiki/> .
@prefix lang:  <http://www.topicmaps.org/xtm/1.0/language.xtm#> .

@names  foaf:name  dc:title .

@assoc  music:composed-by  music:work  music:composer .
@assoc  music:influenced-by  ex:object  ex:agent .
@assoc  music:killed-by  ex:victim  ex:perpetrator  ex:method .


wiki:Puccini > music:composer
  foaf:name "Giacomo Puccini" ( 'puccini, giacomo' /tm:sort/ ) ;
  bio:dateOfBirth  "1858-12-22"^xsd:date .

:butterfly > music:opera
  dc:title "Madama Butterfly" ,
           "Madame Butterfly" /lang:en lang:fr/ ;
  music:synopsis  <http://www.metopera.org/synopses/madama.html> ;
  music:composed-by  :puccini ;
  music:influenced-by :iris .

:cio-cio-san > music:character "Cio-cio-san" ;
  music:appears-in :butterfly ;
  music:killed-by  :cio-cio-san  :stabbing .

music:composer "Composer" >> foaf:Person
  ~music2:Composer .

---------

Points to note:

* Minimal use of cryptic delimiters and keywords 
* Almost everything can be expressed as a block of statements about
  a topic terminated by a period 
* Most of the contents of the block consists of delimiter/topic,
  topic/topic, or topic/string pairs 
* Item identifiers are preceded by a colon (e.g., :butterfly) 
* Subject identifiers are simply given as URIrefs (e.g. wikip:Puccini)
* Syntax is greatly simplified through the use of declarations 
* Statements are assumed to be occurrences unless the type is defined
  as a name or association by an @name or @assoc declaration 
* Association templates allow role types to be omitted 
* String values are always delimited by quotes (single or double):
  "string" 
* URIrefs are always delimited by less-than and greater-than signs:
  <http://...> 
* Type-instance and supertype-subtype have special delimiters
  ('>' and '>>' respectively) 
* Subject identifiers and subject locators have special delimiters
  ('~' and '=', respectively)

Clearly this proposal is not complete, but I have ideas on how to make
it so. Before that, though, I would like to hear people's gut reactions
to it.

Steve

[1] CTM, for those who haven't heard, is a proposed new standard that
will fulfill the function of LTM and AsTMa= in providing a simple,
lightweight, text-based syntax for representing topic maps. Further
documents from the ISO Topic Maps committee are:

Initial work: http://www.jtc1sc34.org/repository/0658.pdf 
New Work Item Proposal: http://www.jtc1sc34.org/repository/0699.pdf 
Use cases: http://www.jtc1sc34.org/repository/0701.pdf 
Meeting notes, Atlanta (Nov 2005): http://www.jtc1sc34.org/repository/0702.pdf



--
Steve Pepper, Ontopian

Those cartoons: The issue is racism, not free speech --
http://www.socialistworker.co.uk/article.php?article_id=8267