-
Notifications
You must be signed in to change notification settings - Fork 8
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
Replace $-keywords with @-keywords #11
Comments
I think we need to analyze the potential for a YAML-LD file including some well-known context which defines We could create a standard context at, say Note that many contexts already provide bare-word equivalents for keywords, such as |
Yes, I thought of that. It would work... except for |
Yes indeed, this is quite an interesting idea. |
This is a lot of language change just to avoid some quotations marks. It's come up before in the JavaScript community (and others) which frequently get annoyed by having to write I'd think that @gkellogg's approach of providing an alias mapping, would provide a good work around for 99% of the keywords, and That seems the simplest approach with the fewest possible confusions and/or conflicts with other communities who may use |
I think this "convenience context" as a best practice is a great idea! I have experienced the pain of writing quotations in YAML (and JavaScript) myself and this still enables staying compatible enough. I would like to raise a question though: Is the Do you think alternative characters is a topic worth discussing or is Here is a list of special ASCII characters, some of which are already reserved for special purposes: |
My experience in interoperability suggest to be very cautious with clever solutions that can be easily replaced by IDE's features. Anyway, if you are interested in following that path, @juusoautiosalo 's question is correct: pick another character instead of "$" to avoid overlaps with JSON Schema. |
My current opinion is this:
This will make the JSON-LD → YAML-LD → JSON-LD round-trip workable and reduce the complexity of the whole system because we delegate it to existing JSON-LD mechanism. |
My 2¢ |
But still — perhaps would be a good thing in the standard Convenience Context to stick to ASCII.
Could you illustrate with an example use case where I provided some reasoning behind character choice at #55 |
TL;DRThe most interoperable way to avoid quoting " securityJSON-LD can be processed after the conversion to RDF: this means that the context is capable of modifying how a message is processed web-payments/web-payments.org#21 For example, a malicious agent could exploit some leaky checks and be able to replace
One great benefit of YAML is that it does not allow duplicate keys (which is a long standing (security) issue for JSON). interoperability with othersLet's call
Those actors' files will not be JSON-interoperable with $LD files and will need to normalize them before using. interoperability with JSON-LDThe $-context (or £-context) is defined to be specific to YAML-LD, but will spill-over to JSON-LD because of all implementations that use "dumb" JSON/YAML libraries to process these files. |
This comment was marked as resolved.
This comment was marked as resolved.
Why not just map to plain words (i.e.,
Although I think it would be great for the YAML community to consider this, it will be a while before it is widely deployed, so I don't think we can rely on any change to YAML to deal with our
JSON-LD has the concept of Protected Term Definitions and restrictions on how scoped contexts can be applied specifically to deal with this issue. Alongside Proofs/Signatures, these help maintain the integrity of JSON-LD documents. YAML-LD benefits from this practice.
I'm generally opposed to introducing |
I took care of it again. Everyone should try to remember this when adding comments. (Note, I found that COMMAND-e when highlighting some texts does this easily on the Mac). |
$ is an ASCII character, british pound and euro characters are not. If not to restrict ourselves with ASCII then why I do not insist on including the convenience context into the specification: I will be able to use it anyway :) |
I know how to type I can quickly locate Your suggested "small orange diamond" To my mind, that makes |
Having a context specific for YAML file impacts on interoperability.
👍
Agree, but I'd happily avoid testing buggy implementations :) |
@ioggstream -- Please note that GitHub doesn't always preserve code fences in quoted lines, and you always need to review copied-and-pasted text ... so |
@TallTed done, thanks. It seemed such a good idea to register the |
Discussed in the TPAC F2F and resolved to close as won't fix. |
As an
author of YAML-LD files
… WHOI want an
ability to type keywords without quotes
… WHATSo that
my authoring experience is better
… WHYMotivation
I believe the primary purpose of having a Linked Data format based on YAML is to simplify manual authoring of the linked data documents. This means that, in an information system, we could ask domain experts to write YAML documents to describe their knowledge.
YAML is much easier to write manually than JSON because it does not require as much syntactic noise. Normally, keys can be written without quoting at all:
However, sooner or later the document author will have to define
@type
,@context
,@language
, or any other JSON-LD keyword; and then they have to remember that@
is a reserved character and that in such cases quoting is mandatory.The potential author of YAML-LD documents is not necessarily a programmer; they might be a history student, an anthropologist, a biologist, a physicist.
Let's not make their life harder than it has to be.
Potential risks
@
character might suddenly acquire a new meaning under YAML specification. — This is not a risk because, under my proposal, we'll not have@
in our documents anyway, we'll have$
.$
character might suddenly acquire a new meaning under YAML specification. — I consider that unlikely: it is now not, and such a change would bear great risks for broken backwards compatibility, especially for those who combine YAML with JSON Schema.@schema
or@ref
, and JSON Schema does not have$context
or$type
. I am saying this based on a brief web research, please do correct me if I am wrong.Possible implementations
!yaml-ld
tag proposed at Use tags to distinguish "plain" YAML-LD from "idiomatic" YAML-LD #6: interesting, but for a non-programmer it will be just a nuisance, a piece of syntactic noise. I would propose to prioritize it to make YAML-LD as concise as possible without losing its writeability and readability.Proposal
Let us replace
$
→@
and vice versa only for the particular keywords. For instance,will be converted into
because
@context
is a JSON-LD keyword and@schema
is not.Thus, we will minimize the possibilities for conflict while still getting rid of the nasty quotes.
The text was updated successfully, but these errors were encountered: