W3C home > Mailing lists > Public > www-rdf-interest@w3.org > June 2000

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

From: Tom Van Eetvelde <tom.van_eetvelde@alcatel.be>
Date: Tue, 27 Jun 2000 15:12:30 +0200
Message-ID: <3958A83E.5383288@alcatel.be>
To: Graham Klyne <GK@Dial.pipex.com>
CC: "www-rdf-interest@w3.org" <www-rdf-interest@w3.org>
Hello Graham,

First some background info: CompositeValue is of type 'Class'.

I first tried to do what you did, but then I came across the Spec description of 'rdfs:domain'
(section 3.1.4). There it states: 'If there is exactly one domain property, it may only be used on
INSTANCES of that class ...'. This means that your solution is not valid as property 'ge' may only
be used on instances of 'Range'. In your solution, Dayrange is not an instance, but a class.

Regards,

Tom.

Graham Klyne wrote:

> My take would be to define 'DayRange' as a _subclass_ of 'Range', and hence
> an instance of 'rdf:Class'.
>
> I see no definition of '#CompositeValue'.  'Range' might be defined with
> multiple superclasses 'rdf:Class' and '#CompositeValue'.  But the approach
> suggested by your 'gr' and other properties is to simply apply them to the
> 'Range' (or 'DayRange') class.
>
>      [#DayRange] --rdf:Type--------> [rdf:Class]
>      [         ] --rdf:subClassOf--> [#Range]
>      [         ] --#ge-------------> '1'
>      [         ] --#le-------------> '31'
>
> Does this not achieve your goal?
>
> (I have problems with the use of fragment identifiers in this way, but
> that's RDF for you.)
>
> #g
> --
>
> At 12:26 PM 6/27/00 +0200, Tom Van Eetvelde wrote:
> >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.
>
> ------------
> Graham Klyne
> (GK@ACM.ORG)

Received on Tuesday, 27 June 2000 09:13:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:43 GMT