json-ld / yaml-ld

CG specification for YAML-LD and UCR
https://json-ld.github.io/yaml-ld/spec
Other
19 stars 8 forks source link

Choose prefix character to replace @ #55

Closed anatoly-scherbakov closed 1 year ago

anatoly-scherbakov commented 2 years ago

As an architect of a YAML-LD aware system and a developer, I am a bit uncomfortable about having my users write JSON-LD @-keywords and have to quote them because that would mean additional effort. I would rather prefer some other prefix character from ASCII character set.

Choice of prefix characters

@id Notes Resolution
@id Is reserved. x
`id Is reserved. x
~id Works
!id Used for tags x
#id Used for comments x
$id Works x
%id Used for directives x
^id Works
&id Used for anchors x
*id Used for aliases x
-id Works, but is confusable with lists: - id x
+id Works
_id Works but is confusable with blank nodes (#57) x

Also, _ in Python means private or internal things so I am subconsciously against that :)

I suggest using $ for the Convenience Context. This character also is good for JS: something.$type is workable in that language.

The users however may do whatever they want. For instance, users might want something like this:

=: 🏠:cat
∊: 🐱
🏷️:
  πŸ‡ΊπŸ‡Έ: Ray

I won't stop them. Our $ is really just a way to trigger everyone's imagination.

VladimirAlexiev commented 1 year ago

A good analysis what chars are suitable for #51

gkellogg commented 1 year ago

Discussed in the TPAC F2F and resolved to close as won't fix.