JsonLD icon indicating copy to clipboard operation
JsonLD copied to clipboard

No expansion of JSON field with name "0"

Open frmichel opened this issue 4 years ago • 1 comments

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.

frmichel avatar Jun 25 '20 13:06 frmichel

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

dereuromark avatar Oct 16 '20 16:10 dereuromark