core
core copied to clipboard
How to remove hydra prefix?
Hello everyone,
Is it possible to remove the hydra prefix (hydra:key) so we don't have an invalid character when parsing? (ie. the colon ':')
"hydra:member" would be "member" "hydra:view" would be "view" etc.
Any idea on how to do that? The serialization doc doesn't seem to cover that part.
@taviani , did you discovered how to do that?
https://github.com/HydraCG/Specifications/pull/151 https://lists.w3.org/Archives/Public/public-hydra-logs/2017Nov/0099.html
We could probably add an option, wdyt @dunglas ?
Ok, let's add an option to remove the prefix, deprecate not setting it, and default to no prefix on v4 then!
JS devs will love this change.
I'm not sure that not having a prefix should be the default.
https://www.hydra-cg.com/spec/latest/core/ - none of their examples show it, which when I was first trying out api-platform made me think that api-platform didn't conform to the spec. It's probably more expected to not have it, than to have it.
@nesl247 examples in the spec used to use the hydra prefix but they changed after API Platform initial release.
Both representations are perfectly valid (a JSON-LD parser will understand them as exactly the same document), but I agree that being in sync with the spec will help newcomers understanding how Hydra works, and will hide the fact that API Platform uses Hydra for JS devs who don't care 😂
So I'm also in favor of removing the prefix by default in v4.