[sc34wg3] TMCL and MAX_INT
Lars Marius Garshol
larsga at garshol.priv.no
Mon Feb 23 04:22:36 EST 2009
(I have a set of comments on TMCL which I would like to try to discuss
before the Prague meeting, so that the simplest ones can be resolved
without consuming time in the meetings. This is the first one.)
In the TMCL examples in the spec the MAX_INT literal is used to
represent the biggest possible integer in order to be able to express
unrestricted maximum cardinalities while using the templates. The
problem is that this is not a legal integer literal according to XML
Schema.
In other words, the following is what one has to write now:
ph:photo isa tmcl:topic-type ;
plays-role(ph:categorized, ph:in-category, 0, MAX_INT) .
However, this does not work, because syntactically MAX_INT is a topic
reference, not an integer. And leaving the parameter out is not
possible in CTM.
Possible solutions:
(1) Find some way to shoehorn MAX_INT into CTM (and XTM 1.0/2.0!).
(2) Support optional arguments in CTM templates (which also requires
some way to make parts of a template conditional).
The example above would then become
ph:photo isa tmcl:topic-type ;
plays-role(ph:categorized, ph:in-category, 0) .
(3) Introduce topics representing cardinalities and have predefined
topics for 0-1, 1-1, 0-*, and 1-*. Omit the max-card occurrence to
make the cardinality unlimited. Pass these topics to the template
instead of the integers.
The example above would then become
ph:photo isa tmcl:topic-type ;
plays-role(ph:categorized, ph:in-category, tmcl:unlimited) .
(4) Define extra templates (with different names) which omit the max
cardinality argument (implicitly setting it to infinity).
The example above would then become
ph:photo isa tmcl:topic-type ;
plays-role-unlimited(ph:categorized, ph:in-category, 0) .
Thoughts on this?
--Lars M.
http://www.garshol.priv.no/blog/
http://www.garshol.priv.no/tmphoto/
More information about the sc34wg3
mailing list