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:


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é?


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

May you please provide the query you are doing?


Thanks for the reply Lorenzo.

I am using the default (SL):


And the query is a simple:


select * where {
    ?s a :EU

The individual info is:

Here is the complete ontology:

@prefix stardog: <tag:stardog:api:> .
@prefix owl: <> .
@prefix rdf: <> .
@prefix rdfs: <> .
@prefix xsd: <> .
@prefix : <> .

<> a owl:Ontology .

<> a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:range xsd:string .

<> a owl:Class .

<> a owl:Class ;
    owl:equivalentClass [
        a owl:Class ;
        owl:intersectionOf ( <> [
            a owl:Class ;
            owl:unionOf ( [
                a owl:Restriction ;
                owl:onProperty <> ;
                owl:hasValue "Portugal"
            ] [
                a owl:Restriction ;
                owl:onProperty <> ;
                owl:hasValue "Spain"
            ] )
        ] )
    ] .

<> a <> , owl:NamedIndividual ;
    <> "Morroco" .

<> a <> , owl:NamedIndividual ;
    <> "Portugal" .

<> a <> , owl:NamedIndividual ;
    <> "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.

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.


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.