Hello, I am using Jena for interacting with an ontology, and I am looking for a way to find out weather two OntClasses are connected with each other with an object property, or not. Do you know if there is a function that does that?
Actually, I am looking for a way to know weather a SPARQL query has no answer because there are no instances of the requested type, or because the connection described at the query does not exist at all. I am not sure if I have explained the question well, so I will also add an example for better understanding. Example: If we have the query "prefix class: <http://www.semanticweb.org/ontologies/2011/5/Ontology1309170660326.owl#> select ?k where{?k rdf:type class:entity. ?atr rdf:type class:attribute. ?k class:hasAttribute ?atr.}" If the result is blank, there are 2 cases: 1)There are no instances satisfying the described relationship in the ontology.2)There classes "entity" and "attribute" are not connected with the property "hasAttribute". How can I distinguish between these cases each time I set a query? Thank you in advance for the help, Rafaila
