Re: DAML: restricting number of elements in a list

Yes, that is what I had in mind.

Ken Baclawski
Ken@Baclawski.com
UBOT Project

On Thu, 7 Feb 2002, Steven Gollery wrote:

> Ken,
> 
> Thank you -- that seems reasonable. Just to make sure that I'm understanding,
> here's some DAML that I think implements what you're describing:
> 
> <daml:Class rdf:ID="Point">
> </daml:Class>
> 
> <daml:Class rdf:ID="VertexList">
>   <rdfs:subClassOf rdf:resource="daml:list"/>
>   <rdfs:subClassOf>
>     <daml:Restriction>
>       <daml:onProperty rdf:resource="daml:item"/>
>       <daml:toClass rdf:resource="#Point"/>
>       <daml:minCardinality>3</daml:minCardinality>
>     </daml:Restriction>
>   </rdfs:subClassOf>
>  </daml:Class>
> 
> I think that restricts the class of the items to Point and the number of items
> to 3 or more.  Is that right?
> 
> Thanks again,
> 
> Steve
> 
> 
> Ken Baclawski wrote:
> 
> > The daml:item property relates a list to each of its elements.  One can
> > impose a daml:minCardinality restriction on the daml:item property to
> > ensure that the number of vertices in a polygon is at least 3.
> >
> > Ken Baclawski
> > Ken@Baclawski.com
> > UBOT Project
> >
> > On Wed, 6 Feb 2002, Steven Gollery wrote:
> >
> > > I'm working on an ontology in DAML that includes some geometric
> > > concepts. I would like to be able to somehow define a property Vertices
> > > whose domain is the Polygon class and whose range is ordered collections
> > > of instances of the Point class, where the length of the ordered
> > > collection is at least three.
> > >
> > > It would be fairly straightforward to say that each Polygon must have at
> > > least three values of a Vertex property which is restricted to class
> > > Point, but that would lose the idea the vertices have an order -- the
> > > order is obviously a fundamental part of the semantics for the polygon.
> > >
> > > Does DAML provide any way to restrict the number of elements in a list?
> > > Or is there some other way to do what I need here?
> > >
> > > Thanks in advance,
> > >
> > > Steve Gollery
> > > sgollery@cadrc.calpoly.edu
> > >
> > >
> 

Received on Thursday, 7 February 2002 17:20:16 UTC