W3C home > Mailing lists > Public > semantic-web@w3.org > April 2005

Re: Inheritance

From: Jeen Broekstra <jeen@aduna.biz>
Date: Wed, 06 Apr 2005 11:28:14 +0200
Message-ID: <4253ABAE.8030109@aduna.biz>
To: Hans Teijgeler <hans.teijgeler@quicknet.nl>
Cc: semantic-web@w3.org

Hans Teijgeler wrote:

> Assume we have:
>  
> myclass:PassengerVehicle  rdf:Type  rdfs:Class
> myclass:FourPassengerVehicle  rdfs:subClassOf  myclass:PassengerVehicle 
> myclass:FourPassengerVehicle  myprops:seats  "4" 

This is incorrect - or at least, probably not what you intended. Here, 
you are assigning four seats to the *class* FourPassengerVehicle. This 
does _not_ express that instances of this class have four seats.

> myclass:Volkswagen  rdfs:subClassOf  myclass:FourPassengerVehicle 
> myobjects:myCar  rdf:Type  myclass:Volkswagen 
>  
> then:
> 
>     * does "normal" RDF/RDFS-compliant software "know" that all
>       instances of myclass:Volkswagen have 4 seats?
 >     * and does it know that myCar has four seats?

No. It does not even know that instances of FourPassengerVehicles have 
four seats.

What you are looking for is a cardinality constraint. This is not 
expressible in RDF/RDFS unfortunately, you will need OWL for this.

> or in other words: does specialization (rdfs:subClassOf) and typing 
> (rdf:Type) actually and reliably lead to inheritance of properties?

It does, actually, but only in a very limited fashion, not in the way 
you want it. Using rdfs:domain and rdfs:range properties can be 
coupled with classes, and these are inherited.

In your example, you could add:

myprops:seats rdfs:domain myClass:PassengerVehicle.

...indicating that the seats property can be used on instances of 
PassengerVehicle. It will by inference be true that it can also be 
used on any instances of subtypes of PassengerVehicle.

An additional 'difficulty' if you are coming from an OO/closed-world 
mindset is that in RDF, domain and range are not actual restrictions: 
if you have the above domain restriction, it is still perfectly legal 
to define some instance of an entierely different class, say, 
myClass:dinnerTable, and have its instances use the seats property. 
Most RDF processors will not interpret this as an error, but will 
infer that your dinnerTables are PassengerVehicles.

...which may or may not be what you intended :)

> PS I have been unable to locate such "normal" software (IDE, validators, 
> browsers, etc.) that can be used without being a programmer (I'm a data 
> modeller) Any hints?

There are a couple of RDF/RDFS editors around. Most editing 
environments actually deal with more powerful SW languages, like OWL, 
but are still useful when only using RDF. Protege 
(http://protege.stanford.edu/) is one.

As for browsers: I am not sure what you would expect such tools to do. 
There are no generalized RDF browsers that I am aware of, but if you 
explain the type of functionality that you are after, I'm sure someone 
on this list will pipe up :)

HTH.

Jeen
-- 
Jeen Broekstra          Aduna BV
Knowledge Engineer      Julianaplein 14b, 3817 CS Amersfoort
http://aduna.biz        The Netherlands
tel. +31(0)33 46599877  fax. +31(0)33 46599877
Received on Wednesday, 6 April 2005 09:26:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 07:41:45 UTC