W3C home > Mailing lists > Public > www-rdf-interest@w3.org > September 2004

Re: AW: WG: I need a RDFS Parser/Validator

From: Alistair Miles <a.j.miles@rl.ac.uk>
Date: Thu, 02 Sep 2004 14:00:32 +0100
Message-ID: <41371970.9080705@rl.ac.uk>
To: www-rdf-interest@w3.org
I hacked up a validator for SKOS Core [1] that includes RDFS 'validation' (i.e. 
issues a warning if instances don't agree with resource type domains and ranges, 
and an error if datatype values don't agree with datatype ranges) ... it's not 
much, but you can get it from:

http://esw.w3.org/topic/SkosValidator

I built it using Jena, which btw has some neat rule-based support for building 
custom validation stuff.

Al.

[1] http://www.w3.org/2004/02/skos/core/



Jeen Broekstra wrote:

> 
> Kianoush Eshaghi wrote:
> 
>> Hi Richard!
>>
>>
>>> Note that the correct behaviour is not to treat range and domain as
>>> constraints, but for inference. E.g.
>>>
>>> :carType a           owl:ObjectProperty ;
>>>          rdfs:domain :Car .
>>> :x       :carType    :Saloon .
>>> ==========================================
>>> :x       a           :Car .
>>>
>>> This is a common misunderstanding in validation. When "car" and
>>> "person" aren't disjoint, and a property such as the above is applied
>>> to a person, it is quite logical to infer that the subject is
>>> both car
>>> and person.
>>
>>
>>
>> You have alredy appointed that "carType" must be only applied to
>> subjects, which instances of Car must be. A RDFS validator should be
>> able to catch some violation such as the following misemployment:
>>
>> <f:Person rdf:ID="me">
>>     <f:carType rdf:resource="saloon"/>
>> </f:Person>
> 
> 
> As Richard pointed out, rdfs:domain and rdfs:range are not usually used 
> in this way. In your example, the result according to the standard 
> interpretation would simply be that "me" is both of type Person and Car.
> 
> Nothing stops you from doing your kind of validation anyway of course, 
> but it is not the default interpretation of the meaning of domain and 
> range, which probably explains why so very few tools have support for 
> it. I'd say your best best is to either look at ICS-FORTH's RVP (I don't 
> have personal experience with it but I understand it does exactly this 
> kind of validation), or use one of the RDF toolkits (Jena, Redland, 
> Sesame, etc.) and build your own validator. Given that most toolkits 
> have built-in support for RDF(S) inferencing, this shouldn't be too 
> difficult.
> 
> By the way, the validation you require goes beyond parsing, since it 
> requires knowledge of schema semantics. For example, if in your example 
> we had a definition somewhere that said that Person was a subClassOf 
> Car, then the domain restriction would not be 'violated'. Simple parsing 
> is therefore not enough to do this kind of validation.
> 
> Best regards,
> 
> Jeen

-- 
Alistair Miles
Research Associate
CCLRC - Rutherford Appleton Laboratory
Building R1 Room 1.60
Fermi Avenue
Chilton
Didcot
Oxfordshire OX11 0QX
United Kingdom
Email: a.j.miles@rl.ac.uk
Tel: +44 (0)1235 445440

Received on Thursday, 2 September 2004 21:45:34 GMT

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