This would be a bug, and it does point to a hole in the test suite. We should have tests for every legitimate JSON element as a direct value of a JSON property, or @value. (Given how it’s implemented, hard to see how this might have happened).
Gregg Kellogg
gregg@greggkellogg.net
> On Sep 17, 2019, at 3:18 AM, Pierre-Antoine Champin <pierre-antoine.champin@univ-lyon1.fr> wrote:
>
> Hi all,
>
> when converting the following to RDF:
>
> {
> "@context": {
> "@version": 1.1
> },
> "http://example.org/prop <http://example.org/prop>": {
> "@value": "hello",
> "@type": "@json"
> }
> }
>
> the Ruby distiller gives this result
>
> _:b0 <http://example.org/prop <http://example.org/prop>> "hello"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON <http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON>> .
>
> which must be wrong because the literal does not parse correctly to JSON. It seems to me that it should instead be
>
> _:b0 <http://example.org/prop <http://example.org/prop>> "\"hello\""^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON <http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON>> .
>
> I had a (very) quick look at the API spec but could not find the related part. If this is what the spec says, it should probably be fixed? Eitherway, should I propose a new unit test to checj this case?
>
> best