lanthaler / JsonLD

JSON-LD processor for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid value for @language error

warpr opened this issue · comments

While playing with the Hydra Console I came across this issue, which looks like a bug in your JSON-LD processor:

PHP Fatal error:  Uncaught exception 'ML\JsonLD\Exception\SyntaxException'
with message 'Invalid value for @language detected (must be a string) (near 
{"@language":{"__iri":"@language","__value":"ja"},"@value":
{"__iri":"@value","__value":"リズム天国ゴールド"}}).'

The original document does have just a string "ja" as value for @language, so it seems the processor is complaining about an expansion it performed itself.

I've uploaded a testcase which shows the problem using your HydraConsole proxy:

http://www.markus-lanthaler.com/hydra/console/proxy.php?debug=true&url=https://frob.nl/tmp/jsonld-language-bug/gmb.jsonld

The Hydra Console uses a modified processor in order to render the tooltips for the JSON-LD response. It expands the document while at the same time keeping the original structure. You can find that version of the processor in the “expansion-debug” branch. I haven’t updated it for a while now. I planned to refactor my processor quite a bit which should then simplify such things. How important is this to you? If it’s a deal breaker I’ll try to fix it now otherwise I’ll probably concentrate on other things first.

I'm just experimenting / prototyping, none of what I'm working on is in production -- so there's no hurry.

OK, great. Let me know when that changes :-)