W3C home > Mailing lists > Public > public-json-ld-wg@w3.org > September 2019

Re: possible bug in the distiller or the API spec ?

From: Gregg Kellogg <gregg@greggkellogg.net>
Date: Tue, 17 Sep 2019 12:32:18 +0900
Message-Id: <E0076AA3-7855-48DB-A699-36748C045A92@greggkellogg.net>
Cc: W3C JSON-LD Working Group <public-json-ld-wg@w3.org>
To: Pierre-Antoine Champin <pierre-antoine.champin@univ-lyon1.fr>
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
Received on Tuesday, 17 September 2019 03:32:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 17 September 2019 03:32:48 UTC