RE: Thoughts on querying JSON-LD

> 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 UTC