w3c / json-ld-api

JSON-LD 1.1 Processing Algorithms and API Specification
https://w3c.github.io/json-ld-api/
Other
76 stars 31 forks source link

Relax the colliding keywords constraint for @type #4

Closed gkellogg closed 5 years ago

gkellogg commented 6 years ago

I want the following:

{
  "@context": {
    "type": "@type",
    "profile": "@type"
  },
  "type": "cov:Coverage",
  "profile": "cov:GridCoverage"
}

However this is not allowed. The playground says "Invalid JSON-LD syntax; colliding keywords detected".

However, this one works:

{
  "@context": {
    "type": {"@id": "rdf:type", "@type": "@id" },
    "profile": {"@id": "rdf:type", "@type": "@id" }
  },
  "type": "cov:Coverage",
  "profile": "cov:GridCoverage"
}

I understand that this restriction probably makes sense for other keywords, but could it do any harm for @type?

Original issue Relax the colliding keywords constraint for @type #402.

dlongley commented 6 years ago

I don't know of any reason why this wouldn't work for @type but maybe someone else does. I wouldn't object to loosening the restriction for @type if people think there is a significant need for this.

ajs6f commented 6 years ago

I'm probably just expressing my ignorance of the history here, but why was this restriction instituted? It's not obvious to me (yet) what's being guarded against...

gkellogg commented 6 years ago

There was discussion in the 1.0 timeframe here, with related issues json-ld/json-ld.org#91 and json-ld/json-ld.org#102. These were getting a slightly different issues, but worth the read to go over the history of the subject.

ajs6f commented 6 years ago

Thanks @gkellogg, I'll read up and get educated!

azaroth42 commented 6 years ago

Resolution on WG call of 2018-08-17: We propose using scoped contexts rather than multiple top level aliases for @type. Next step is to determine if that meets the original use case or not.

iherman commented 5 years ago

This issue was discussed in a meeting.