Reasoning : can't find inferred properties

(Saad Bahir) #1


I am new to Stardog
I was able to upload an ontology and execute queries.
I tried to test reasoning results and compare the results to Protégé reasoner.
In Protégé, I can see the inferred properties, but not in stardog.

Here is my query in stardog :
stardog query --reasoning myDB “select * where {:action ?p ?o}”
(I am looking for inferred properties on action)

Thank you


(Jess Balint) #2

Hi Saad,

Welcome to the Stardog community. Your question is clear, but we will need more information to figure out why there are no results for your query.

Can you please share:

  • Triples in the database
  • Axioms in your ontology
  • Expected results from query


(Saad Bahir) #3

Hello Jess

Thank you for answering back.
I uploaded here a simplified version of my ontology structure.
When I upload the triples in Protégé and run the reasoner, I can see inferred properties under “Patient” class instance (here, the inferred property is “person_medicated”)
I run the same steps through Stardog (upload the triples and query the instance properties) but I don’t have the expected inferred property.



onto_test2.rdf (8.4 KB)
onto_test2.rdf (8.4 KB)

(Saad Bahir) #4

Here is an extract of the log file stardog.log
WARN 2018-08-07 16:03:20,990 [stardog-user-4] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: EquivalentClasses(www:person_medicated, and(www:person, or(some(www:PatientTakesMedication,www:drug_k), some(www:PatientTakesMedication,www:other_drugs))))

So I might need to change the axiom from SL to DL

is there anyway to do it in the command line ?


(Pavel Klinov) #5

No, you need to change the database option as explained here:

Changing to DL will work but is not a good move in general (see the above link). The major problem in this axiom is the disjunction. You might be able to get required inferences if you weaken your axiom into

SubClassOf(and(www:person, some(www:PatientTakesMedication,www:drug_k)), www:person_medicated)


SubClassOf(and(www:person, some(www:PatientTakesMedication,www:other_drugs)), www:person_medicated)

This is in SL (in fact, in OWL EL) and should be more scalable.

Your query select * where {:action ?p ?o} is also problematic because the predicate variable is not bound. Such queries, although supported by Stardog, are disallowed in the OWL Entailment Regimes spec because there’s no efficient evaluation procedure for them (strictly speaking, they are not first-order conjunctive queries). You may want to execute a series of more specific queries instead, each for a specific property.


PS. Comparing results to Protege makes sense to verify correctness but you should always keep in mind that there’s a substantial difference between working with a (in-memory) reasoner and a database. The latter by design has to deal with much tougher scalability challenges so some expressivity compromises are inevitable.