14

I want to get the name of all existing graphs in my Fuseki server, it should return a message with a list of all graphs name.

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
user3457185
  • 175
  • 1
  • 1
  • 7

2 Answers2

24

I have tried the answer given by Joshua Taylor in Virtuoso, but got nothing.

Virtuoso console screnshot

Maybe it's different between fuseki and virtuoso. So I provide a sparql for virtuoso users who just find the answer like me.

SELECT DISTINCT ?g 
WHERE {
  GRAPH ?g { ?s ?p ?o }
}
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
YJ. Yang
  • 978
  • 2
  • 11
  • 19
13

Without more context, we don't know whether you mean some additional metadata about the "name" of a graph, or what you mean exactly by "a message with a list of all graphs name", but it sounds like you might just want:

SELECT ?g 
WHERE {
  GRAPH ?g { }
}
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Fuseki 3.9 still doesn't report empty graphs (not a complaint, just an observation). Was reading about creating empty graphs (DuCharme's Learning SPARQL, 2nd ed 2013). Thought it would be interesting to try creating an empty graph then listing it as above (no results for an empty graph). Turns out fuseki dataset backups (e.g. creating *.nq.gz) also omit empty graphs. – jgreve Jan 06 '19 at 02:22