Skip to content
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

Aliasing languages in scoped context for a language map? #158

Closed
azaroth42 opened this issue Apr 15, 2019 · 5 comments
Closed

Aliasing languages in scoped context for a language map? #158

azaroth42 opened this issue Apr 15, 2019 · 5 comments

Comments

@azaroth42
Copy link
Contributor

It's possible to alias @none to none in a scoped context of a language map, but should it also be possible to alias other language keys? For example, if en-gb was aliased to en_gb, then it would be usable as a property in javascript.

@gkellogg
Copy link
Member

Terms expand to IRIs, so it's not possible to define an alias for "en-gb" which is anything other than an IRI. The exception is for aliases to keywords, so @none works.

The algorithm does try to expand keys for all maps, including language maps, which is why @none aliasing works, but we're limited by how terms can be defined.

@azaroth42
Copy link
Contributor Author

Yup, agreed that we can't do it now (because I tried, and got the error :) ) but is it valuable enough to add it?

@pchampin
Copy link
Contributor

I can sympathize with the argument that "en-gb" is not usable as a JS property, but I think that a general aliasing mechanism would add too much complexity.

What about creating a special case for language maps, replacing all underscores in the keys by dashes (if I'm correct, BCP 47 tags can not contain underscores)?

This does add complexity to the overall spec (but much smaller than a general alias mechanism), and it does create a backward incompatibility (but only for cases which are somehow invalid anyway). Also, we this would create round-tripping problems...

Is it really worth it?

@pchampin
Copy link
Contributor

Note also that it is always possible (although not as convenient) to use an index map:

{
  "@context": {
    "label": { "@id": "http://example.org/label", "@container": "@index" }
  },
  "label": {
    "en_gb": {
      "@value": "hello",
      "@language": "en-gb"
    }
  }
}

@iherman
Copy link
Member

iherman commented Apr 20, 2019

This issue was discussed in a meeting.

  • RESOLVED: Close syntax #158 won’t fix, too complicated for the value gained
View the transcript language aliasing
Rob Sanderson: link: #158
Rob Sanderson: Unless there are other people that are interested in this particular topic, I’m happy to close it.
… We can alias @none to just none to get rid of @.
Gregg Kellogg: Aliasing lets us alias IRIs and keywords, but that’s it.
Gregg Kellogg: Because @none is a keyword, we can alias it but we can’t alias arbitrary string values.
Rob Sanderson: Yes, the thought was if we wanted to let some way of aliasing more things then en-us could be aliased to en_us for example. But as Gregg said that means introducing a new feature to do this. Unless there’s interest, I’m ready to close.
Proposed resolution: Close syntax #158 won’t fix, too complicated for the value gained (Rob Sanderson)
Rob Sanderson: +1
Gregg Kellogg: +1
Ruben Taelman: +1
Ivan Herman: +1
Dave Longley: +1
Resolution #2: Close syntax #158 won’t fix, too complicated for the value gained
David I. Lehn: +1

@iherman iherman closed this as completed Apr 20, 2019
@ghost ghost removed the needs discussion label Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants