[sc34wg3] TMCL Comments (Part II)

Robert Barta rho at devc.at
Wed Oct 29 13:27:34 EDT 2008


Here is the rest of the more important things I noticed about the
current TMCL draft.

======================================================

4.4.8 # Again, maybe get rid of the superfluous prose.

What I did not understand/remember is whether this constraint ALWAYS
refers to exactly TWO topic types. Or whether there can be any number
of topic types involved. So that it should read "... any two topic
types ..".

Is it possible to have

  c isa exclusive-instance
  applies-to ..... atype
  applies-to       btype
  applies-to       ctype

???

If there are only two involved, then the applies-to does not make any
distinction between them. If there were only two, then the TMQL would
look like

   disjoint-with-constraint ako constraint
   validation : """
       for $atype in $this <- constraint-role -> atype-role
       for $atype in $this <- constraint-role -> btype-role
       where
          $atype >> instances == $btype >> instances
       return $this
   """ @ tmql:tmql .

--

In the example, both, atype and btype become instances of topic-type,
but not so in the CTM template below. Relevant?

--------------------

4.4.9

.... regular expression that must [match against] ....

And are we talking about Regular Expressions or UNIX glob patterns?
The "*" looks like the latter. A regexp would have ".*" instead.

What is the relevance of

   atype isa typic-type .

And could we have better examples, plz?

My definition would look like:

   subject-identifier-constraint ako constraint
   description: constraint to control the cardinality and form of subject identifiers
   validation: """
         for $type in $this <-> applies-to
         for $i    in $type >> instances
         where
             $this / cardmin & count ($i ~) < $this / cardmin
             |
             $this / cardmax & count ($i ~) > $this / cardmax
             |
             $this / regexp  &
                     not every $si in $i ~ satisfies $si =~ $this / regexp
         return
             $this
   """ @ tmql:tmql

The CARDMAX/MIN is not necessary. Similar procedure with other constraints
having optional components.

Important is the consistent writing of the occurrence names. Now we have
cardmin and card-min  and regexp and reg-exp and regularexpr .

--------------------------

4.4.10

Ditto, plus:

TMQL is faulty:

     ....
     $this / cardmin & count ($i =) < $this / cardmin
                              ^^^^

Example has lots of typos:

     document isa topic-type
       has-subject-locator (1, 1, "file://.*") .

---------------------------

4.4.15

TMQL has "datatype", but this now is named "has-datatype".

In the template has-datatype is there now a CTM . missing? (I know
that probably 1000 ;'s are missing ;-)

---------------------------------

4.4.16 talks about names, but is about occurrences! The prose is
cumbersome to maintain.

--------------------------------

4.4.18

the line break after 'count' is somewhat unfortunate

ad TMQL: as usual, drop the first iterator

  for $rpc in // .....

and use $this as constraint variable.

The template invocation

   person isa topic-type
       plays-role (employee, works-for, 1) .

is not corresponding to the template definition.

I would drop the MAX_INT.

---------------------------------

4.4.19

The example use is pretty lame.

TMQL: The CARDMAX/MIN handling should be fixed.

TMQL: what is this isa in the middle?

TMQL: do not return false, but $this on violation

TMQL: formatting: return $this aligned with top "for" looks better

The formatting inside the template is not quite right.


----------------------------------


6 TMCL Extensions

Maybe "Custom Constaints"?

With the mechanism defined earlier, it should be straightforward to
add your own constraints:

  my-constraint ako constraint
  validation: """
      .....
  """

But that "true/false" must go away.



======================================================

\rho


More information about the sc34wg3 mailing list