-
Notifications
You must be signed in to change notification settings - Fork 23
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
SPARQL VALUES patterns #769
Commits on Jun 12, 2024
-
support VALUES patterns in where clause
This is a basic implementation of the SPARQL VALUES pattern type.
Configuration menu - View commit details
-
Copy full SHA for e43302f - Browse repository at this point
Copy the full SHA e43302fView commit details -
support VALUES patterns in an order-agnostic way
Three approaches considered: 1) just document that :values needs to appear first 2) discard solutions that don't match the given solution 3) during the parse step, sort the patterns so :values is first I don't like #1, though that's the most expedient. #2 is a bit wasteful as it forces us to generate useless solutions. #3 is doable, and may be a minimal requirement in basic query planning. This implements solution #2.
Configuration menu - View commit details
-
Copy full SHA for 91ae277 - Browse repository at this point
Copy the full SHA 91ae277View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3336a27 - Browse repository at this point
Copy the full SHA 3336a27View commit details -
correctly filter solutions across ledgers and with meta
Change 1: handle multiple inline values correctly. Instead of checking that _every_ inline solution equal the solution matches, we needed to _filter_ the inline solutions by whether they match the solution. If any matches, the values can contribute their solutions to the solution chan. This case allows multiple values to be handled correctly, as seen in the "pattern" "single var" test. Change 2: do not consider ::sids while checking match equality When dealing with federated queries the ::sids map may be different for the same value. We now dissoc the ::sids key from the solution matches before checking equality. This is verified by the "federated" test case Change 3: only consider :lang ::meta while checking equality Two identical strings with different language tags are different values. However the :i order or whether it comes from a reasoned flake do not matter for equality checks. We now select only the :lang ::meta key, if ::meta exists in the solution match. Language tags were not parsed, so I've added parsing support for that.
Configuration menu - View commit details
-
Copy full SHA for 703f3ff - Browse repository at this point
Copy the full SHA 703f3ffView commit details -
use public match api instead of removing unwanted match elements
In the future the contents of a match may change, so instead of removing specific unwanted elements we now extract only those elements of a match that establish its identity for equality checking.
Configuration menu - View commit details
-
Copy full SHA for 0dd8a2e - Browse repository at this point
Copy the full SHA 0dd8a2eView commit details -
correctly assign langString datatype to language tagged strings
We were not parsing language tagged strings to langString datatypes correctly in where patterns or in values patterns, nor inferring a langString datatype in the presence of a language tag. I had to update the test expectation because now the language tagged string no longer conforms to the `sh:maxCount 1` _and_ the `sh:datatype xsd:string` constraints, instead of just the `sh:maxCount` constraint.
Configuration menu - View commit details
-
Copy full SHA for 2a6b1fb - Browse repository at this point
Copy the full SHA 2a6b1fbView commit details -
add support for multiple values per var in VALUES pattern
In SPARQL, a VALUES pattern can appear inside a WHERE clause alongside other patterns. In FQL :values is its own clause. This mismatch makes translating directly awkward, since we need to insert our translated pattern at a different point in the parse tree than where we are at translation time. We got around it by translating it into a :bind pattern. However, a :bind pattern can only bind a single value to a variable, so we limited the scope of a VALUES pattern to only a single value. This gets around it by "tagging" the translated value pattern and then after the whole parsing is done, moving it to the correct place in the tree: see `format-values`. It's awkward, but it gives much more flexibility to the user.
Configuration menu - View commit details
-
Copy full SHA for 4790fc5 - Browse repository at this point
Copy the full SHA 4790fc5View commit details -
add support for VALUES patterns and VALUES clauses
FQL now supports :values patterns so we can use that directly instead of translating to a :values clause.
Configuration menu - View commit details
-
Copy full SHA for e5e3e86 - Browse repository at this point
Copy the full SHA e5e3e86View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e33a13 - Browse repository at this point
Copy the full SHA 6e33a13View commit details -
Configuration menu - View commit details
-
Copy full SHA for b116e6a - Browse repository at this point
Copy the full SHA b116e6aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 41fb5e9 - Browse repository at this point
Copy the full SHA 41fb5e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 95914df - Browse repository at this point
Copy the full SHA 95914dfView commit details -
handle Func translation on a case-by-case basis
The tricky part is deciding when to `literal-quote` one or more of the args. Since that information does not exist in the parse tree at the point where :Func needs parsing, we need to figure out whether to quote based on the signature of the function, according to the SPARQL spec: https://www.w3.org/TR/sparql11-query/#SparqlOps and the SPARQL grammar. This way is more repetitive but more robust. Once we've got all the functions covered we can search for abstractions to reduce verbosity.
Configuration menu - View commit details
-
Copy full SHA for 6147559 - Browse repository at this point
Copy the full SHA 6147559View commit details -
Configuration menu - View commit details
-
Copy full SHA for 37fd89f - Browse repository at this point
Copy the full SHA 37fd89fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e27b8f - Browse repository at this point
Copy the full SHA 7e27b8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 13fe3b7 - Browse repository at this point
Copy the full SHA 13fe3b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 74900be - Browse repository at this point
Copy the full SHA 74900beView commit details -
Configuration menu - View commit details
-
Copy full SHA for acec6f6 - Browse repository at this point
Copy the full SHA acec6f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4801e21 - Browse repository at this point
Copy the full SHA 4801e21View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9286d4c - Browse repository at this point
Copy the full SHA 9286d4cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e28e4a6 - Browse repository at this point
Copy the full SHA e28e4a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for ecada24 - Browse repository at this point
Copy the full SHA ecada24View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3219cbb - Browse repository at this point
Copy the full SHA 3219cbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 276245e - Browse repository at this point
Copy the full SHA 276245eView commit details -
Configuration menu - View commit details
-
Copy full SHA for c4cb06f - Browse repository at this point
Copy the full SHA c4cb06fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c3bc19 - Browse repository at this point
Copy the full SHA 1c3bc19View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9db1e0 - Browse repository at this point
Copy the full SHA a9db1e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 27d92e6 - Browse repository at this point
Copy the full SHA 27d92e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d33ea4 - Browse repository at this point
Copy the full SHA 0d33ea4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 96f02e7 - Browse repository at this point
Copy the full SHA 96f02e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3cee558 - Browse repository at this point
Copy the full SHA 3cee558View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3035d03 - Browse repository at this point
Copy the full SHA 3035d03View commit details -
Configuration menu - View commit details
-
Copy full SHA for b35b1c2 - Browse repository at this point
Copy the full SHA b35b1c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for c70a168 - Browse repository at this point
Copy the full SHA c70a168View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22ce5a1 - Browse repository at this point
Copy the full SHA 22ce5a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for f44006c - Browse repository at this point
Copy the full SHA f44006cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 819545c - Browse repository at this point
Copy the full SHA 819545cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 55820d0 - Browse repository at this point
Copy the full SHA 55820d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe09d62 - Browse repository at this point
Copy the full SHA fe09d62View commit details -
Configuration menu - View commit details
-
Copy full SHA for e7d9cb9 - Browse repository at this point
Copy the full SHA e7d9cb9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e55016 - Browse repository at this point
Copy the full SHA 3e55016View commit details -
Configuration menu - View commit details
-
Copy full SHA for e38a748 - Browse repository at this point
Copy the full SHA e38a748View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a0e2f7 - Browse repository at this point
Copy the full SHA 1a0e2f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9fdaeb0 - Browse repository at this point
Copy the full SHA 9fdaeb0View commit details -
Configuration menu - View commit details
-
Copy full SHA for f594eff - Browse repository at this point
Copy the full SHA f594effView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9851f94 - Browse repository at this point
Copy the full SHA 9851f94View commit details -
Configuration menu - View commit details
-
Copy full SHA for b901f9e - Browse repository at this point
Copy the full SHA b901f9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 62b0825 - Browse repository at this point
Copy the full SHA 62b0825View commit details -
Configuration menu - View commit details
-
Copy full SHA for 05f97a0 - Browse repository at this point
Copy the full SHA 05f97a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0a2298 - Browse repository at this point
Copy the full SHA d0a2298View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0dac86c - Browse repository at this point
Copy the full SHA 0dac86cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e167b66 - Browse repository at this point
Copy the full SHA e167b66View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d219e5 - Browse repository at this point
Copy the full SHA 9d219e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b54bd6 - Browse repository at this point
Copy the full SHA 3b54bd6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 99f7880 - Browse repository at this point
Copy the full SHA 99f7880View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a64bd7 - Browse repository at this point
Copy the full SHA 5a64bd7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a084ba - Browse repository at this point
Copy the full SHA 6a084baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 15ce3e7 - Browse repository at this point
Copy the full SHA 15ce3e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e45471a - Browse repository at this point
Copy the full SHA e45471aView commit details -
support SPARQL literal datatype and language tags
I'm not sure where the LANGTAG regex came from, but it didn't match the one in the spec - it required the hyphen (-) between two-part lang tags of the style `@en-us`, but disallowed the simple verson `@en`. Now it correctly accepts both.
Configuration menu - View commit details
-
Copy full SHA for 595bcdf - Browse repository at this point
Copy the full SHA 595bcdfView commit details -
Configuration menu - View commit details
-
Copy full SHA for e6e1481 - Browse repository at this point
Copy the full SHA e6e1481View commit details -
Configuration menu - View commit details
-
Copy full SHA for c842db3 - Browse repository at this point
Copy the full SHA c842db3View commit details -
Configuration menu - View commit details
-
Copy full SHA for f617b71 - Browse repository at this point
Copy the full SHA f617b71View commit details -
Configuration menu - View commit details
-
Copy full SHA for 26c7ac6 - Browse repository at this point
Copy the full SHA 26c7ac6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 968aedd - Browse repository at this point
Copy the full SHA 968aeddView commit details -
Configuration menu - View commit details
-
Copy full SHA for c47cd57 - Browse repository at this point
Copy the full SHA c47cd57View commit details -
Configuration menu - View commit details
-
Copy full SHA for a521573 - Browse repository at this point
Copy the full SHA a521573View commit details -
Configuration menu - View commit details
-
Copy full SHA for 25c82b9 - Browse repository at this point
Copy the full SHA 25c82b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for e38600a - Browse repository at this point
Copy the full SHA e38600aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a93cb7 - Browse repository at this point
Copy the full SHA 2a93cb7View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe03c44 - Browse repository at this point
Copy the full SHA fe03c44View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8890937 - Browse repository at this point
Copy the full SHA 8890937View commit details -
allow SPARQL to use
a
as an alias for @typeThe grammar wasn't expecting whitespace between the 'a' and the prev/next term.
Configuration menu - View commit details
-
Copy full SHA for 521d4c3 - Browse repository at this point
Copy the full SHA 521d4c3View commit details -
Semantics and syntax from SPARQL IN expression.
Configuration menu - View commit details
-
Copy full SHA for a00ebba - Browse repository at this point
Copy the full SHA a00ebbaView commit details -
It's not sparql-specific, so no need to qualify it.
Configuration menu - View commit details
-
Copy full SHA for 3311ab7 - Browse repository at this point
Copy the full SHA 3311ab7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7844077 - Browse repository at this point
Copy the full SHA 7844077View commit details -
Configuration menu - View commit details
-
Copy full SHA for 662ff42 - Browse repository at this point
Copy the full SHA 662ff42View commit details -
The :Expression parser was turning everything into a string, which works in some cases but introduces unwanted quoting in others. By deferring stringification until values need to be incorporated into an actual string expression we avoid the unwanted quoting. Do note that all the numeric functions now correctly expect numeric values instead of strings.
Configuration menu - View commit details
-
Copy full SHA for ec0915d - Browse repository at this point
Copy the full SHA ec0915dView commit details -
Configuration menu - View commit details
-
Copy full SHA for d671a27 - Browse repository at this point
Copy the full SHA d671a27View commit details -
abs expects only a single expression as an argument, and that argument does not need to be quoted.
Configuration menu - View commit details
-
Copy full SHA for 0b715bf - Browse repository at this point
Copy the full SHA 0b715bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a13d9c - Browse repository at this point
Copy the full SHA 1a13d9cView commit details
Commits on Jun 17, 2024
-
Merge pull request #797 from fluree/feature/sparql-in-not-in
translate SPARQL IN/NOT IN expresssions into FQL
Configuration menu - View commit details
-
Copy full SHA for faf021f - Browse repository at this point
Copy the full SHA faf021fView commit details -
Merge pull request #796 from fluree/feature/sparql-exists-not-exists
translate SPARQL EXISTS/NOT EXISTS filters into FQL
Configuration menu - View commit details
-
Copy full SHA for 79565b8 - Browse repository at this point
Copy the full SHA 79565b8View commit details -
Merge pull request #795 from fluree/feature/fql-in-not-in
add support for `in` expression
Configuration menu - View commit details
-
Copy full SHA for 4c13b1b - Browse repository at this point
Copy the full SHA 4c13b1bView commit details -
Merge pull request #784 from fluree/feature/fql-exists-not-exists
Feature/fql exists not exists
Configuration menu - View commit details
-
Copy full SHA for 1f62042 - Browse repository at this point
Copy the full SHA 1f62042View commit details -
Merge pull request #780 from fluree/feature/sparql-from-named
Feature/sparql from named
Configuration menu - View commit details
-
Copy full SHA for 2973fc1 - Browse repository at this point
Copy the full SHA 2973fc1View commit details -
Merge pull request #778 from fluree/feature/sparql-func
Feature/sparql func
Configuration menu - View commit details
-
Copy full SHA for dee6c88 - Browse repository at this point
Copy the full SHA dee6c88View commit details