[topicmapmail] Compact Topic Maps Syntax -- A modest proposal
Steve Pepper
pepper@ontopia.net
Wed, 15 Feb 2006 09:12:44 +0100
Hi Thomas,
| although dict.leo.org couldn't help me find out what a "gut reaction"
| might be,
Spontan Reaktion? (Aus dem Bauch heraus?)
| i'd like to give some remarks:
|
| * '>' and '>>' don't seem intuitive to me.
I understand your point and the same thought occurred to me.
However, I tried with the more "intuitive" '<' and '<<' and
it didn't seem right: it's as if the flow of reading left to
right gets interrupted.
| * why the use of paranthesis in this case:
| foaf:name "Giacomo Puccini" ( 'puccini, giacomo' /tm:sort/ ) ;
| but not in that case:
| dc:title "Madama Butterfly" , "Madame Butterfly" /lang:en lang:fr/ ;
| ?
Because the first is a single base name with a variant, whereas
the second is two separate base names (one of which is scoped).
| * the way associations are handled is not intuitive.
| i would expect another ordering: first the subject, then the
| association-type, then the object(s).
That is indeed the order in the data itself:
:tosca
music:composed-by :puccini .
However, it felt more correct to have the following order in the
declaration of the template:
assoc-type role-type1 role-type2 [...] role-typeN .
There are two reasons for this: (1) The declaration is basically
making an assertion about the association type ("these are its
role types"), hence the assoc-type is the "subject" and should go
first. (2) An important purpose of the template is to specify the
*order* of the role types; having the order "disrupted" by the
assoc-type appearing second in the list is counter-intuitive.
| but i think it's better to stick to the XTM-practice of holding
| associations seperate from topics
In order to get full generality, this has to be an option. The
templating mechanism only works when a single association type
"signature" is used consistently throughout the topic map, and
that will not always be the case. So my proposal does include the
possibility of using the following (LTM-like syntax):
music:killed-by( :scarpia > ex:victim
:tosca > ex:perpetrator
:stabbing > ex:method
)
which, in the presence of an appropriate template, could be
abbreviated to
music:killed-by( :scarpia :tosca :stabbing )
| this also makes more sense semantically, since if you write it
| like subject-predicate-object, why should you care to define an
| association at all?
| (which may indeed be a question? may it?)
I'm not completely certain I understand what you mean when you
say "define an association" -- I assume you mean to declare an
association type?
Well, the reason is, quite simply, in order to avoid having to
always specify the *role types*. The @assoc declaration tells us
which role types to expect, and what order to expect them in, so
we must have it (unless we are willing to pay the price of having
to specify the role types on every association).
Your comment does raise one issue, however, which is whether it
is a good idea (or not) to encourage (or even allow) users to
express associations *as if* they had a "subject".
We all know that associations in Topic Maps are inherently
multidirectional, and that "Tosca was composed by Puccini" is the
same as "Puccini composed Tosca". That relationship no more
"belongs to" Tosca than it does to Puccini.
The XTM interchange syntax has always made this very explicit by
having <association> elements appear at the same level as <topic>
elements (while <baseName> and <occurrence> are *subelements* of
<topic>, because names and occurrences always "belong to" some
topic).
However, because we are humans, and we use natural language --
a serialization syntax -- to communicate, it *is* natural to
think in terms of a direction when *describing* a relationship.
For most speakers of European languages, subject-verb-object is
a very natural way to express a binary relationship. So why not
exploit this in what is supposed to be a compact, intuitive and
easy to read syntax? I believe we should.
This does, however, raise the question of whether we should offer
an alternate syntax, based on subject-object-verb word order, for
the benefit of speakers of languages like Japanese and Korean:
:tosca
:puccini music:composed-by .
SOV-language speakers: Would this be useful or not?
--
Steve Pepper, Ontopian