RE: beginer question about inferencing

Hi Yoandy!

I'll answer your two questions in separate mails. Here is my answer to your first question.

>-----Original Message-----
>From: Yoandy Rodriguez [mailto:yrodriguezma@uci.cu]
>Sent: Friday, March 04, 2011 8:45 PM
>To: Michael Schneider
>Cc: public-owl-dev@w3.org
>Subject: RE: beginer question about inferencing
>
>El vie, 04-03-2011 a las 12:17 +0000, Michael Schneider escribió:
>> Hi Yoandy!
>>
>> Not an answer, but I need to ask for clarification. See below:
>>
>> >-----Original Message-----
>> >From: public-owl-dev-request@w3.org [mailto:public-owl-dev-
>> >request@w3.org] On Behalf Of Yoandy Rodriguez
>> >Sent: Thursday, March 03, 2011 5:11 PM
>> >To: public-owl-dev@w3.org
>> >Subject: beginer question about inferencing
>> >
>> >Hello,
>> >
>> >Currently I'm trying to build a model that allows me to make the
>> >following inferences.
>> >"if someone is friend of two people who hates themselves then he is a
>> >neutral person"
>>
>> Do you mean that each friend hates himself reflexively
>("hates(?friend,?friend)"),
>> or rather that the two friends hate each other ("hates(?f1,?f2) and
>hates(?f2,?f1)").
>> I guess, it's the second option, since it then makes more sense to
>stay neutral? :-)

[snip]

>Hello Michael,
>
>What I want to express is something like this:
>friend(?A,?B),friend(A?,?C),hates(?B,C?):-Neutral(?A)

Ok, that's clearer now.

>but without using SWRL or another rule languaje, I figure there must be
>a way of doing it using only OWL (but again, I'm still reading my first
>semantic web book so there's a 99% chance that I'm wrong).

Nice problem for a start! :)

What you want to do here essentially is detecting a circular relationship (beware the ASCII art!):

    A  -- friend -->  B
    :                 I
    :                 I
    =               hates
    :                 I
    :                 v
    A' <-inv(friend)- C

where "inv(p)" is the inverse of a property p. Whenever such a "A friend o hates o inv(friend) A" circle is detected, then A should be inferred to be a member of class Neutral.

In principle, there is a way to express this in OWL 2, but there is a serious caveat, which I will discuss below. 

Here is a solution written in the OWL 2 functional syntax [1]:

    Prefix(ex:=<http://example.org>)

    Ontology (
        Declaration(Class(ex:Neutral))
        Declaration(ObjectProperty(ex:friend))
        Declaration(ObjectProperty(ex:hates))
        Declaration(ObjectProperty(ex:f-h-fi))

        SubObjectPropertyOf(
            ObjectPropertyChain(
                ex:friend ex:hates ObjectInverseOf(ex:friend))
            ex:f-h-fi)

        SubClassOf(
            ObjectHasSelf(ex:f-h-fi)
            ex:Neutral)

        ObjectPropertyAssertion(ex:friend ex:Alice ex:Bob)
        ObjectPropertyAssertion(ex:friend ex:Alice ex:Charly)
        ObjectPropertyAssertion(ex:hates ex:Bob ex:Charly)
    )

And here the same solution in RDF/Turtle:
 
    @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 xsd:  <http://www.w3.org/2001/XMLSchema#> .
    @prefix ex:   <http://www.example.org/> .

    _:o rdf:type owl:Ontology .

    ex:Neutral rdf:type owl:Class .
    ex:friend rdf:type owl:ObjectProperty .
    ex:hates rdf:type owl:ObjectProperty .
    ex:f-h-fi rdf:type owl:ObjectProperty .

    ex:f-h-fi owl:propertyChainAxiom ( 
        ex:friend ex:hates [ owl:inverseOf ex:friend ] ) .
    
    _:circ rdf:type owl:Restriction ;
        owl:onProperty ex:f-h-fi ;
        owl:hasSelf "true"^^xsd:boolean .
    _:circ rdfs:subClassOf ex:Neutral .

    ex:Alice ex:friend ex:Bob .
    ex:Alice ex:friend ex:Charly .
    ex:Bob ex:hates ex:Charly .

What is done here is defining a helper property "ex:f-h-fi" in terms of the property chain "ex:friend o ex:hates o inv(ex:friend)" and, since this alone is not guaranteed to lead to a circular structure, we additionally put a self-restriction on property "ex:f-h-fi", which results in a class consisting of all the individuals ?x for which ex:f-h-fi(?x, ?x) holds, i.e., these individuals are really in the desired circular chain. Last thing we do is making the self-restriction a sub class of class ex:Neutral, so every individual in an ex:f-h-fi circle will also be in the ex:Neutral class.

Sounds good, right? Well, as said, there is caveat: the above is /not/ a valid OWL 2 DL ontology. The issue is that not everything that can be written in the OWL 2 syntax is automatically a valid OWL 2 DL ontology. In our case, it is not allowed to have a self-restriction put on a property that has been defined via a property chain axiom (see Sec. 11.2 of [1]). This syntactic restriction has been made to guarantee computational decidability of core reasoning tasks in OWL 2 DL. Sounds bad, right? :-(

Let me mention that, practically, existing OWL 2 DL reasoners would still be conformant to the OWL 2 DL language, if they would ignore the restrictions and simply try to get as far as possible outside OWL 2 DL. Many OWL 2 DL reasoners actually do some reasoning work outside the limits of OWL 2 DL and some reasoners even parse the above input but, unfortunately, I'm not aware of any OWL 2 DL reasoner that produces the expected reasoning result from the above, namely that ex:Alice is a member of class ex:Neutral. 

What would help here would be an OWL 2 DL reasoner that would really /dare/ to get the result, regardless of any theoretic undecidability results (who dares wins! :-)). Or, alternatively, an OWL 2 Full reasoner would do the job, since in OWL 2 Full the mentioned syntactic restrictions do not exist at all [2]. But that's all speculation, since no reasoner with these features exist so far, so let's see what the future will give us! :-)

However, there is at least one reasoner that is able to produce the expected result: It is the (extended) online OWL 2 RL/RDF rule reasoner by Ivan Herman at [3]. Since the original specification of the OWL 2 RL/RDF rules [4] does not contain rules for self-restrictions, you have to switch on the "OWL extras" on the reasoner homepage to include a rule for this OWL 2 feature. This will make the result appear. It is quite possible that other OWL 2 RL/RDF rule reasoners will give you the result as well, as the corresponding rule for self-restrictions isn't hard to be added. Note, however, that the OWL 2 RL/RDF rules will conversely not give you all the results that you would expect from an OWL 2 DL reasoner. Further, reliant ontology consistency and non-entailment detection is something that you can only expect from an OWL 2 DL reasoner. So both entailment regimes have their advantages and disadvantages.

I know that this is not a perfectly satisfying answer but, I'm afraid, I don't know any better. :)

Cheers,
Michael

[1] OWL 2 Structural Specification 
    (contains functional syntax and definition of OWL 2 DL restrictions): 
    <http://www.w3.org/TR/owl2-syntax/>

[2] OWL 2 RDF-Based Semantics 
    (the semantics of OWL 2 Full): 
    <http://www.w3.org/TR/owl2-rdf-based-semantics/>

[3] Ivan Herman's (extended) OWL 2 RL reasoner:
    <http://www.ivan-herman.net/Misc/2008/owlrl/>

[4] OWL 2 RL/RDF Rules:
    Sec. 4.3 in <http://www.w3.org/TR/owl2-profiles/>

--
Dipl.-Inform. Michael Schneider
Research Scientist, Information Process Engineering (IPE)
Tel  : +49-721-9654-726
Fax  : +49-721-9654-727
Email: michael.schneider@fzi.de
WWW  : http://www.fzi.de/michael.schneider

==============================================================================
FZI Forschungszentrum Informatik an der Universität Karlsruhe
Haid-und-Neu-Str. 10-14, D-76131 Karlsruhe
Tel.: +49-721-9654-0, Fax: +49-721-9654-959
Stiftung des bürgerlichen Rechts
Stiftung Az: 14-0563.1 Regierungspräsidium Karlsruhe
Vorstand: Dipl. Wi.-Ing. Michael Flor, Prof. Dr. rer. nat. Ralf Reussner,
Prof. Dr. rer. nat. Dr. h.c. Wolffried Stucky, Prof. Dr. rer. nat. Rudi Studer
Vorsitzender des Kuratoriums: Ministerialdirigent Günther Leßnerkraus
==============================================================================

Received on Saturday, 5 March 2011 22:43:01 UTC