Re: using TMCL-constraints

Lars Heuer <[email protected]> Tue, 17 May 2011 14:35:18 +0200
Newsgroups gmane.text.xml.xtm.general
Organization Semagia
Message-ID <[email protected]>
Hi Lukas,

[...]
> Does the 2nd statement create a new instance of tmcl:topic-name-constraint
> (cc) or uses it the first one (c) and creates just a new association of the
> type tmcl:constrained-statement with the roles [player: ns:last-name,
> instance-of: tmcl:constrained] and [player:c, instance-of: tmcl:constraint]?

As Hannes has stated correctly, a new constraint is created. Some
background info: You can see this very easily in the TMCL's template
definitions [1].

If they state

   ?c isa tmcl:whatever-constraint

?c creates always a new topic since ?c is a CTM (named) wildcard [2].

So, if you write x has-name(ns:last-name, 1, 1) the template

    def has-name($tt, $nt, $min, $max)
        [...]
    end

is executed behind the scenes (where $tt is automatically bound to
the context topic).


[1] <http://www.isotopicmaps.org/tmcl/tmcl.html#tmcl-templates>
[2] <http://www.isotopicmaps.org/ctm/ctm.html#named-wildcard>

Best regards,
Lars
-- 
Semagia 
<http://www.semagia.com>

<http://www.topicmaps.de/mailinglist/> German Topic Maps mailing list
<http://tinytim.sourceforge.net/> Open Source Topic Maps engine
<http://mappa.semagia.com/> Mappa - Python Topic Maps engine