jsonld-lint icon indicating copy to clipboard operation
jsonld-lint copied to clipboard

Linter shows incorrect warning for typed literal values

Open RinkeHoekstra opened this issue 3 years ago • 0 comments

Linter shows:

  • Usage of JSON-LD syntax token "type" in the JSON-LD object type of "GraphObject" is invalid, or
  • Usage of JSON-LD syntax token "@value" in the JSON-LD object type of "NodeObject" is invalid

in cases where the JSON-LD contains a typed datatype value, e.g.:

{
    "@context": {
        "ex": "http://example.com/"
    },
    "@id": "ex:test123",
    "ex:myAttribute": {
        "@value": "123",
        "@type": "ex:myDataType"
    }
}

But this is perfectly valid, as it is the mechanism for assigning a datatype to a literal. See https://www.w3.org/TR/json-ld11/#typed-values

RinkeHoekstra avatar Sep 01 '21 07:09 RinkeHoekstra