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

Re: Framing by reference/value

From: Julian Everett <julianjeverett@yahoo.com>
Date: Tue, 12 Aug 2014 07:42:52 -0700
Message-ID: <1407854572.35893.YahooMailNeo@web164905.mail.bf1.yahoo.com>
To: Markus Lanthaler <markus.lanthaler@gmx.net>, "public-linked-json@w3.org" <public-linked-json@w3.org>
Cc: 'Dave Longley' <dlongley@digitalbazaar.com>
So I think I now have a working version of the Javascript library with the required behaviour (I'm still adding tests for indirect circular references via sets, etc - but so far all are passing). Before I continue, I just wanted to check my logic with you against the framing algorithm http://json-ld.org/spec/latest/json-ld-framing/#framing-algorithm

What I have done is to remove the whole of 4.4.4, on the basis that if you can detect a circular reference and block it prior to injecting it then you never need to do a 'Remove Embedded Definition' subsequently. I've then added checks for circular reference injection prior to the recursive calls at and

The circular reference check works by traversing back up the chain of resource->parent['@id'] links in the 'map of embeds' to ensure that the injected resource is not a direct or indirect ancestor of the current embed target.

Any obvious holes in this logic? FYI one thing making feel a bit nervous :-)  is that I don't entirely get the point of the embed processor option (although I can see why it makes sense inside a framing context): setting that to false basically means don't frame doesn't it, as the only output will be the set of root resource URIs?



 From: Markus Lanthaler <markus.lanthaler@gmx.net>
To: public-linked-json@w3.org 
Cc: 'Julian Everett' <julianjeverett@yahoo.com>; 'Dave Longley' <dlongley@digitalbazaar.com> 
Sent: Monday, August 11, 2014 4:49 PM
Subject: RE: Framing by reference/value

On Friday, August 08, 2014 5:35 PM, Dave Longley wrote: 
> On 08/08/2014 06:05 AM, Julian Everett wrote:
> >> Is such output achievable via framing please, or do I need to add some
> >> kind of post-framing graph denormalisation step?
> There have been a number of discussions regarding "aggressive
> embedding" (or embedding by value as you called it). The details
> (flags to turn it on/off, dealing with cycles, etc.) haven't been
> fully worked out and the feature hasn't been implemented in the
> JavaScript library used on the playground. I think Markus may have
> implemented something in his PHP processor.

Yes, my processor [1] supports this (and a couple of other things). There's
a playground at [2] that you can use to try it without having to install
anything. The example you posted works exactly as you expected Julian.

I have found this to be an extremely useful feature and turned it on by
default (even though that means I fail some of the framing tests we have).

[1] https://github.com/lanthaler/JsonLD

[2] http://www.markus-lanthaler.com/jsonld/playground/

Markus Lanthaler
Received on Tuesday, 12 August 2014 14:43:25 UTC

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