This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-05
Channels
- # announcements (1)
- # asami (25)
- # babashka (78)
- # beginners (24)
- # clojure (15)
- # clojure-europe (21)
- # clojure-losangeles (4)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-uk (11)
- # cursive (17)
- # datomic (29)
- # events (1)
- # fulcro (4)
- # hyperfiddle (6)
- # jobs (1)
- # lsp (20)
- # malli (9)
- # off-topic (7)
- # pedestal (1)
- # polylith (2)
- # practicalli (1)
- # rdf (7)
- # reitit (1)
- # remote-jobs (1)
- # spacemacs (17)
- # specter (24)
- # vim (1)
So I’m revisiting SPARQL syntax and I realize that there are certain situations where what constitutes a “basic graph pattern” can be ambiguous. Recall the definition of BGP according to the SPARQL 1.1 spec: > A sequence of triple patterns, with optional filters, comprises a single basic graph pattern. Any other graph pattern terminates a basic graph pattern. So this:
PREFIX foo: <>
SELECT ?x
WHERE {
?x foo:bar _:1 .
FILTER regex(?y, "zebra")
?y foo:qux _:1 .
}
has one BGP in the WHERE clause. However, here:
PREFIX foo: <>
SELECT ?x
WHERE {
?x foo:bar _:1 .
FILTER NOT EXISTS { ?z foo:baz :_1 . }
?y foo:qux _:1 .
}
are there one, two, or three BGPs? Apache Jena suggests three when I ran it, since it throws a “Blank node label reuse not allowed” error due to repeating the :_1
blank node.I would have thought according to that definition that it was 2 BGPs (I can see the argument for it being 1, but BGP sets are about inner joins, but a filter like this is a bit like a subquery)
And because it’s acting like a subquery, then that may be why they’re not allowing the blank node reuse. That’s not an issue though, since you can just use a named variable instead
I’m guessing that the implementation did some kind of break after the FILTER NOT EXISTS, since it’s not acting like a run-of-the-mill filter