0

I am using CREATE GRAPH to create a new graph in sparql. Which gives me success update succeeded. But when i query for all the graphs i cant find it. I am using SELECT and Union to query. I am using Fuseki server.

Kinuthia
  • 61
  • 10

1 Answers1

1

If you have created the graph but have not yet added any data to it, the query pattern GRAPH ?g {?s ?p ?o} won't match the graph, because ?s ?p ?o can not be bound to anything.

The triplestore you are accessing via Fuseki server presumably does not really support the notion of an 'empty graph' (most triplestores don't, although technically it's allowed by the SPARQL standard). The CREATE operation returns true but effectively does nothing. Only when you start actually adding data to the graph is it really created.

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • 1
    Note that Fuseki is the web server component so whether empty graphs exist is a detail of the configured underlying storage. The typical backing storage for Fuseki is TDB which does not have a notion of empty graphs – RobV Nov 24 '14 at 09:36
  • @RobV, yep, we explored that a bit in the answer to this question: http://stackoverflow.com/questions/27080839/what-is-the-sparql-query-to-check-if-a-graph-exists-and-return-a-message . I've modified my answer to make this more clear. – Jeen Broekstra Nov 24 '14 at 21:38