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

Re: RDF and polymorphism

From: Pierre-Antoine CHAMPIN <champin@bat710.univ-lyon1.fr>
Date: Fri, 05 May 2000 10:54:13 +0200
Message-ID: <39128C35.280AADF3@bat710.univ-lyon1.fr>
To: R.van.Dort@Everest.nl
CC: www-rdf-interest@w3.org
R.van.Dort@Everest.nl wrote:
> In my knowledge RDF does not support polymorphism.
> Properties are identified by their name.
> When you are using domain and range for a property, this forces you to
> define separate propertynames for each domain and/or range.
> Isn't this a big handicap with respect to the expressiveness of RDF?

this is not entirely true :
you can set as many domains as you want to a property,
including if you are not the property's creator.
So you can extend any property to apply it any class if you want.
Is it not polymorphism ?

on the other hand, you can not extend the range
(though you can *retrict* it by subProperty'ing the property, as Dan mentionned)
but if two properties take their values in different classes,
is it very useful to consider them the same ?

scenario :

Arthur defines the foolowing schema:

<rdfs:Class   rdf:ID="JpegImage"/>
<rdfs:Class   rdf:ID="ImageSource"/>
<rdf:Property rdf:ID="source">
    <rdfs:domain rdf:resource="#JpegImage"/>
    <rdfs:range  rdf:resource="#ImageSource"/>
<ImageSource rdf:ID="scanner"/>
<ImageSource rdf:ID="d-camera"/>
<ImageSource rdf:ID="generated"/>

Bruce defines another schema:

<rdfs:Class rdf:ID="GifImage"/>
<rdf:Description about"http://arthur/schema/source">
    <rdfs:domain rdf:resource="#GifImage"/>
<a:ImageSource rdf:ID="screenshot" xmlns:a="http://arthur/schema/" />

Charles defines another schema:

<rdfs:Class   rdf:ID="SoundFile"/>
<rdfs:Class   rdf:ID="SoundSource"/>
<rdf:Property rdf:ID="source">
    <rdfs:domain rdf:resource="#SoundFile"/>
    <rdfs:range  rdf:resource="#SoundSource"/>
<SoundSource rdf:ID="voice"/>
<SoundSource rdf:ID="music"/>

Bruce did use polymorphism by reusing a:source property,
and applying it to a distinct class
(I don't assume there exist a common supercalss Image,
 since you don't control other people's schema,
 and such a superclass does not exist in Arthur's schema)
He even defined new ImageSources for his needs.

Charles, on the other hand, had to define his own 'source' property
(which is not a name conflict since they have diiferent namespaces).
He could have extended a:source's domain just like Bruce,
but he didn't want to because the intended range was not the same.
And indeed, the property *is not* the same !
a:source adresses the way a *file* was generated
c:source adresses the way the *content* sound of the file was generated
they don't only apply to different application domains (image/sound)
- which would be a sufficient reason to consider them different,
they also have a complete different semantics.

So I believe RDF adresses polymorphism in a reasonable way.


PS: to enlarge the debate (and may be make this mail even longer),
I write Daniel's schema, trying to grab and generalize th 3 schemas above

<rdf:RDF xmlns:a="http://arthur/schema/"

<rdfs:Class rdf:ID="MediaFile"/>
<rdfs:Class rdf:ID="ImageFile"/>

<rdf:Description about="http://arthur/schema/JpegImage">
    <rdfs:subClassOf rdf:resource="#ImageFile"/>
<rdf:Description about="http://bruce/schema/GifImage">
    <rdfs:subClassOf rdf:resource="#ImageFile"/>
<rdf:Description about="http://charles/schema/SoundFile">
    <rdfs:subClassOf rdf:resource="#MediaFile"/>

<rdf:Property ID="fileSource">
    <rdfs:domain rdf:resource="#MediaFile"/>
<rdf:Property ID="contentSource">
    <rdfs:domain rdf:resource="#MediaFile"/>

<rdf:Description about="http://arthur/schema/source">
    <rdfs:subPropertyOf rdf:resource="#fileSource"/>
    <rdfs:domain        rdf:resource="#ImageFile"/>
<rdf:Description about="http://charles/schema/source">
    <rdfs:subPropertyOf rdf:resource="#contentSource"/>


note that extending the domain of a property (cf http://arthur/schema/source)
can be used not only to apply it do a *distinct* class,
but also to a superclass, thus making the property more general

--- Quid quid Latine dictum sit, altum viditur
    Whatever is said in Latin sounds important.
Received on Friday, 5 May 2000 04:51:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:07:29 UTC