W3C home > Mailing lists > Public > public-linked-json@w3.org > August 2016

Re: JSON-LD & nested structure

From: Gregg Kellogg <gregg@greggkellogg.net>
Date: Tue, 2 Aug 2016 12:47:05 -0700
Cc: Aymeric Brisse <aymeric.brisse@gmail.com>, public-linked-json@w3.org
Message-Id: <24841F9F-334F-49D2-8890-97AE2A52BD01@greggkellogg.net>
To: Dave Longley <dlongley@digitalbazaar.com>
> On Jul 29, 2016, at 9:04 AM, Dave Longley <dlongley@digitalbazaar.com> wrote:
> On 07/29/2016 11:55 AM, Aymeric Brisse wrote:
>> @Gregg : I cannot assume that the property will only be used by the
>> top-level element.
>> @Dave : already tried it but it doesn't work
> I modified Gregg's example and it worked for me:
> http://json-ld.org/playground/#/gist/bd569269ce69a8fe7ecebde0713acc73

Dave, I do have the support for supporting value matching on @id, but the reason this doesn’t work for me is that when the frame is expanded, it returns an empty array, rather than one containing on object with the expanded @id. If you take the frame from the playground link and expand it, you’ll get the same thing. Yet, when used for framing, your processor seems to act as if the frame is not empty.

My algorithm works by expanding both input and frame, and using that the frame the output, which is re-compacted using the context from the frame. Yours seems to work differently. The spec algorithm says it uses both expanded input and expanded frame, so yours looks like it doesn’t end up using the expanded frame.

From the expansion algorithm step 12.2: "Otherwise, if result is a JSON object whose only key is @id, set result to null”. This would seem to apply here, and result in a null frame, leading to an empty array result.

If I add “talksAbout”: {} to the frame, my processor works as expected.

> -- 
> Dave Longley
> Digital Bazaar, Inc.
> http://digitalbazaar.com
Received on Tuesday, 2 August 2016 20:09:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:48 UTC