[jira] [Comment Edited] (JENA-1499) The TIM dataset retains a memory of named graphs after deleting all quads.

2018-03-08 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16391377#comment-16391377
 ] 

Andy Seaborne edited comment on JENA-1499 at 3/8/18 3:59 PM:
-

The other case is the default in-memory dataset ({{DatasetFactory.create()}}.

It's a one line change to {{DatasetGraphMap.listGraphNodes}} to make not reveal 
empty graphs. 

{{containsGraph}} already works - it looks for quads not for graph in the map. 
(It could be slightly done as an override.)

JENA-1500 and PR#376 (which includes datasets tests including for here).

{noformat}
 == plain
 Contains: false
 – listGraphNodes
 (none)
 – dump
 (empty)
 
 == general
 Contains: true
 – listGraphNodes
 [http://example/g]
 – dump
 <[http://example/g]> {
 }
{noformat}

With PR 374, TIM and TDB are the same as "plain".


was (Author: andy.seaborne):
The other case is the default in-memory dataset ({{DatasetFactory.create()}}.

It's a one line change to {{DatasetGraphMap.listGraphNodes}} to make not reveal 
empty graphs.

{{containsGraph}} already works - it looks for quads not for graph in the map. 
(It could be slightly done as an override.)

{nofomat}
== default
Contains: false
-- listGraphNodes
(none)
-- dump
(empty)

== general
Contains: true
-- listGraphNodes
http://example/g
-- dump
 {
}
{nofomat}

With PR 374, TIM and TDB are the same as "default".


> 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
>Assignee: A. Soroka
>Priority: Minor
>
> 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
(v7.6.3#76005)


[jira] [Comment Edited] (JENA-1499) The TIM dataset retains a memory of named graphs after deleting all quads.

2018-03-07 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16389757#comment-16389757
 ] 

A. Soroka edited comment on JENA-1499 at 3/7/18 4:25 PM:
-

[~andy.seaborne], {{o.a.j.s.core.mem.QuadTableForm.GSPO.listGraphNodes()}} is 
just taking the keys of the GSPO index and returning a stream of them. That's 
why (see above) if there are mappings fro\{{m }}{{Node => Node => Set}} 
with that {{Set}} empty, we're still seeing names of graphs appear at that 
exact method.


was (Author: ajs6f):
[~andy.seaborne], 
{{org.apache.jena.sparql.core.mem.QuadTableForm.GSPO.listGraphNodes()}} is just 
taking the keys of the GSPO index and returning a stream of them. That's why 
(see above) if there are mappings fro{{m }}{{Node => Node => Set}} with 
that {{Set}} empty, we're still seeing names of graphs appear at that exact 
method.

> 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
(v7.6.3#76005)


[jira] [Comment Edited] (JENA-1499) The TIM dataset retains a memory of named graphs after deleting all quads.

2018-03-06 Thread Adam Jacobs (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16388781#comment-16388781
 ] 

Adam Jacobs edited comment on JENA-1499 at 3/7/18 12:43 AM:


>From the API side, I've noticed empty graphs are consistently treated as 
>"unimportant" and are often created superfluously.
{code:java}
Dataset ds = DatasetFactory.create();
ds.containsNamedModel("foo");
ds.removeNamedModel("bar");
Iterator iterator = ds.listNames();
System.out.println(iterator.next());
System.out.println(iterator.next());{code}
As mentioned, this is significant when serializing to TRIG.


was (Author: jaco0646):
>From the API side, I've noticed empty graphs are consistently treated as 
>"unimportant" and are often created superfluously.

 

{{Dataset ds = DatasetFactory.create();}}
{{ds.containsNamedModel("foo");}}
{{ds.removeNamedModel("bar");}}
{{Iterator iterator = ds.listNames();}}
{{System.out.println(iterator.next());}}
{{System.out.println(iterator.next());}}

 

As mentioned, this is significant when serializing to TRIG.

> 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
(v7.6.3#76005)


[jira] [Comment Edited] (JENA-1499) The TIM dataset retains a memory of named graphs after deleting all quads.

2018-03-06 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16388641#comment-16388641
 ] 

Andy Seaborne edited comment on JENA-1499 at 3/6/18 10:41 PM:
--

Could you explain a bit about what {{QuadTableForm.GSPO.listGraphNodes}} is 
doing? I haven't looked at these details of {{QuadTableForm}} before. Can empty 
graphs appear in other ways? Does traversal of {{G\?\?\?}} simply on generate 
quads if the subtree is partial (i.e. empty) some how in {{GS\?\?}} ?




was (Author: andy.seaborne):
Could you explain a bit about what {{QuadTableForm.GSPO.listGraphNodes}} is 
doing? I haven't looked at these details of `QuadTableForm` before. Can empty 
graphs appear in other ways? Does traversal of {{G\?\?\?}} simply on generate 
quads if the subtree is partial (i.e. empty) some how in {{GS\?\?}} ?



> 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
(v7.6.3#76005)