-
Notifications
You must be signed in to change notification settings - Fork 61
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
Remove Natural Language Value #46
Comments
Related to #21 |
Due to the way @language works within JSON-LD, there are a couple of gotchas in the way AS 2.0 is currently defined. The original goal was to make it so that a single "language sensitive" property like "displayName" could be either a literal string or a language-map... e.g. {
"displayName": "Foo"
} or {
"displayName": {
"en": "Foo",
"fr": "Bar"
}
} This has advantages and disadvantages. One key disadvantage is that it simply does not work properly in JSON-LD without additional processing. The correct JSON-LD approach would be to map distinct terms in the JSON-LD @context, e.g. {
"@context": {
...,
"displayName": "as:displayName",
"displayNameMap": {
"@id": "as:displayName",
"@container": "@language"
},
"title": "as:title",
"titleMap": {
"@id": "as:title",
"@container": "@language"
},
...
}
} When run through the JSON-LD algorithms, things just work as expected. In the serialized compacted JSON-LD... the choices become: {
"displayName": "Foo"
} and {
"displayNameMap": {
"en": "Foo",
"fr": "Bar"
}
} The advantage here is that "displayName" is always just a literal string, whereas "displayNameMap" is always a Language Map. It requires us to track one additional term for each language-sensitive field, but the advantage is greater consistency and less weirdness. Which is always good |
Covered by current Editor's draft |
See: http://lists.w3.org/Archives/Public/public-socialweb/2014Nov/0010.html
"The "Natural Language Value" construct in AS2 was originally added
before the serialization of AS2 was formally based on JSON-LD. The
mechanism is intended to provide a default language context for the
document, but it's not entirely compatible with the JSON-LD mechanisms
and requires a pre-processing step to be implemented before successful
JSON-LD processing... At this point, I think it makes sense to simply remove the Natural
Language Value construct and rely specifically on the JSON-LD
mechanisms to eliminate the additional pre-processing step. Doing so
makes things a bit more reliant on JSON-LD but simplifies things
overall."
The text was updated successfully, but these errors were encountered: