How to recover the URI of all named graphs with SPARQL? And how can I recover every quad (subject predicate object graph) of my triplestore with SPARQL?
Asked
Active
Viewed 392 times
0
-
3Well, do you really mean "recover"? Or did you mean "discover"? `select disitnct ?g {graph ?g {?s ?p ?o}}` should return all graphs. All quads is almost the same: `select ?s ?p ?o ?g {graph ?g {?s ?p ?o}}` – UninformedUser Oct 04 '17 at 19:41
-
2AKSW, with your query, your are missing the empty graphs. – Antoine Zimmermann Oct 04 '17 at 20:17
-
And there is a typo as well...thanks. This query then maybe: `select ?g {graph ?g {}}` – UninformedUser Oct 05 '17 at 03:27
-
4Possible duplicate of [What is the SPARQL query to get the name of all graphs existing in my triplestore?](https://stackoverflow.com/questions/32274562/what-is-the-sparql-query-to-get-the-name-of-all-graphs-existing-in-my-triplestor) – Stanislav Kralin Oct 05 '17 at 03:53
-
2@AntoineZimmermann Stores don't necessarily store empty graphs and the specs explicitly allow for this so even if you modify the query to `select distinct ?g { graph ?g { } }` it doesn't guarantee to return empty graphs – RobV Oct 05 '17 at 09:05