W3C home > Mailing lists > Public > public-linked-json@w3.org > November 2011

Re: Empty frame [] should not destroy triples

From: Dave Longley <dlongley@digitalbazaar.com>
Date: Wed, 23 Nov 2011 14:57:52 -0500
Message-ID: <4ECD5040.5050104@digitalbazaar.com>
To: Josh Mandel <Joshua.Mandel@childrens.harvard.edu>
CC: public-linked-json@w3.org
Josh,

This is a bug that I also discovered while looking into the other issue 
you brought up with @embed in your previous email. When I get a chance, 
I'll fix both of them.

-Dave

On 11/23/2011 09:51 AM, Josh Mandel wrote:
> I'm not sure if this is a bug, a design decision, or the unintended
> but necessary consequence of a design decision... but I realized that
> part of what makes it difficult for me to construct useful frames is
> the behavior of am empty array frame:  [].
>
> As far as I'm concerned, an empty frame ought to preserve the triples
> in the input graph. But the current behavior is more subtle:  when a
> predicate has multiple URI objects, sometimes these objects are not
> preserved in the output.  Here's the simplest case I can construct
> that demonstrates the issue:
>
> 1.  Input asserts three URI nodes:  a "looker" which canSee "spotted"
> and "forgotten".   Input also re-asserts that "spotted" exists.
> 2.  Frame is [].
> 3.  Output loses this triple:<looker>  <canSee>  <forgotten>.
>
> INPUT
> {
>      "@subject": [{
>          "@subject": "looker",
>          "canSee": [{
>              "@iri": "forgotten"
>          }, {
>              "@iri": "spotted"
>          }]
>      }, {
>          "@subject": "spotted"
>      }]
> }
>
> FRAME
> []
>
> OUTPUT (where's "forgotten"?)
> [{
>      "@subject": {
>          "@iri": "looker"
>      },
>      "canSee": {
>          "@iri": "spotted"
>      }
> }, {
>      "@subject": {
>          "@iri": "spotted"
>      }
> }]
>
> The thing that's really giving me grief is probably a downstream
> consequence of this behavior.  But I figured I'd start at the root of
> the problem. Is the behavior known, understood, or intended?
>
> Thanks again,
>
>    Josh
>


-- 
Dave Longley
CTO
Digital Bazaar, Inc.
Received on Wednesday, 23 November 2011 19:58:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:35 GMT