jsonld-lint
jsonld-lint copied to clipboard
Linter shows incorrect warning for typed literal values
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