[sc34wg3] CTM: Mergemap directive and semicolons
heuer at semagia.com
Mon Nov 3 09:13:20 EST 2008
The mergemap directive  provides an optional "notation" identifier.
If the notation is *not* specified the CTM parser must assume that
referenced file uses CTM syntax.
At the meeting in Leipzig we decided that the "notation" should be an
IRI (PSI) and not a string. This decision solves the problem that a
string is a very weak identifier and that the working group can use a
namespace where it can host "official" notations (aside from
'unofficial' notations like AsTMa= and LTM).
So far so good, but this IRI introduces the problem that we cannot
decide if the IRI is meant as notation or as subject identifier (since
the notation is optional). In Leipzig we decided that we introduce
semicolons for all directives to solve the problem.
Maybe an example helps to understand the problem:
%mergemap http://www.example.org/map.ctm http://www.topicmaps.org/syntax/ctm
A parser cannot decide if <http://www.topicmaps.org/syntax/ctm> is
meant as subject identifier or as notation. (It can decide it if it
sees a "." (topic block delimiter) somewhere but that could be too
a) %mergemap <http://www.example.org/map.ctm>;
b) %mergemap <http://example.org/map.xtm> <http://topicmaps.org/xtm>;
a) The parser merges the specified map and assumes that it uses CTM
syntax, otherwise an error is issued
b) The parser merges the specified map using the syntax specified by
the PSI <http://topicmaps.org/xtm>
Using semicolons after each directive solves the problem but it looks
ugly (version directive: %version 1.0; ).
After taking a shower and thinking about it a bit I wondered if it
wouldn't be better to make the "notation" mandatory for the mergemap
directive: If the directive is changed from
mergemap ::= '%mergemap' IRI IRI? ';'
mergemap ::= '%mergemap' IRI IRI
the parser can always decide when the directive was parsed completely
and we wouldn't bother the users to add semicolons everywhere.
What do you think?
More information about the sc34wg3