incubator-jena-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Seaborne (Commented) (JIRA)" <>
Subject [jira] [Commented] (JENA-223) Default memory model will not remove (partially) reified statements
Date Thu, 22 Mar 2012 14:12:22 GMT


Andy Seaborne commented on JENA-223:

Further investigation ...

The iterator returned for the partial reifications is based on a temporary list.  .remove
on this iterator has no effect on the original fragments storage.  A direct fix looks to be
non-trivial, i.e. it's not a few lines of code, it's a design issue.

SimpleBulkHandler.removeAll(graph, Node, Node, Node) is code that creates the iterator and
does the calls to .remove on that iterator.

A possible fix is to issue the remove as present, with afind+iterator.remove, but then to
repeat the .find() call to get a new iterator with any missed triples.  Gather these into
a array, then do a graph-level delete of each triple.

In the normal case, the cost is one extra find() that finds nothing.  It will get the semantics

Long term, if we switch to algorithm-only reification, removalAll() shodul avoid iterator
delete and do deletes in chunk so of, say, 100.

> Default memory model will not remove (partially) reified statements
> -------------------------------------------------------------------
>                 Key: JENA-223
>                 URL:
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 2.7.0
>            Reporter: Damian Steer
>              Labels: reification
> From antiguru on IRC:
> Model m = ModelFactory.createDefaultModel();
> Resource r = m.createResource("");
> r.addProperty(RDF.object, "test1"); // or predicate or subject
> m.removeAll(r, null, null);
> System.err.println(m.size()); // => 1
> Works (returns 0) with:
> ModelFactory.createMemModelMaker(ReificationStyle.Minimal).createDefaultModel();

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message