defining a prop as `xsd:boolean` loses its prefixed URL
Given this context
{"@context":
{"owl": "http://www.w3.org/2002/07/owl#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"owl:deprecated": {"@type": "xsd:boolean"}
}
}
This instance data
{
"@id": "ex:Ontology",
"http://www.w3.org/2002/07/owl#deprecated": true
}
is compacted to
{
"@context": {
"owl": "http://www.w3.org/2002/07/owl#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"owl:deprecated": {
"@type": "xsd:boolean"
}
},
"@id": "ex:Ontology",
"http://www.w3.org/2002/07/owl#deprecated": true
}
As you see, the prefix owl: is not used for the property.
If I remove the prop type from the context
"owl:deprecated": {"@type": "xsd:boolean"}
Then the prop is shortened.
Same happens in playground and https://github.com/digitalbazaar/jsonld-cli/releases/tag/v2.0.0
@msporny @gkellogg is this expected?
Yes, it is operating as designed. Term selection looks for exact patterns, and would have used owl:deprecated if it were "true"^^xsd:boolean, but it needs to match that value pattern, and not a native value. JSON-LD only takes native types into consideration for from and to RDF transformation.
which means that ALL json native values are useless or harmful, and only strings should be used . Right?
which means that ALL json native values are useless or harmful, and only strings should be used . Right?
Pretty much :) native values generally loose fidelity, and the algorithms intentionally ignore them. JSON-LD is really about interpreting string values.