I am running a query to select all graphs using filter exists, like this
SELECT * WHERE {
graph ?g { filter exists { ?s ?p ?o } }
}
but its response is
{
"head": {
"vars": [
"g"
]
},
"results": {
"bindings": [
{}
]
}
}
and I am pretty sure that the triplestore store has graphs.
Note: the more classic query works but takes a while, so I was hoping this would improve performance.
select distinct ?g where {
graph ?g {
?s ?p ?o
}
}
I double-checked on Jena Fuseki and there the filter exists works.
select distinct ?g where { graph ?g { } }- this query is also highly optimized on Jena do do just what it has to do as efficiently as possibleselect distinct ?g where { graph ?g { } }but that never worked on Virtuoso nor on GraphDB. I was trying to find another way. The "pretty sure" means that there are graphs as I mentioned that the?g { ?s ?p ?o }query works.SELECT DISTINCT ?g WHERE { GRAPH? g { ?s ?p ?o } }