W3C home > Mailing lists > Public > www-rdf-comments@w3.org > April to June 1999

Re: "OR" in Schema spec

From: Dan Brickley <Daniel.Brickley@Bristol.ac.uk>
Date: Wed, 5 May 1999 17:56:57 +0100 (BST)
To: Milla Makelainen <millam@nortelnetworks.com>
cc: "'www-rdf-comments@w3.org'" <www-rdf-comments@w3.org>
Message-ID: <Pine.GHP.4.02A.9905051752150.27938-100000@mail.ilrt.bris.ac.uk>


This is documented in 3.1.3 of the spec (below). Broadly, you need to
define the range of your property 'pet' to be some general class which
represents a superset of both cats and dogs. You might call this 'Pet'
(not different case convention).

eg.	pet -range-> Pet
	Cat -subClassOf->Pet
	Dog -subClassOf->Pet
	Poodle -subClassOf->Pet

Mammal might be a better example than "Pet" here but hopefully point is
clear. Excerpt from http://www.w3.org/TR/PR-rdf-schema/#constraints



	although it is not possible to express two or more range constraints on a
	property, a similar outcome can be achieved by defining a
        common superclass for any classes that represent appropriate
	values for some property. For example, to express the constraint that a
        property xyz:drivesMotorVehicle can have values which are Vans,
	Trucks or PassengerVehicles, we assert that
        xyz:drivesMotorVehicle has a rdfs:range of MotorVehicle. If Van,
	Truck and PassengerVehicle are known to be
        sub-classes of MotorVehicle, then all these types of resource
	are acceptable values for xyz:drivesMotorVehicle. In cases where a
        common super-class does not exist, one can be defined in a
	schema in the normal manner. 

On Wed, 5 May 1999, Milla Makelainen wrote:

> Hi,
> At the moment, it seems to be impossible to create an "OR" statement in RDF
> schema. This is because a property can only have one "range" property and
> can therefore belong only to one class. How can I write a schema that says
> for example that "a pet can be either a cat or a dog" and then have a list
> of different breeds of cats and dogs in different classes?
> Milla
> Milla Makelainen
> Smart Network Technology, Nortel Networks
> email: millam@nortelnetworks.com
> tel. +44 (0) 1279 403270
> mobile +44 (0) 780 149 5538
> -- "Wisdom is being able to cope"
> This message may contain information proprietary to Nortel Networks, so any
> unauthorised disclosure, copying or distribution of its contents is strictly
> prohibited.
Received on Wednesday, 5 May 1999 12:57:12 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:15:12 UTC