-
Notifications
You must be signed in to change notification settings - Fork 22
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
Feature/query iri map #452
Conversation
src/fluree/db/query/fql/syntax.cljc
Outdated
@@ -41,6 +41,10 @@ | |||
[x] | |||
(boolean (#{'desc "desc" :desc} x))) | |||
|
|||
(defn iri-key? | |||
[x] | |||
(= "@id" x)) |
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.
We have a constant for the @id
string (const/iri-id
) that we may want to use here.
In other places where this construct is used (transaction data mainly) it is often with |
I think this is good to go, but not fully accurate. Based on the context being used, we don't know what key will translate to One optimization we did in the JSON-LD library is we include
The way it is I think we should merge though, so we can make this work tomorrow, but make another ticket to enhance the json-ld library, and then modify this once that is done. |
When writing this code, I had assumed that this "@id" key would be expanded by the time it got to this part of the code, but there's nothing here right now that does the expanding. I think this code is fine as is (or with minor changes anyone would like to suggest) because this is the only thing that can show up as a map like this in the object position. I do however like the idea of using this map format for more than just specifying an iri eventually, so we'd have to figure out proper id key expansion before we can do that. |
I've made changes to expand the key of the iri map as well so the equality check against "@id" should always work. |
This accomplishes the same outcome more simply, with less code, and less core.async channels
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.
LGTM! 🎉
This patch allows users to reference subjects with an iri map in the object position containing one entry whose key is "@id" and value is the referenced iri.
After parsing the iri map, the query executor first looks up the subject id corresponding to the supplied iri and then processes the rest of the query normally.