-
Notifications
You must be signed in to change notification settings - Fork 20
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
The unnamed/default graph should have a standard name #43
Comments
Does this imply that you think disparate endpoints would be explicitly using the same default graph? That sounds rather strange to me. One of the underlying setups we attempted to support in the SPARQL 1.1 WG was systems which had an underlying quadstore (where every graph has a name) in which the query engine would use one specific named graph as the default. I've designed systems like this in the past, and been very happy with it. I think an alternative approach to this issue (defined by a future version of SPARQL) might be to reconsider the default graph as a pre-defining of the active graph (as if the query were wrapped in a |
It would be the same as when different SPARQL endpoints use urn:foo as a named graph name. A query would not magically cause all SPARQL endpoints to return results from all SPARQL endpoints that use that graph name. |
No, but it might cause some surprising results if you start dealing with metadata or provenance data about graphs (where statements made about another endpoint's default graph now apply to all default graphs everywhere). |
Alternatively, for endpoints that are using the SPARQL Protocol, a default graph IRI could be constructed based on the service endpoint URL. |
by @depressiveRobot, article here I complete agree with @dbooth-boston, the default graph should be referenceable, so that it could also be used in a dataset definition. Furthermore, the query dataset could then be defined as the union default graph, since otherwise there would be no way to retrieve the list of existing graphs in the quad store with a query e.g. in the form
|
One option here is to follow SPARQL Update and support:
and
It solves some of the problems/inconveniences (inability to access original default graph if dataset is specified with FROM / FROM NAMED; inability to switch back to default graph inside a GRAPH clause), but does not solve others (listing all graphs in the dataset). |
that expectation could be framed by choice of iri form. |
Removing "SPARQL: " on transferred issue. |
As well as supporting Examples:
Edit opened #59 for this topic as it is a separate (but related) issue |
RDF4J has a special constant |
A slightly cheeky option would be to use
That seems close enough to cover the case of the default graph. Currently, the scheme is used in web browsers as URL for special pages like |
a concern about using a registered scheme is that there would be a temptation to use it as the name for a concrete graph. |
@lisp I don't understand what point you are trying to make. |
how would it work out if a quad import were to include the following,
? |
@lisp I proposed the IRI |
I think the concern here is what and endpoint should do if This might not be a problem for systems that have a single (named) graph that is identified internally as the default graph for SPARQL purposes, but SPARQL also supports systems where the default graph isn't just a normal graph internally. For example, the default graph can also act as a union of some or all named graphs. Hard to see what would be the correct behavior for these systems if there's a collisions between a graph name and a special name used to identify the default graph. |
You mean loading an N-Quads file that contains triples in a graph named
You mean someone used
Such systems should treat the named graph |
the broader proposal is that there be some standard syntactical elements which designate all three of the distinguished cases. the example with a term analogous to the proposed "default" term demonstrates the problem(s) which would ensue from using an otherwise legitimate iri. we do now something which is analogous to the proposed iri. |
@lisp You have an interesting way of expressing yourself. Would you please humour me and say that again in simple English? |
Since any IRI can be used to identify a named graph, SPARQL 1.2 would have to decide what to do when IRIs reserved for default graph or union graph are found in user data, such as when loading quads containing the reserved IRIs. The IRI reserved for default graph can be effectively ignored, but the union graph IRI (e.g., These decisions can be avoided if default graph and union graph are not identified via IRIs but via dedicated keywords, such as in SPARQL 1.1 Update. The cost of this approach is breaking changes to SPARQL syntax. |
Thank you, @jindrichmynarz. Note that there was no suggestion to introduce IRIs for anything but the default graph. Pointing out problems with introducing an IRI for something else doesn't demonstrate problems with introducing an IRI for the default graph. Allowing the
However, it doesn't solve other aspects. For example, take a parameterised query (see #57) where the target graph is supposed to be a parameter. This currently requires elaborate special casing in the query to support the default graph as target, and |
For me, the baseline choice is keywords; other proposals have to offer some advantage overall. I prefer using keywords because of the issues around use of URIs, not just in quads but also they aren't naming the same graph across datasets. Taking a special prefix name is also a possibility (and it isn't defined by PREFIX; if it is, it isn't special) but that looks more like an unusual way to write a keyword. I can see wanting to say "the default graph is " (the URI it actually is, not a placeholder) but that does not make all default graphs that . Nearby: |
Using IRIs to refer to local resources is fine, and is done all the time— The purpose of |
Not a problem as breakage rather than confusion when the URI is used in data as mentioned up-thread. I don't see a strong connection to A similar oddity is created with To combine with templating, an indirection through a keyword To make This is then fits with the |
I do acknowledge the problem that You mention a Specifying the dataset via
which produces IRIs of virtual or system-managed graphs, and the query then casually jumps back and forth between those graphs using Maybe you are getting at something like this?
where |
A clear advantage of a URI over a keyword is that a URI allows all graphs to be identified uniformly, using the same syntax, rather than having to special-case the default graph.
Yes, but that is also true of the DEFAULT keyword (or in quads, the lack of a graph URI): it is not naming the same graph across datasets. That is intentional, just as it is for certain URI schemes, such as the To quote from RFC 3986:
Identifying the default graph "in relation to the end-user's local context" is exactly the desired behavior in this case, and that is what a URI like In summary, I do not see any semantic benefit in using a keyword instead of a URI, but I do see a downside, because of the special casing that it requires. On the other hand, maybe "DEFAULT" would be convenient as syntactic sugar for the URI, just as Turtle allows "a" as syntactic sugar for rdf:type. |
We can also think of a standard location derived IRI for these graph names. Assuming a public endpoint e.g. https://sparql.rhea-db.org/sparql The idea here is that in a IRI form space of the sparql protocol it is very unlikely that these IRIs will have been minted and in use. |
Why not use |
I think using an IRI with |
A keyword makes more sense to be for the GRAPH DEFAULT use case, used inside a query to switch back to the default graph. Using a specific URI, of whatever form, makes a need to explain the local meaning and why it is not in the list of named graphs. For the protocol parameterization use case in #57, a URI is more convenient. In summary - both. DEFAULT as surface syntax, and a URI for parameterization from outside the query syntax. |
I'm a bit late to the party, thanks for mentioning this though ( As an aside: we named our IRI constant That being said I'm not against using the term 'default' for what we're trying to do here. I just wanted to call out that we'll need to be clear that it means default graph in a non-ambiguous way. |
@jeenbroekstra - what's the prefix for rdf4j:nil? I used sesame but it points to a dead site that sells coupons, and that seems wrong.. |
@tiffoknee ah, apologies, I was mistaken when I said we'd renamed it. It's still |
Ah ok - thanks. I found that (as a noob I expect I do inexplicable things) if I do "select * from default" it flags up a syntax error but does actually work.. Probably this is bad? I don't know. |
That sounds like a minor bug in the SPARQL editor in the RDF4J workbench. Thanks for pointing this out, issue logged as eclipse-rdf4j/rdf4j#2421. I suggest we take further discussion of this and other RDF4J-specific problems to the RDF4J mailinglist and/or issue tracker. |
Apache Jena URIs:
These are accessed through functions in the SPARQL engine so changing or adding them should be not too disruptive. Mild advantage of "urn"; is that it is not HTTP-dereferencable. |
dydra recognizes the following uris :
with the intended behaviour :
although the last two cases are not obvious, on one hand, i do not recall any occasion to explain the distinction, but, on the other, i have not checked if the situation arises in any actual repository and/or inline in any query. |
I had a look at that recently when considering an updated IRI for RDF4J for this purpose, but I believe the idea of using |
A tag URI would serve the same purpose and could be placed under a w3 authority. |
My understanding is that |
At present the unnamed/default graph has no standard name. This means that, when writing code that manipulates graphs, one must special-case the unnamed/default graph. It also violates one of the Axioms of Web Architecture: "Any resource of significance should be given a URI."
I think the unnamed/default graph should have a standard name, such as http://www.w3.org/1999/02/22-rdf-syntax-ns#defaultGraph ( rdf:defaultGraph ). Implied references to the unnamed/default graph in SPARQL, TriG, etc., should be understood as short-hand for this graph name.
The text was updated successfully, but these errors were encountered: