Re: properties with classes as values?

> I want to declare a property that will take a class as its value
(rather
> than an instance of a class).

Use daml:hasValue on a DAML restriction for that.

> For instance, I want to declare class MyClass with property
> myProperty, and say that the range of myProperty is Class,
> so that an instance of MyClass can have myProperty with,
> say, class Person as its value.

Er... that's not what you're asking for above. Why would the range of
myProperty be Class, e.g. if you want it to take Person as a value? Is
Person the only instance of Class?

If you want Person to be the only *value* that myProperty can take,
try:-

   :MyClass rdfs:subClassOf
      [ daml:onProperty :myProperty;
        daml:hasValue :Person ] .

> (2) Now, what if I want to say that the range of myPropery is
> Class (as above), AND that its values are restricted to the
> subclasses of some particular class, say, Animal.  Is this doable?
> And if so, how would this range be declared?

That would be an intersectionOf, I think... you want to say that the
range is the intersection of Class and a subClassOf Animal?

   :x rdfs:range
      [ daml:intersectionOf
          (:Class [ rdfs:subClassOf :Animal ]) ] .

XML RDF of these things available upon request...

--
Kindest Regards,
Sean B. Palmer
@prefix : <http://webns.net/roughterms/> .
:Sean :hasHomepage <http://purl.org/net/sbp/> .

Received on Thursday, 7 June 2001 09:48:29 UTC