Skip to content

Colliding keyword detection fails on "id" mapped to "@id" #40

@BigBlueHat

Description

@BigBlueHat

The code that generates the error is here:
https://github.com/mcollina/levelgraph-jsonld/blob/e07ce027b0c4da9a5e2a8b5b34b394f95940379c/build/levelgraph-jsonld.js#L5239-L5245

A sample JSON-LD document + @context that will cause the error to be thrown is here:

{
  "@context": {
    "id": "@id",
    "@vocab": "http://xmlns.com/foaf/0.1/"
  },
  "id": "http://bigbluehat.com/#",
  "name": "BigBlueHat",
  "knows": [

    {
      "id": "http://manu.sporny.org#person",
      "name": "Manu Sporny",
      "homepage": "http://manu.sporny.org/"
    }
  ]
}

I found this because the Web Annotation Data Model (among others) maps id to @id in this way.

Removing the 3rd line in the above example will make it work.

You can try pasting it in the playground I'm building for this project. 🎁 😍
https://bigbluehat.github.io/levelgraph-playground/
(watch the console if you try it)

Not sure what the extra JSON-LD validation is meant for...so I don't just want to rip it out. 😄 Hence this issue. 😁

Thanks!
🎩

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions