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

RE: Thoughts on querying JSON-LD

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Tue, 24 Jul 2012 11:21:56 +0200
To: "'Linked JSON'" <public-linked-json@w3.org>
Message-ID: <00d101cd697d$c92228e0$5b667aa0$@lanthaler@gmx.net>
> One of the consequences of pursuing using a connect/graphiphy/link-type
> API call to create an in-memory graph out of JSON-LD as an alternative
> to framing is that this does not come with a query mechanism.

Gregg, I asked that already in the telecon but let me ask again. Do you see
this discussion as "either framing or graphiphy" or an "introduction of
graphiphy"?

I would say supporting and allowing to combine both, framing (which should
support at least basic queries, a.k.a value matching and deep-filtering [1]
and aggressive re-embedding [2]) and graphiphy, would give us the most
flexible solution and allow developers to build more sophisticated solutions
on top of it.

> A SPARQL expression is typically transfered to an abstract syntax,
> which can be represented using S-Expressions. For example, consider the
> following query:
> 
>     PREFIX foaf: <http://xmlns.com/foaf/0.1/>
>     SELECT *
>     WHERE {
>         ?x foaf:name "Gregg Kellogg";
>              foaf:knows ?y .
>        ?y foaf:name ?n .
>     }
>
[...]
>
> Alternatively, a more sophisticated query engine, might create a nested
> query as follows:
> 
>     {
>       "@id": "?x",
>       "foaf:name": "Gregg Kellogg",
>       "foaf:knows": {
>         "@id": "?y",
>         "foaf:name": "?z"
>       }
>     }

The question I ask myself here is which form is easier to understand for a
Web developer? Currently I lean towards the latter but I definitely see
value in automatically transforming SPARQL queries to frames.

If we use this (with some sensible flags to explicitly define what should be
included in the result graph and what not) to find the entry point of the
graph and then allow to graphiphy the result I think we have a very powerful
solution.

Btw. I've already implemented value matching and deep-filtering in my
processor. See [3] for an example. You can fine-tune the result by playing
with @explicit , @embed, and @embedChildren.


[1] https://github.com/json-ld/json-ld.org/issues/110
[2] https://github.com/json-ld/json-ld.org/issues/119
[3] http://bit.ly/NsNS6V



--
Markus Lanthaler
@markuslanthaler
Received on Tuesday, 24 July 2012 09:22:41 GMT

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