[sc34wg3] Supporting variants in TMCL

Lars Marius Garshol larsga at garshol.priv.no
Wed Nov 4 03:45:55 EST 2009

* Steve Pepper
> Would it help if I were to formulate a constraint in English that I  
> believe would do the job:
>  NAMES of type "foo" belonging to
>   TOPICS of type "bar" can or must have (one or more)
>    VARIANTS in the scope "baz"

Technically, the topic type is not required to make this constraint  
work, but I think you are right that users will want matching on the  
topic type as well, since iso:topic-name, for example, probably will  
have different variant structures depending on the topic type.

The following would be a way to express this in TMCL:

def has-variant($tt, $nt, $t, $min, $max)
   ?c isa tmcl:variant-constraint;
     tmcl:card-min: $min;
     tmcl:card-max: $max.

   tmcl:constrained-topic-type(tmcl:constrains : ?c,  
tmcl:constrained : $tt)
   tmcl:constrained-statement(tmcl:constrains : ?c, tmcl:constrained :  
   tmcl:required-scope(tmcl:constrains : ?c, tmcl:constrained : $t)

However, looking at Naito-san's original use case[1] it does not seem  
that this proposal is sufficient to describe it. The trouble is that  
his variants do not use scopes consisting of a single topic only.

One could say:

person isa tmcl:topic-type;
   - "Person";
   has-name(typicalName, 1, 1);
   has-variant(typicalName, Hiragana, 1, 1);
   has-variant(typicalName, Reading, 1, 1).

His example would be valid according to this schema, but so would

   - typicalName: "XXjkSATO HACHIRO" @ Katakana;
       ("XXjhSato Hachirou" @ Hiragana) # left off Reading
       ("XXjhSato Hachirou" @ Reading)  # left off Hiragana
       ("Satou Hachirou" @ Romaji, Reading).

This raises several questions:

   (1) Is Naito-san's use case typical for how people use variants?

   (2) Do we really know how people use variants?

   (3) Does Naito-san in fact need the "Reading" topic in his
       variant scopes? It seems like all Hiragana and Romaji
       variants have "Reading" as well. Could some variants have
       something other than "Reading", or appear without "Reading"?

[1] http://www.infoloom.com/pipermail/topicmapmail/2009q2/007497.html

--Lars M.

More information about the sc34wg3 mailing list