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 06:27:36 UTC