Hi all,

I've got a simple problem and looking forward to a "good" solution. Hopefully someone can give me a useful hint... ;-)

I've got two TDB backed models both containing several named graphs: A and B

All I want to do now is querying the "union" of A and B for statements with SPARQL or just by calling listStatements(). Can you tell me (perhaps by sending a short piece of code) how to do it the best way?

My current solution is doing it this way (pseudo code):

- build union A' of all named graphs within A
- build union B' of all named graphs within B
- build union AB of A' and B'
- query resulting graph/model AB (its a OntModel that calculates the transitive closure)

Also this algorithm should work I think it is not very fast. Therefore I'm very interested in better solutions/approaches.


Looking forward to your responses,

Thorben

Reply via email to