A. Soroka commented on JENA-1499:

So, I'm fairly sure why this is happening: all the indexes in TIM are of the 
form {{Map<Node,Map<Node,Set<Node>>>}}. When a quad is deleted, there is 
(currently) no check to see if that {{Set}} ends up empty. An empty {{Set}} 
means that there will still be a named graph present with no actual quads-- 
just as we see. We could add a check in the {{DatasetGraph.delete()}} call 
stack so that if the last quad out of a graph is deleted, theĀ {{Node}} => 
(now-empty) {{Set}} mapping is removed from its {{Map}} and if that {{Map}} is 
now empty the {{Node}} => {{Map}} mapping is removed from the outermost 
{{Map}}. Does that sound like a good move?

> The TIM dataset retains a memory of named graphs after deleting all quads.
> --------------------------------------------------------------------------
>                 Key: JENA-1499
>                 URL: https://issues.apache.org/jira/browse/JENA-1499
>             Project: Apache Jena
>          Issue Type: Bug
>    Affects Versions: Jena 3.6.0
>            Reporter: Andy Seaborne
>            Priority: Major
> Illustration:
> {noformat}
>         DatasetGraph dsg = DatasetGraphFactory.createTxnMem();
>         Quad q = SSE.parseQuad("(:g :s :p :o)");
>         dsg.add(q);
>         dsg.delete(q);
>         Iter.print(dsg.listGraphNodes());
> {noformat}
> prints {{http://example/g}}.

This message was sent by Atlassian JIRA

Reply via email to