[
https://issues.apache.org/jira/browse/JENA-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235590#comment-13235590
]
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 right.
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: https://issues.apache.org/jira/browse/JENA-223
> 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("http://example.com/a");
> 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:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira