Unexpected query result using reasoning


(Andreas van der Hoeven) #1

I have a very simple ontology that contains the following statements:
:class_x
rdf:type owl:Class ;
rdfs:comment “test class:this class is going to be renamed” ;
rdfs:label “Test class” ;
rdfs:subClassOf owl:Thing ;
.
:class_x1
rdf:type owl:Class ;
rdfs:comment “test class:this class is the new name of classx” ;
rdfs:label “Test class 1” ;
rdfs:subClassOf owl:Thing ;
owl:equivalentClass :class_x ;
.
:class_x_individual
rdf:type :class_x ;
.
:class_x_property
rdf:type owl:DatatypeProperty ;
rdfs:comment “Test property for class_x” ;
rdfs:domain :class_x ;
rdfs:label “Test” ;
rdfs:range xsd:string ;
.

In addition, there is a bunch of other properties that are not in scope for the test and do not relate to any of the entities above:
:international_transport_stops
rdf:type owl:DatatypeProperty ;
:catchment catchment:walk_900s ;
:feature geospatial:international_transport_stop ;
:operation “count” ;
system:technical_label “international_transport_stops” ;
rdfs:comment “Number of international public transport stops in a given catchment” ;
rdfs:label “International Public Transport Stops” ;
rdfs:range xsd:integer ;
rdfs:subPropertyOf :scoring_aggregations ;
.
:education
rdf:type owl:DatatypeProperty ;
:catchment catchment:car_1200s ;
:catchment catchment:car_1500s ;
:catchment catchment:car_1800s ;
:catchment catchment:car_900s ;
:catchment catchment:walk_1800s ;
:catchment catchment:walk_900s ;
:feature geospatial:education ;
:operation “count” ;
system:technical_label “education_facilities” ;
rdfs:comment “Number of education facilities in a given catchment” ;
rdfs:label “Education Facilities” ;
rdfs:range xsd:integer ;
rdfs:subPropertyOf :aggregations ;
.
etc

When I run the following query:
select ?p
where {
?p rdfs:domain aggr:class_x.}

without the reasoner, I get the :class_x_property as a result.
However, turning on the reasoner results in a long list of properties, including :education and :international_transport_stop, owl:top and bottomProperty and the :class_x_property.

When running:
stardog reasoning explain test C:\Users\avand\Documents\Software\stardog-5.3.3\oops\reasoning.ttl
whereas reasoning.ttl contains the following statement:
http://test.io/aggr#international_transport_stops rdfs:domain http://test.io/aggr#class_x.

the result is:
Input axiom is not inferred; nothing to explain.
I am using reasoning type = SL and all the rest of options is default in that section.


(Pavel Klinov) #2

Hi Andreas.

Here’s what I got with a simpler version of your data (it’s at the end of the post):

$ sq test "select * {?p rdfs:domain <http://example.com/class_x> . }"
+-------------------+
|         p         |
+-------------------+
| :class_x_property |
+-------------------+

Query returned 1 results in 00:00:00.046
$ sq -r test "select * {?p rdfs:domain <http://example.com/class_x> . }"
+--------------------------+
|            p             |
+--------------------------+
| owl:bottomDataProperty   |
| :class_x_property        |
| owl:bottomObjectProperty |
+--------------------------+

Query returned 3 results in 00:00:00.060

The object bottom property is there because it is by definition unsatisfiable so its domain (that is, the empty set) is vacuously a subset of class_x (the presence of the bottom data property is likely a bug). But the main point is that I don’t get :international_transport_stop or :education with this.

My guess is there’re inferences via rdfs:subPropertyOf which follow from your data but not from the fragment you posted. In the extreme case the properties could be unsatisfiable and thus answers to the query. You can test that by running :international_transport_stop rdfs:subPropertyOf ?p or similar queries.

It’s a separate problem why the explanation fails. We’ll look into this once we understand how reasoning works in your case.

Cheers,
Pavel


@prefix : <http://example.com/> .
@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#> .

:class_x
rdf:type owl:Class ;
rdfs:comment "test class:this class is going to be renamed" ;
rdfs:label "Test class" ;
rdfs:subClassOf owl:Thing .

:class_x1
rdf:type owl:Class ;
rdfs:comment "test class:this class is the new name of classx" ;
rdfs:label "Test class 1" ;
rdfs:subClassOf owl:Thing ;
owl:equivalentClass :class_x .

:class_x_individual
rdf:type :class_x .

:class_x_property
rdf:type owl:DatatypeProperty ;
rdfs:comment "Test property for class_x" ;
rdfs:domain :class_x ;
rdfs:label "Test" ;
rdfs:range xsd:string  .

:international_transport_stops
rdf:type owl:DatatypeProperty ;
:operation "count" ;
rdfs:comment "Number of international public transport stops in a given catchment" ;
rdfs:label "International Public Transport Stops" ;
rdfs:range xsd:integer ;
rdfs:subPropertyOf :scoring_aggregations .

:education rdf:type owl:DatatypeProperty ;
:operation "count" ;
rdfs:comment "Number of education facilities in a given catchment" ;
rdfs:label "Education Facilities" ;
rdfs:range xsd:integer ;
rdfs:subPropertyOf :aggregations .

(system) #3

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