[sc34wg3] Look Ma! No Properties!

Robert Barta sc34wg3@isotopicmaps.org
Fri, 16 Jul 2004 20:32:38 +1000


On Fri, Jul 16, 2004 at 10:13:28AM +0200, Jan Algermissen wrote:
> Robert Barta wrote:
> 
> > forall [ $s is-a student ]
> >   => exists [ $s
> >               name     : *
> >               shoesize : /\d+/
> >               SID      : /\d{8}/ ]
> 
> Could I also have:
> 
> forall [ $s is-a student ]
>   => exists [ $s
>               name     : *
>               shoesize : > 9        <---------------------- '>' instead of regex!
>               SID      : /\d{8}/ ]
> 
> IOW, can I 'late bind' the semantics of Integer to the opaque
> strings and apply the (numerical) '>' operator? Or am I
> doomed to doing the full scan, applying a regex on each literal
> in turn?

Jan,

As it stands I have not introduced any of the usual suspects as types
into this language. Simply because I never needed it before. OWL is
using XSD Data Types which would be an obvious choice.

But, yes, once this is incorporated, you could write something like
this:

forall [ $s is-a student ]
  => exists [ $s
              name     : *
              shoesize : $shoesize: xsd:positiveInteger && $shoesize > 9
              SID      : /\d{8}/ ]

Everything to the right of the : is just a predicate which is eval'ed
in the light of the current value. Not really rocket-science.

\rho