[sc34wg3] TMCL and MAX_INT

Graham Moore gra at networkedplanet.com
Mon Feb 23 06:01:25 EST 2009


Hi,

> (1) Find some way to shoehorn MAX_INT into CTM (and XTM 1.0/2.0!).
>

Sounds like lots of work even if we come up with a technical solutions.

> (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) .
>

This still leaves us in the spec needing to indicate what that value
actually is. Also, what does the expansion look like? Doesn't this
just push the problem around?

> (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) .
>

Would this mean that only these topics were allowed, could I introduce
a 1-4 card topic and have it understood? A variant of this would be to
store this value in an occurrence whose data type is string and have
the semantics of evaluation cast it to an Int even when the value is
*.

> (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) .

I dont like this due to what is template bloat and makes it seem like
there are lot more things for people to learn.

One other idea:

We introduce in CTM some casting functions, so the template would be

ph:photo isa tmcl:topic-type ;
   plays-role-unlimited(ph:categorized, ph:in-category, 0, StrToInt("*")) .

And we define StrToInt as fundamental functions that have a certain
behaviour, including for StrToInt a * to be the max int as defined in
the local system. This is similar to one except its a CTM fix not a
TMDM one. The bad thing about this is that an actually Int will get
stored, not a symbol for infinity.




Cheers,

Gra


2009/2/23 Lars Marius Garshol <larsga at garshol.priv.no>:
>
> (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/
>
> _______________________________________________
> sc34wg3 mailing list
> sc34wg3 at isotopicmaps.org
> http://www.isotopicmaps.org/mailman/listinfo/sc34wg3
>



-- 
Graham Moore, Director, Networked Planet Limited
Editor XTM 1.0, ISO13250 (TopicMaps) -2,-3, TMCL
e: graham.moore at networkedplanet.com
w: www.networkedplanet.com
t: +44 1865 811131
m: +44 7769658611 (UK)
m: +47 45271713   (Norway)

Networked Planet Limited is registered in England and Wales, no. 5273377


More information about the sc34wg3 mailing list