Skip to content

in term definition, the co-occurrence of @language and @type should be an error #681

@pchampin

Description

@pchampin

Consider the following JSON-LD

{
    "@context": {
        "p": {
            "@id": "x:p",
            "@type": "x:datatype",
            "@language": "en"
        }
    },
    "p": "foo"
}

It expands to

[
  {
    "x:p": [
      {
        "@type": "x:datatype",
        "@value": "foo"
      }
    ]
  }
]

The @language is simply ignored.
This is the correct behaviour w.r.t. to the spec. Step 22 of the "Create Term Definition" algorithm explicitly instructs to ignore @language if @type is present.

I consider this as a bug in the spec. The context above makes no sense, and should be rejected with an invalid term definition error (at least, as of JSON-LD 1.2 -- we could preserve the current behaviour if mode is 1.0 or 1.1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions