Support reserved character "@" to be used in predicate naming #4897
Labels
area/mutations
Related to mutations JSON or RDF.
area/parsing
Issues related to the parser or lexer.
dgraph
Issue or PR created by an internal Dgraph contributor.
kind/bug
Something is broken.
priority/P3
Low priority, something to be done once everything else seems fixed.
Stale
status/accepted
We accept to investigate/work on it.
Experience Report
reference: https://discuss.dgraph.io/t/support-json-ld-on-dgraph/7162
What you wanted to do
Have the possibility to insert JSON-LD directly into Dgraph instead of having to convert the entire dataset manually.
What you actually did
I tried to run a JSON-LD with JSON mutation.
Why that wasn't great, with examples
The "@" character is a character reserved for language support. However, it is a character that is used between two words and not at the beginning of a word. Therefore, it makes no sense to reserve it that way.
Releasing this character would have a "kind of JSON-LD support".
This would be a good step to allow different RDF based datasets to be loaded into Dgraph.
Any external references to support your case
Code reference
https://github.com/dgraph-io/dgraph/blob/2a091db1608e4d3035f5f51546e67f5ff6c0b13b/worker/mutation.go#L356
User comment about JSON-LD
#1 (comment)
Also check
#616
Tests I made with other characters
Can not be mutate
_: b0 <@context> "test".
_: b0 <\ context> "test".
_: b0 <\ context> "test".
_: b0 <~ context> "test".
_: b0 <^ context> "test".
_: b0 <`context>" test ".
_: b0 <{context> "test".
_: b0 <} context> "test".
Can
_: b0 <´context> "test".
_: b0 <[context> "test".
_: b0 <] context> "test".
_: b0 <'context> "test".
Other JSON-LD examples:
The text was updated successfully, but these errors were encountered: