ad-freiburg / qlever

Very fast SPARQL Engine, which can handle very large knowledge graphs like the complete Wikidata, offers context-sensitive autocompletion for SPARQL queries, and allows combination with text search. It's faster than engines like Blazegraph or Virtuoso, especially for queries involving large result sets.
Apache License 2.0
405 stars 52 forks source link

named graphs #493

Closed justin2004 closed 3 weeks ago

justin2004 commented 3 years ago

at https://qlever.cs.uni-freiburg.de/olympics/1a2iEY

when i run

PREFIX athlete: <http://wallscope.co.uk/resource/olympics/athlete/>
SELECT ?g ?p ?o WHERE {
graph ?g {
  athlete:AadamIsmaeelKhamis ?p ?o
 }
}

i get


Error:
Unknown error
Your query was:

PREFIX athlete: 
SELECT ?g ?p ?o WHERE {
graph ?g {
  athlete:AadamIsmaeelKhamis ?p ?o
 }
}

Exception: ParseException, cause: Unexpected input: graph ?g { athlete:AadamIsmaeelKhamis ?p ?o } }

are named graphs not supported in qlever? i'm pretty sure they are in sparql 1.1

hannahbast commented 3 years ago

Named graphs are also not supported yet. As I wrote on https://phabricator.wikimedia.org/T290839#7354220 about two weeks ago:

"QLever does not yet have full SPARQL 1.1 support, but we are approaching that and will be there soon. The basic features are all there and what's missing are mostly small things."

aindlq commented 8 months ago

One important use of named graphs, that is quite impossible to achieve without them, is an ability to transparently query multiple datasets with FROM and FROM NAMED

SELECT ?artwork 
WHERE 
FROM <dataset/A>
FROM <dataset/B> {
    ?artwork crm:P108i_was_produced_by/crm:P33_used_specific_technique/owl:sameAs/skos:broader* <http://vocab.getty.edu/aat/300053271> .
}

Imagine that you have 10 datasets that use the same data model but are coming from different institutions and you want to be able to query the whole data, individual datasets or different combinations of them.

It is possible to have one instance of qlever per datastet to query them one by one, but then it is hard to join them together in an arbitrary way.

Or even more extreme scenario, where you have 100 different users and every user can have it's own "private" graph. With FROM one can make sure that the data is kind of isolated from other graphs. In this case it is simply impractical to have so many instances of qlever.

With FROM clause one can simply reuse the same query, and change only datasets.

leonqli commented 3 months ago

Is named graph supported now?

ktk commented 3 weeks ago

@leonqli it is now

ktk commented 3 weeks ago

@justin2004 your query works now, you could close the issue