You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Jit K <jk...@gmail.com> on 2020/11/19 17:54:29 UTC

How to get list of all NamedGraphs using RDFConnectionRemote/Fuseki

Hi,

When using RDFConnectionRemote/Fuseki how can I get the list of all NamedGraphs?

From looking into the requests sent from Fuseki UI, I found out following query 

select ?g (count(*) as ?count) {graph ?g {?s ?p ?o}} group by ?g

Is there any API available to get this information like for LOCAL RDFConnection I can use Dataset.listNames()?

Thanks,
JK

Re: How to get list of all NamedGraphs using RDFConnectionRemote/Fuseki

Posted by Jit K <jk...@gmail.com>.
Hi Andy,

Thank you for your detailed explanation.

JK

On 2020/11/19 21:34:32, Andy Seaborne <an...@apache.org> wrote: 
> Hi JK,
> 
> The SPARQL query:
> 
>      SELECT ?g  { GRAPH ?g {} }
> 
> will get all the graph names.
> 
> A remote RDFConnection does not preovide a Dtaset abstraction - and even 
> if it did, the listNames would be the query above.
> 
> The form "GRAPH ?g {}" is a special case in the SPARQL algebra.
> 
> In Fuseki, "GRAPH ?g {}" is still a dataset scan because the answer is 
> exact within the transaction and not some special case caching.
> 
>      Andy
> 
> 
> On 19/11/2020 17:54, Jit K wrote:
> > Hi,
> > 
> > When using RDFConnectionRemote/Fuseki how can I get the list of all NamedGraphs?
> > 
> >  From looking into the requests sent from Fuseki UI, I found out following query
> > 
> > select ?g (count(*) as ?count) {graph ?g {?s ?p ?o}} group by ?g
> > 
> > Is there any API available to get this information like for LOCAL RDFConnection I can use Dataset.listNames()?
> > 
> > Thanks,
> > JK
> > 
> 

Re: How to get list of all NamedGraphs using RDFConnectionRemote/Fuseki

Posted by Andy Seaborne <an...@apache.org>.
Hi JK,

The SPARQL query:

     SELECT ?g  { GRAPH ?g {} }

will get all the graph names.

A remote RDFConnection does not preovide a Dtaset abstraction - and even 
if it did, the listNames would be the query above.

The form "GRAPH ?g {}" is a special case in the SPARQL algebra.

In Fuseki, "GRAPH ?g {}" is still a dataset scan because the answer is 
exact within the transaction and not some special case caching.

     Andy


On 19/11/2020 17:54, Jit K wrote:
> Hi,
> 
> When using RDFConnectionRemote/Fuseki how can I get the list of all NamedGraphs?
> 
>  From looking into the requests sent from Fuseki UI, I found out following query
> 
> select ?g (count(*) as ?count) {graph ?g {?s ?p ?o}} group by ?g
> 
> Is there any API available to get this information like for LOCAL RDFConnection I can use Dataset.listNames()?
> 
> Thanks,
> JK
>