Skip to content

Relax the colliding keywords constraint for @type #402

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

Closed
letmaik opened this issue Nov 19, 2015 · 2 comments
Closed

Relax the colliding keywords constraint for @type #402

letmaik opened this issue Nov 19, 2015 · 2 comments
Labels
api defer Issue deferred to future Working Group spec-design

Comments

@letmaik
Copy link

letmaik commented Nov 19, 2015

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?

@gkellogg
Copy link
Member

gkellogg commented Jul 8, 2018

Transfered to the WG: w3c/json-ld-api#4.

@gkellogg gkellogg closed this as completed Jul 8, 2018
@azaroth42
Copy link
Contributor

@letmaik Would scoped contexts resolve your use case without relaxing the collision constraint? Or is it that you have existing JSON that you want to map to RDF and there are two fields that both map to rdf:type / @type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api defer Issue deferred to future Working Group spec-design
Projects
None yet
Development

No branches or pull requests

3 participants