-
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
Cannot use string context from clojure #335
Comments
Is there a request to be able to use the string context? from CLJ? It is produced under :context-str so it does exist and could be used by setting a flag or something on the query. Both cannot be used, because they are use for both expansion of the query, then for compaction of the results. The latter would not be able to produce correct results - so one -or- the other must be used. |
And of course you can always use any context you want by supplying it - we do "merge" it into the default which could be problematic, and it would make sense to have more control over that. I think merge is what is typically wanted, at least from my perspective... but replace should be possible. That would be a different ticket however, but maybe would address the original concern that prompted this ticket. |
The reason I ran into this was I was trying to put together an example SHACL graph for the nexus folks. I first wrote in the json-ld playground because they won't be using clojure and I wanted to make sure it was correct. For convenience, I used nested prefixes:
I then wanted to try it out and got confused because none of it worked in clojure because of the string/keyword context dichotomy. Once I figured out that I can't use string prefixes in Clojure I tried translating this into keywords but I haven't been able to get these nested prefixes to expand properly. There's probably a trick to it but I tried three different approaches that didn't work, so I stopped to write it up. |
Going to wait until the fix for #414 lands to complete this. |
This issue is closed from #437 . Now you always use the string context, unless you set the option This can be set on I'll refrain from closing because it isn't assigned to me, but let me know if there are any clarifying questions. Else good to close. |
If using a context with string prefixes from clojure, the string prefixes will get clobbered when using the db. As shown below the user's supplied context is used as-is by the
conn
and theledger
, but thedb
normalizes the default context and in so doing changes all the prefixes to keywords. This breaks the user's expectations by having shortened IRIs fail to expand.The normalization happens in
fluree.db.json-ld.bootstrap/normalize-default-ctx
.The text was updated successfully, but these errors were encountered: