lanthaler / JsonLD

JSON-LD processor for PHP
MIT License
335 stars 62 forks source link

No expansion of JSON field with name "0" #102

Open frmichel opened 4 years ago

frmichel commented 4 years ago

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:

Thx, Franck.

dereuromark commented 3 years ago

Sounds like empty() usage somewhere where a more strict check would be good.