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.
The name of a named graph is an IRI, which can be used to identify the graph in queries and updates. In a SPARQL query, all basic statement patterns are always matched against the default graph in the dataset, except when a GRAPH clause is involved.
A SPARQL query may specify the dataset to be used for matching by using the FROM clause and the FROM NAMED clause to describe the RDF dataset. If a query provides such a dataset description, then it is used in place of any dataset that the query service would use if no dataset description is provided in a query.
SPARQL contains capabilities for querying required and optional graph patterns along with their conjunctions and disjunctions. SPARQL also supports extensible value testing and constraining queries by source RDF graph. The results of SPARQL queries can be results sets or RDF graphs.
"PREFIX", however (without the "@"), is the SPARQL instruction for a declaration of a namespace prefix. It allows you to write prefixed names in queries instead of having to use full URIs everywhere. So it's a syntax convenience mechanism for shorter, easier to read (and write) queries.
I have tried the answer given by Joshua Taylor in Virtuoso, but got nothing.
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 }
}
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 { }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With