How to list all all graphs in Virtuoso?

2019-05-30 14:25发布

问题:

When I go to http://localhost:8890/sparql/, there are two fields: Default Data Set Name (Graph IRI) and query. How can I list what all graphs (that go in the former field) are available in my DB? The field is not mandatory and I can just run a query against all namespaces. But I would like to know how to list the graphs available.

The only non-empty graph I was able to run was http://localhost:8890/sparql

For example, in a relational database environment, I believe this kind of info could be retrieved from system tables.

回答1:

As noted in comments, this query will get you a list of all Named Graphs (which, as also noted, are not the same as "namespaces") in the targeted store --

  SELECT  DISTINCT ?g 
   WHERE  { GRAPH ?g {?s ?p ?o} } 
ORDER BY  ?g

You can see live results (limited here to 100 graph names) on the DBpedia endpoint (a very short list, as you would expect) and on URIBurner (a much longer and more varied list).