JsonLD
JsonLD copied to clipboard
No expansion of JSON field with name "0"
Hi Markus,
Just found a very curious behaviour. I'm using JsonLD:toRDF
to expand a JSON-LD file, but any field "0"
seems to be ignored.
Document:
{
"@context": { "@vocab": "http://example.org/vocab#" },
"0": { "field0": "value0" },
"1": { "field1": "value1" }
}
Result:
_:b0 <http://example.org/vocab#1> _:b1 .
_:b1 <http://example.org/vocab#field1> "value1" .
Same thing if another field anywhere in the document is named "0", it is always sort of ignored. Have you seen that already? Any idea?
Context:
- php 5.6.40
- I tested it with JsonLD v1.1 and v1.2. Same issue.
Thx, Franck.
Sounds like empty() usage somewhere where a more strict check would be good.