Re: Property and Value Inheritance down Subclasses

On 8 Mar 2010, at 15:32, Azhar Jassal wrote:

> Hi,
>
> So for instance, with the code below, I want <urn:ITEM:1234:REV-1>  
> to inherit the value of myitem:title from its parent..
>
> you need to be more specific: what do you mean by this?
>
> <urn:ITEM:1234:REV-1> is a child of <urn:ITEM:1234:info>.


no, it isn't a child in *any* sense: <urn:ITEM:1234:REV-1>  happens to  
be an instance of a subclass of the class that <urn:ITEM:1234:info>  
was declared to be an instance of....this is a huge difference  
because, in OWL, an individual

- can be an instance of various classes and, in particular,
- can be inferred to be an instance of a far more specific class than  
it was declared to be an instance of.

> They have the same properties (say title, price).

no, <urn:ITEM:1234:REV-1> has neither titles nor price! You define the  
domain & range of myitem:title, but this doesn't mean that an instance  
of myitem:info  has to have a title!

> If there is a new revision of the product (say the title or price  
> has changed), then only the element that has changed is recorded in  
> REV-1.

Aaaah, so here we come closer: what you want to have is one, say  
document, and its different versions...

ok, so there is no way to express this *in one OWL ontology*. You can  
have a (suitably modelled) OWL ontology, and use the OWL API to  
implement, say "change-title(doc,title)" or "update- 
document(doc,...)"...

But OWL is a monotonic formalism: if you can infer something from an  
OWL ontology (e.g., that document x has titles t), then *adding* stuff  
will always *preserve* this inference.

> So if the title has not changed, then it has no value in REV-1 and I  
> would like the title to be inherited from <urn:ITEM:1234:info>. If  
> there is a REV-2, then it should inherit the title from REV-1 should  
> it not have one..
>
> Basically I'm trying to achieve property propagation..
>

yes - but you look for 'default propagation along latest version' and  
thus 'inheritance' (as you call it) won't help.

> you have two instances, <urn:ITEM:1234:info> and <urn:ITEM: 
> 1234:REV-1>, of the classes myitem:info and of one of its subclasses  
> myitem:rev, respectively. Do you want <urn:ITEM:1234:REV-1> have  
> *the same value* for myitem:title as <urn:ITEM:1234:info>? This  
> isn't what is commonly understood as inheritance? If you really want  
> to "infer" that
>
> Yes I would like <urn:ITEM:1234:REV-1> to inherit its title from <urn:ITEM:1234:info 
> >, and say there is a new title at REV-1, I want to specify it.. or  
> can you not adjust triple values?
>

yes, you need to 'adjust' your ontology, and I'd suggest to do this  
through the OWL API (and not on a 'per triple' basis), and to use   
'subpropertychains': so, I'd say you model a document as an individual  
having versions (at least 1), on of which is 'latest' (and which need  
to be updated accordingly which have parts (abstracts, intros,  
sections,...) and other aspects (authors, copyrights,...) and then use  
property chains to express, e.g., that a documents authors are the  
authors of any parts of the latest version...

> I think maybe I've confused myself with the possibilities of OWL  
> classes, coming from a OOP background..
>

Perhaps.

Cheers, Uli

> On Mon, Mar 8, 2010 at 1:58 PM, Uli Sattler <sattler@cs.man.ac.uk>  
> wrote:
> Hi Azhar,
>
> a couple of suggestions:
>
> 1) read the OWL primer http://www.w3.org/TR/2009/REC-owl2-primer-20091027/ 
>  or follow an OWL tutorial, look at existing examples
>> So for instance, with the code below, I want <urn:ITEM:1234:REV-1>  
>> to inherit the value of myitem:title from its parent..
>
> you need to be more specific: what do you mean by this?
>
>> So after inference <urn:ITEM:1234:REV-1> returns the myitem:title  
>> value of "Original Name".
>>
>> Please can someone show me how I should write this in Triples, as  
>> what I have below does not give me a title value for <urn:ITEM:1234:REV-1 
>> >after reasoning by Pellet.. Any help or guidance will be highly  
>> valued!
>>
>
> you have two instances, <urn:ITEM:1234:info> and <urn:ITEM: 
> 1234:REV-1>, of the classes myitem:info and of one of its subclasses  
> myitem:rev,  respectively. Do you want <urn:ITEM:1234:REV-1> have  
> *the same value* for myitem:title as <urn:ITEM:1234:info>? This  
> isn't what is commonly understood as inheritance? If you really want  
> to "infer" that
>
> <urn:ITEM:1234:REV-1>  myitem:title "Original Name"
>
> then you would need to use some work-around, I am afraid...this is  
> nothing supported by OWL directly. One of the questions you'd need  
> to ask is whether you are really using 'classes' in the best way, or  
> whether perhaps <urn:ITEM:1234:REV-1> is a *part* of <urn:ITEM:1234:info 
> >?
>
> Cheers, Uli
>
>
>> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
>> @prefix owl: <http://www.w3.org/2002/07/owl#> .
>> @prefix myitem: <http://www.myitem.com/meta/> .
>> @prefix dc: <http://purl.org/dc/elements/1.1/> .
>>
>> myitem:info rdf:type rdf:Class .
>> myitem:title rdf:type rdf:Property ..
>>
>> myitem:title rdfs:domain myitem:info .
>> myitem:title rdfs:range dc:title .
>>
>> myitem:rev rdfs:subClassOf myitem:info .
>>
>> <urn:ITEM:1234> rdf:type myitem:Product .
>>
>> <urn:ITEM:1234> dc:identifier <urn:ITEM:1234> .
>>
>> <urn:ITEM:1234:info> rdf:type myitem:info .
>> <urn:ITEM:1234:info> myitem:title "Original Name" .
>>
>> <urn:ITEM:1234:REV-1> rdf:type myitem:rev .
>
>

Received on Monday, 8 March 2010 16:00:01 UTC