Reasoning not working with union of restrictions

I'm using the Reasoning to infer in an individual belongs also to a subclass. In my first case the individuals are instances of the class "Country", and if the name of the individual is equal to "Portugal", it should be inferred that belongs to the subclass of "UE".

And if I run a Sparql query with reasoning in Stardog Studio, it is working as expected:

Now, I add a restriction to the UE subclass, as the name has to be "Portugal" or "Spain" (class="country" and (name="Portugal or name="Spain").

But in this case I don't get back any result, and when I check the query plan, it seems to get lost with the reasoning:

image

I am using Protégé to build the ontology, and the reasoner of Protégé is able to infer this new logic. Is it a problem of the reasoner in Stardog or is it a problem of using in Stardog an ontology built with Protégé?

Hi,

What inference level (SL, DL, …) are you using?

May you please provide the query you are doing?

Lorenzo.

Thanks for the reply Lorenzo.

I am using the default (SL):

image

And the query is a simple:

PREFIX : <http://www.diego.org/country#>

select * where {
    ?s a :EU
}

The individual info is:

Here is the complete ontology:

@prefix stardog: <tag:stardog:api:> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <http://api.stardog.com/> .

<http://www.diego.org/country> a owl:Ontology .

<http://www.diego.org/country#country_name> a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:range xsd:string .

<http://www.diego.org/country#Country> a owl:Class .

<http://www.diego.org/country#EU> a owl:Class ;
    owl:equivalentClass [
        a owl:Class ;
        owl:intersectionOf ( <http://www.diego.org/country#Country> [
            a owl:Class ;
            owl:unionOf ( [
                a owl:Restriction ;
                owl:onProperty <http://www.diego.org/country#country_name> ;
                owl:hasValue "Portugal"
            ] [
                a owl:Restriction ;
                owl:onProperty <http://www.diego.org/country#country_name> ;
                owl:hasValue "Spain"
            ] )
        ] )
    ] .

<http://www.diego.org/country#ind_Morroco> a <http://www.diego.org/country#Country> , owl:NamedIndividual ;
    <http://www.diego.org/country#country_name> "Morroco" .

<http://www.diego.org/country#ind_Portugal> a <http://www.diego.org/country#Country> , owl:NamedIndividual ;
    <http://www.diego.org/country#country_name> "Portugal" .

<http://www.diego.org/country#ind_Spain> a <http://www.diego.org/country#Country> , owl:NamedIndividual ;
    <http://www.diego.org/country#country_name> "Spain" .

As I said before, Protégé is able to infer that Portugal and Spain belong to EU subclass, but I am not being able the replicate the result with Stardog. Maybe I am missing something in Stardog.

Thanks.
I recreated your ontology and I may confirm that I have the same behavior.

But, it actually works if you set the reasoning level to "DL", and with whatever setting of the 'sameas' flag.

Unfortunately, I experienced many times strange and unexpected results with SL reasoning... DL is a little bit more stable but in any case (as SL) will tend to fail (generating exceptions) as soon as your ontology gets bigger and you introduce rules (SWRL or Stardog "Native").

IMHO Stardog's proprietary Pellet3 is still not yet robust enough to enable reasoning over ontologies. In my project I had to set the reasoning environmnent outside Stardog, and use Stardog as triple store for un-reasoned queries only.

Don't know if anyone from community may have different feeling or more strong reply, I stay with my feeling, hoping for new releases in the future.

Lorenzo.

Thanks again for your reply Lorenzo, much appreciated.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.