You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Damian Steer (Created) (JIRA)" <ji...@apache.org> on 2012/03/21 12:07:39 UTC

[jira] [Created] (JENA-223) Default memory model will not remove (partially) reified statements

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


>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

        

[jira] [Commented] (JENA-223) Default memory model will not remove (partially) reified statements

Posted by "Andy Seaborne (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235111#comment-13235111 ] 

Andy Seaborne commented on JENA-223:
------------------------------------


I've tracked this from m.removeAll(...) turns to a graph find iterator over reifier and base graph.  iter.remove does not seem to remove the triple from the reifiers fragments list.

(Works for TDB but TDB reification is just an algorithm over the base storage state - there is no "reifier" that stores fragments -- TDB only support ReificationStyle.Standard via GraphBase2+Reifier2 in ARQ's graph extras.  Long term, I'd like to suggest use this or somethign similar for reification and simplify the reifier architecture.)
                
> 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

        

[jira] [Commented] (JENA-223) Default memory model will not remove (partially) reified statements

Posted by "Andy Seaborne (Commented) (JIRA)" <ji...@apache.org>.
    [ 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