-
Notifications
You must be signed in to change notification settings - Fork 21
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
add support for in
expression
#795
Conversation
@@ -285,9 +285,13 @@ | |||
[x] | |||
(str x)) | |||
|
|||
(defn sparql-in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we need a better name for this function because it's used in fql as well as sparql
@@ -440,10 +440,18 @@ | |||
test-utils/default-str-context | |||
{"ex" "http://example.com/"}] | |||
"where" [{"id" "?s", "ex:text" "?text"} | |||
["bind" "?bound" "(bound ?text)"]] | |||
"insert" {"id" "?s", "ex:bound" "?bound"} | |||
["bind" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I talk a lot about improving the test commentary in code reviews. This test is one of the worst offenders. The whole "functional forms" section is bad so it's probably outside the scope of this specific pr to make it better, but it takes entirely too much effort to figure out what's happening in this test if you made a code change that breaks it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've been trying to update the bad ones as I go but this one is a lot of work to refactor, so I skipped it. But, it's not hard work, so I'll see if I can refactor the whole thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I said, the existing tests are outside the scope of this particular pr so I don't think you have to refactor the whole thing, but new test assertions added here should still provide enough information for someone else later to be able to make sense of what's being tested, what the expected behavior is, and, in the case of something breaking, what broke and in what way it broke.
cee17e3
to
521d4c3
Compare
Semantics and syntax from SPARQL IN expression.
It's not sparql-specific, so no need to qualify it.
989574d
to
3311ab7
Compare
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.
abs expects only a single expression as an argument, and that argument does not need to be quoted.
translate SPARQL IN/NOT IN expresssions into FQL
Semantics and syntax from SPARQL IN expression.