Skip to content

keyword alias with "@prefix"=true ? #153

@pchampin

Description

@pchampin

The following is quite ugly, and in my opinion it should break.

{
  "@context": {
    "@version": 1.1,
    "id": {
        "@id": "@id",
        "@prefix": true
     }
  },
  "id:foo": "#x"
}

The thing is: nothing in the spec explicitly prevents it:

  • Step 25 of Create Term Definition does not check that iri mapping is not a keyword.
  • Step 5.4 of IRI Expansion does not either, so should happily use the keyword as a prefix.

This is what the Ruby distiller is doing: the JSON-LD above generates a "@idfoo" property... The playground ignores it silently, which in my view is not complying with the spec. But that's not the point. I think the spec should reject the use of keyword aliases as prefix, by updating either of the steps above.

I can provide the PR, if we agree that it's a bug and not a feature.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions