[sc34wg3] CTM: Specifying datatypes

Xuân Baldauf xuan--sc34wg3--isotopicmaps.org at baldauf.org
Fri Mar 27 07:32:50 EDT 2009


Hello,

there is an issue regarding specifying datatypes. Consider this CTM document

    somerule
      isa rule
      match: "\\d+"^^regexp:perlre
      action: "foobar"

    foo
      isa object-relational-mapping
      query: "SELECT * FROM sometable"^^sql:query

It would be nice to make this compressible to

    somerule
      rule("\\d+","foobar")

    foo
      mapping("SELECT * FROM sometable")

However, this is not possible currently, because there is no way for the
CTM template to set the datatype. Thus, a user would have to write

    somerule
      rule("\\d+"^^regexp:perlre,"foobar")

    foo
      mapping("SELECT * FROM sometable"^^sql:query)

which is quite ugly and also tedious (thus, not really compact as a
"compact syntax" would suggest). This hampers the usage of datatypes at
all. People will model things just as "xsd:string"s, while these things
should have a different datatype, just because expressing "xsd:string"
is easier (e.g. you can omit the "^^xsd:string" part).

Thus, we need syntax for defining (or changing) the datatype of a
literal within templates.

ciao,
Xuân.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.isotopicmaps.org/pipermail/sc34wg3/attachments/20090327/51ce1eec/attachment.htm 


More information about the sc34wg3 mailing list