W3C home > Mailing lists > Public > public-linked-json@w3.org > July 2013

Re: Convert also "partial" lists from RDF to JSON-LD

From: Niklas Lindström <lindstream@gmail.com>
Date: Fri, 5 Jul 2013 12:44:41 +0200
Message-ID: <CADjV5jdbjAzg=7EfaPvLaXRatgOFfiaA0Vp__xvVik=3cn7J4g@mail.gmail.com>
To: Markus Lanthaler <markus.lanthaler@gmx.net>
Cc: RDF WG <public-rdf-wg@w3.org>, "public-linked-json@w3.org" <public-linked-json@w3.org>, Andy Seaborne <andy@apache.org>
Hi Markus,

On Fri, Jul 5, 2013 at 12:02 PM, Markus Lanthaler
<markus.lanthaler@gmx.net>wrote:

> CC'ing public-linked-json as this discussion might result in a change to
> the
> algorithms and may help the OpenAnnotation people.
>
>
> On Thursday, July 04, 2013 10:21 PM, Andy Seaborne wrote:
> > The set of all heads of well-formed lists can be found quite easily.
> >
> > All lists have a common tail (rdf:nil).  Just walk back up the list
> > checking nodes have exactly one rdf:first and one rdf:next triple.
> > This generates the list head.
>
> You are of course right and the necessary changes to the algorithm should
> be
> quite small.
>
> Currently a @list can never be the value of a rdf:first/rdf:rest. This kind
> of ensures that only "complete" lists are transformed to @list and that we
> don't produce lists of lists in JSON-LD.
>
> An example might clarify what I mean. Currently we would never produce
> something like
>
>   {
>     "@id": "http://example.com/",
>     "rdf:first": "A",
>     "rdf:rest": { "@list": [ "B", "C", "D" ] }
>   }
>
> all the list bnodes would be preserved:
>
>   [
>     {
>       "@id": "http://example.com/",
>       "rdf:first": "A",
>       "rdf:rest": { "@list": [ "B", "C", "D" ] }
>     },
>     {
>        "@id": "_:b0",
>        "rdf:first": "B"
>        "rdf:rest": { "@id": "_:b1" }
>     },
>     ...
>   ]
>

Detail: in the second example (how it is currently), first object, you
meant "rdf:rest": "_:b0", right?


> Arguably changing that would result in a nicer result. This might also be a
> quite elegant solution for the OpenAnnotation people. I think we could
> threat this change as an algorithmic bug fix (meaning, no need for another
> LC).
>
> I've created ISSUE-277 for this:
>   https://github.com/json-ld/json-ld.org/issues/277
>
>
> Thoughts?
>

I agree. I actually thought it was supposed to behave this way, so I'd
certainly consider it a bug fix.

Cheers,
Niklas

--
> Markus Lanthaler
> @markuslanthaler
>
>
>
Received on Friday, 5 July 2013 10:45:38 UTC

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