On 16/01/12 11:42, Marcus Cobden wrote:
I've loaded a TRIG graph using ng4j, but I am finding that reasoning
over it is particularly slow.
After converting the same graph to N-Triples, and working with only jena
models the reasoning is a lot faster.
Underneath, ng4j is using a MultiUnion graph to combine the named
graphs, would this be causing some slowness?
Possibly. A reasoner will ask a lot of find operations and for
MultiUnion each find will be distributed to each graph which does entail
some overhead. If there is any redundancy between the graphs then there
could be duplicated traversals.
You could test if it is MultiUnion or some other aspect of ng4j by
converting the data to an OntModel instead with addSubModel to add each
graph.
I think there might be a case of double-reification going on: MultiUnion
overrides graphBaseFind() to call find() on the wrapped graphs, but
MultiUnion.find() as inherited still checks its reifier.
Is this a genuine source of slowness? Or should I be looking somewhere
else?
Possibly, I would defer to Chris on reifier checking cost. However, my
*guess* is that in the absence of any actual reification would be that
the checks are low cost. Is there any reification?
Presumably you could create a flattened merge graph in code for
reasoning purposes.
Dave