jsonld.js
jsonld.js copied to clipboard
Issue with compaction in playground
When I compact this input document:
{
"@id": "http://example.com/this",
"http://purl.org/dc/terms/date": "abc123"
}
Against this context:
{
"@context": {
"http://purl.org/dc/terms/date": {
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
}
}
}
The result is:
{
"@context": {
"http://purl.org/dc/terms/date": {
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
}
},
"@id": "http://example.com/this",
"http://purl.org/dc/terms/date": "abc123"
}
Which is the following when converted to N-Quads:
<http://example.com/this> <http://purl.org/dc/terms/date> "abc123"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
In this case, one would expect the compacted result would be:
{
"@context": {
"http://purl.org/dc/terms/date": {
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
}
},
"@id": "http://example.com/this",
"http://purl.org/dc/terms/date": {
"@value": "abc123"
}
}