Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default and named graphs #1776

Open
rat10 opened this issue Feb 6, 2025 · 2 comments
Open

Default and named graphs #1776

rat10 opened this issue Feb 6, 2025 · 2 comments

Comments

@rat10
Copy link

rat10 commented Feb 6, 2025

If QLever follows the SPARQL specification by the book the default graph of a dataset has no name and is composed of all triples, i.e. all statements not contained in a specific named graph. That however is a bit under-specified in practice which is why most quad stores implement some way to refer to the default graph by name, e.g. urn:x-sparql:default and/or configure it to be the union (or merge) of all triples in the dataset, irrespective of the named graph they are contained in, or some other arrangement. How does Qlever handle this issue, or what are your plans?

@hannahbast
Copy link
Member

@rat10 Qlever currently implements the following:

  1. All triples that are not explicitly assigned to a graph, are assigned to the default graph, which in QLever has the name ql:default-graph. For example: https://qlever.cs.uni-freiburg.de/olympics/V85gwp

  2. When you don't specify a FROM, FROM NAMED, or GRAPH in the query, you effectively query the union graph

That looked the most natural to us. What do you suggest?

@rat10
Copy link
Author

rat10 commented Feb 7, 2025

@hannahbast That looks good to me too . Although not to spec it is probably the most sensible default configuration. At least it covers my use cases, and you are not alone with this approach.

AFAICT most quad stores either default to the union graph as the default graph, or provide this configuration as an option in addition to the configuration as specified in SPARQL.

Providing a reference to the default graph is very useful too. Some quad stores provide specific identifiers also for the union graph, i.e. all triples in the store, inclusive the default graph and/or the union of all named graphs, but exclusive the default graph. Those would seem like sensible companions to ql:default-graph. I'm not aware of stores that even differentiate between union and merge, and unless one would strive for completeness that seems unlikely to happen.

You probably are aware of the discussions in the SPARQL 1.2 Community Group, e.g. here, here and here (and I'm adding the links here just for completeness, or other readers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants