Hi,

I am using TDB and I have two ontologies, the NCI thesaurus and my own ontology 
(EC, created using Protege), both in RDF/XML format.Here is what I did so far:

- Imported both ontologies into the same TDB store, using different graphs (for 
this example http://nci.gov and http://ec.org)

 - I can issue SparQL queries without any problems (listing the subjects, 
predicates and objects; restricting searches etc.), also across graphs.

I am using a SparQl like this to get a certain subject:

SELECT ?s
FROM NAMED http://nci.gov
FROM NAMED http://ec.org

WHERE {
   GRAPH http://nci.gov {   ?s nci:Preferred_Name "Overall"^^xsd:string }
}

And my Jena code is: 

ResultSet rs = qe.execSelect();
        while(rs.hasNext()){
            QuerySolution qs = rs.next();
            Resource subject = qs.get("s").asResource();
            StmtIterator iter = subject.listProperties();
            System.out.println(iter.hasNext());
        }

The iterator.hasNext() call returns false and all other attempts to get a 
property (e.g. the preferred name property) return null.

Earlier in my project, I loaded both ontologies into the default graph and did 
not use named graphs and the approach used to work to get properties. Now 
listProperties() returns nothing even though a modified SparQl that returns any 
predicate along with the subject shows all expected properties and their URIs 
exactly like I am using them for getProperty() calls.

Does anybody know why listProperties returns null when the ontologies are 
loaded into two separate graphs, but it works if both are loaded into the 
default graph?

Thanks in advance for any help!

-Wolfgang


Reply via email to