- From: Julian Everett <julianjeverett@yahoo.com>
- Date: Wed, 13 Aug 2014 07:28:23 -0700
- To: Dave Longley <dlongley@digitalbazaar.com>, Markus Lanthaler <markus.lanthaler@gmx.net>, "public-linked-json@w3.org" <public-linked-json@w3.org>
- Message-ID: <1407940103.44746.YahooMailNeo@web164905.mail.bf1.yahoo.com>
cool ok, thanks ________________________________ From: Dave Longley <dlongley@digitalbazaar.com> To: Julian Everett <julianjeverett@yahoo.com>; Markus Lanthaler <markus.lanthaler@gmx.net>; "public-linked-json@w3.org" <public-linked-json@w3.org> Sent: Wednesday, August 13, 2014 3:29 AM Subject: Re: Framing by reference/value On 08/12/2014 10:42 AM, Julian Everett wrote: > 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 6.2.3.1.1 and 6.2.3.2 > > 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? It seems ok at first glance, but I'll have to take a closer look when I can. We definitely want to keep the old behavior around as an option. Framing is currently being used to filter graphs that will be digitally-signed, and creating duplicate data (as aggressive embedding does) is an issue. The option for setting @embed to false is, as you say, to ensure that data is not embedded if it's undesirable. Sometimes you just want to get the link (@id) to some data when you frame, you don't want all of the node's associated data. > > thanks > > Julian > > > ------------------------------------------------------------------------ > *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 > @markuslanthaler > > > > > -- Dave Longley CTO Digital Bazaar, Inc.
Received on Wednesday, 13 August 2014 14:31:50 UTC