Re: How to restrict the possible values of a class?

Hello Brian,

That only solves half the problem as I still cannot state that the subclass DayRange only runs from
1 to 31. Try to write it down in RDF, you'll see that it doesn't work. Could this be a flaw in the
RDF schema? In OO programming, one can make subclasses of a base class and in the subclass restrict
properties of the base class to certain values. This is exactly what I am trying to do here, but it
seems that RDF doesn't support this kind of construction.

Regards,

Tom.

McBride, Brian wrote:

> I'm not sure that I think its very pretty, but could
> you make DayRange a subclass of Range?
>
> Brian McBride
> HPLabs
>
> >-----Original Message-----
> >From: Tom Van Eetvelde [mailto:tom.van_eetvelde@alcatel.be]
> >Sent: Tuesday, June 27, 2000 11:27
> >To: www-rdf-interest@w3.org
> >Subject: How to restrict the possible values of a class?
> >
> >
> >Hello RDF community,
> >
> >I have the following practical problem: how can I restrict
> >classes/properties to certain values? I
> >ran into this problem with the creation of a Date class:
> >
> ><rdfs:Class rdf:ID="Range">
> >  <rdfs:Label> Range </rdfs:Label>
> >  <rdfs:comment>
> >    This class represents an interval.
> >  </rdfs:comment>
> >  <rdfs:subClassOf rdf:resource="#CompositeValue"/>
> ></rdfs:Class>
> >
> ><rdfs:Property rdf:ID="gr">
> >  <rdfs:label> gr </rdfs:label>
> >  <rdfs:comment>
> >    The 'GReater than' property. Defines a lower boundary of the range.
> >  </rdfs:comment>
> >  <rdfs:domain rdf:resource="#Range"/>
> ></rdfs:Property>
> >
> ><rdfs:Property rdf:ID="ge">
> >  <rdfs:label> ge </rdfs:label>
> >  <rdfs:comment>
> >    The 'Greater than or Equals' property. Defines a lower
> >boundary of the range.
> >  </rdfs:comment>
> >  <rdfs:domain rdf:resource="#Range"/>
> ></rdfs:Property>
> >
> ><rdfs:Property rdf:ID="ls">
> >  <rdfs:label> ls </rdfs:label>
> >  <rdfs:comment>
> >    The 'LeSs than' property. Defines an upper boundary of the range.
> >  </rdfs:comment>
> >  <rdfs:domain rdf:resource="#Range"/>
> ></rdfs:Property>
> >
> ><rdfs:Property rdf:ID="le">
> >  <rdfs:label> le </rdfs:label>
> >  <rdfs:comment>
> >    The 'Less than or Equals' property. Defines an upper
> >boundary of the range.
> >  </rdfs:comment>
> >  <rdfs:domain rdf:resource="#Range"/>
> ></rdfs:Property>
> >
> ><rdfs:Class rdf:ID="Date">
> >  <rdfs:Label> Date </rdfs:Label>
> >  <rdfs:comment>
> >    This class represents a date in the format DD/MM/YYYY
> >(day-month-year).
> >  </rdfs:comment>
> >  <rdfs:subClassOf rdf:resource="#CompositeValue"/>
> ></rdfs:Class>
> >
> ><rdfs:Property rdf:ID="day">
> >  <rdfs:label> day </rdfs:label>
> >  <rdfs:comment>
> >    The day part of the date.
> >  </rdfs:comment>
> >  <rdfs:domain rdf:resource="#Date"/>
> >  <rdfs:range rdf:resource="#DayRange"/>
> ></rdfs:Property>
> >
> ><rdfs:Property rdf:ID="month">
> >  <rdfs:label> month </rdfs:label>
> >  <rdfs:comment>
> >    The month part of the date.
> >  </rdfs:comment>
> >  <rdfs:domain rdf:resource="#Date"/>
> >  <rdfs:range rdf:resource="#MonthRange"/>
> ></rdfs:Property>
> >
> ><rdfs:Property rdf:ID="year">
> >  <rdfs:label> year </rdfs:label>
> >  <rdfs:comment>
> >    The year part of the date.
> >  </rdfs:comment>
> >  <rdfs:domain rdf:resource="#Date"/>
> >  <rdfs:range rdf:resource="#YearRange"/>
> ></rdfs:Property>
> >
> >The RDF Shema Spec literally says that 'domain' and 'range'
> >may only have values of the type
> >'class'. I wanted to make DayRange an instance of the Range
> >class with properties ge = 1 and le =
> >31. But clearly, the Spec forbids this as I would have a value
> >type of Range <> Class. So, how can I
> >indicate that the Dayrange runs from 1 to 31 (similar question
> >for month and year)?
> >
> >Regards,
> >
> >Tom.
> >

Received on Tuesday, 27 June 2000 08:05:15 UTC