Reasonner does not infer equivalent class based on restriction

Hi,
On Stardog Studio, I have issues with basic reasoning tasks. I defined Installation to be equivalent to wearing a racket and would like for tom, when wearing a racket, to be classified as Installation :

:Installation rdf:type owl:Class ;
              owl:equivalentClass [ rdf:type owl:Restriction ;
                                    owl:onProperty :wears ;
                                    owl:hasValue :racket
                                  ] .

No way, I tried every configuration : QL, SL, etc.

Did I miss something?

Hi François,

You would need to place your ontology/TBox into the <tag:stardog:api:context:schema> named graph, or change the reasoning.schema.graphs setting on the database from its default. If I do that your query works as intended.

1 Like

Thank you for you answer. I really appreciate.
It's not the first time you help me ! I use Stardog since ages with my student.

With your help, I could manage to set a specific TBox in the correct schema, by querying the following:

INSERT DATA {
    GRAPH <tag:stardog:api:context:schema> {
...

and another query for the ABox, not necessarily in the above schema.

I also discover that, when loading data (I have one unique .ttl coming from Protégé, I could precise the "defaut" context ? I set it to stardog:context:schema and add it to the reasoning.schema.graphs setting. But it sounded as if there were nothing in the database, querying select * where{ ?s ?p ?o} returned nothing. I had to insert the data for the second time, but with Load Data To=stardog:context:default.

Is there an easiest way ?

FR.

François,

The above query queries only the default graph.

To query all named graphs you could write

select * { graph ?g {?s ?p ?o} }

To see how to manage Protege generated Ontologies I refer you to OWL RDF ontology uploaded as database but not visualizing in Explorer - #16 by charl

Please revert back with any questions

Thanks

Joe

François,

You could implement your owl axiom more intuitively as a Stardog Rule as follows.

rule :wearsRacket

if {
  ?x :wears :racket .
}
then {
  ?x a :Installation .
}

You can enter the rule in Studio. Just enter the text above, select the worksheet type as SRS in the bottom right hand corner, select your database and named graph and choose Add Data

Or you can use Designer Rule Builder

You could also enter the rule programatically as

insert data {
    graph <urn:mySchema> # your reasoning schema graph
    {
        :wearsRacket a stardog:rule:SPARQLRule .
        :wearsRacket stardog:rule:content """IF {
            ?x :wears :racket .
        }
        THEN 
        {
            ?x a :Installation .
        }
        """
    }   
}

If you need any help please revert back

Joe