-
Notifications
You must be signed in to change notification settings - Fork 154
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
Language maps on literals with no language don't play well together #480
Comments
Jakob Voß notes that "und" actually means "Unknown language", and "zxx" may be more appropriate, which means "No linguistic content/Not applicable". Perhaps this (or something similar) would be a way to address this. When trying to use a language-mapped term with a literal with no language, the language tag "zxx" is used as a key. cc/ @azaroth42 |
Thanks for making the issue!
As such, as a fallback for when there isn't a language specified, it makes more sense to me to use |
And, with all due respect to Jakob ... the I18N group agrees: |
Just to clarify—this only applies if the property is explicitly marked as a
languageMap in the context, correct?
- David Newbury
-----------------------------------
p. (773) 547-2272
e. [email protected]
…On Tue, Apr 11, 2017 at 8:33 PM, Rob Sanderson ***@***.***> wrote:
And, with all due respect to Jakob ... the I18N group agrees:
https://www.w3.org/International/questions/qa-no-language
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#480 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACG6Jk8mriU5r7w9-ISM_NjPx_R9eZTks5rvBvlgaJpZM4M6zWj>
.
|
@workergnome Yes, but we need to consider the results of expanding and removing the concept of a language-map, or compacting something that didn't originally have a language map. But, we could decide that for JSON-LD, the use of a language-map term is sufficient indicate that literal values, without an explicit |
Jakob Voß writes:
|
Cross-posting from the mailing list in response to Jakob Voß's comments: I don't remember all of the implementation trouble related to the use of empty strings in PHP, but I do remember it being more complex than is being hinted at here. I'm pretty sure that you can't use PHP arrays because you lose the ability to easily distinguish between arrays and objects, which is a requirement for proper implementation. In any event, how difficult it is to implement a syntax's processing rules in common programming languages should absolutely be a factor in related design decisions -- otherwise adoption could be harmed in a significant way. It would indeed be nice if there were no issue here, but, unfortunately, I'm not yet convinced that's true. My memory is that the two PHP implementers agreed that this was a pain point worth avoiding. If we can |
Related: https://bugs.php.net/bug.php?id=46600 It seems that this limitation in PHP may have finally been dealt with in June of last year -- we'll need to figure out which version of PHP has the fix (and how prevalent), if true. |
PHP 7.1 (the latest version) now supports empty string properties in objects: http://php.net/manual/en/migration71.incompatible.php
|
Fantastic ... back to the list for a revised proposal... |
Keep in mind that hardly anyone is using 7.1 yet -- I suspect it may take a while for it to get sufficient adoption. So that's a consideration here. Long term, however, I think we can rid ourselves of this particular annoyance. :) |
True, but by the time JSON-LD 1.1 hits TR, hopefully that will have changed. And if we can push people in the right direction if they need a particular feature in a particular language, that seems like an acceptable situation to me. |
On Apr 14, 2017, at 9:06 AM, Rob Sanderson ***@***.***> wrote:
True, but by the time JSON-LD 1.1 hits TR, hopefully that will have changed. And if we can push people in the right direction if they need a particular feature in a particular language, that seems like an acceptable situation to me.
I agree, if it’s a language limitation, which has since been solved, we shouldn’t restrict the spec, as it’s otherwise perfectly legitimate JSON. We’ll have a CG spec in a month or so (he said optimistically), but it will be more important in a WG timeframe, which is around another couple of years.
Gregg
… —
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub <#480 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAC02EHQOvpuiLoo7WdYHS-Swf4b3M6cks5rv5mfgaJpZM4M6zWj>.
|
Leaving the PHP issue aside, this would fundamentally change how compaction works. Till now, it didn't implicitly introduce values. This would change that. To be consistent, we would need to do the same with other containers... such as The solution I normally recommend for this is to defined an additional term like |
With the "" option, it would continue to not introduce values. It's just a significantly more convenient syntax than needing both I do agree that we should consider consistency with other containers, however. Will work on that. |
After re-reading
|
@lanthaler the idea is to not need to use different properties for such cases. If you have some One possibility is to use the language tag {
"title": {
"en": "The Queen",
"@none": "alternate value, without language"
}
} I would say that this is equivalent to Furthermore, to follow Postel's Law, we might treat We may want to consider what happens with RDF literals having |
I'd argue that's not the case, at least not for the |
The proposal was to implicitly tag a string to have a language tag of
JSON-LD as a superset of RDF. We decided to guarantee lossless compaction/expansion but not roundtrips to RDF. |
Empty-string issues aside, I disagree that using PROPOSAL: Index Maps and Language Maps may include the The alternative, which exists currently, is that such values cannot be serialized using such a term, and are serialized either using another matching term, or using an absolute IRI. |
RESOLVED: Index Maps and Language Maps may include the |
There might be a possible conflict here between language containers and the use of terms with an explicit language of null (i.e. string values). That is, for compaction in JSON-LD 1.0 you can define a language container term (e.g. |
* Add @graph container tests. * A couple of more graph expansion and compaction tests for corner cases. * Add tests for expanding and compacting named graphs where term definition includes `@graphid`. * Expand and compact `@container: @index` where value is a graph. * Disable highlight.js, and update our use of the "highlight" class to "hl-bold". This makes rendered JavaScript examples slightly less pretty, but restores the specific highlighting used with "****" in examples. * Sort many definition lists automatically using `@data-sort`. * Add @Version to context definitions in examples using 1.1 features. * Syntax updates to describe Graph Containers. * Add inline ednotes for places that are affected by issue #480. * Add compaction and expansion tests for `@graph` with `@index` and `@id`. * Add syntax for graph maps and API algorithms for all graph containers.
… containers. Changes behavior for id maps to use `@none` instead of a blank node identifier. Fixes #480
Replaced by #569. |
As described in this email, mixing literals having language, with those not having a language in a language map creates an odd structure when compacting:
If a string is associated with a property defined as a languageMap, but
does not have a language associated with it, it creates two keys in the
JSON ... the langStrings go in one, and the non-langStrings in another.
This is unintuitive and exposes some of the weirdest weirdness of RDF
(langStrings) to unsuspecting JSON developers.
A proposal to discuss:
If compaction would result in an attempt to add a string without an
associated language into a LanguageMap, then the processor SHOULD assign
the undefined language code
UND
as the key in the array.Thus,
_:x rdfs:label "Fish"@en, "Poisson"@fr, "51234" .
Would result in:
{
"@id": "_:x",
"label": {"en": "Fish", "fr": "Poisson", "UND": "51234"}
}
Rather than the current compaction result:
{
"@id": "_:x",
"label": {"en": "Fish", "fr": "Poisson"},
"rdfs:label": "51234"
}
Notes:
explicit @und langString [seems unlikely], where it should not become a
regular xsd:string
References:
digitalbazaar/jsonld.js#151
IIIF/api#755
The text was updated successfully, but these errors were encountered: