Framing and Query

Hi Gregg, I'm glad to be here and I hope I can be of help.

I've taken the liberty of renaming this thread, and capturing the main recent salient points on this topic from the previous thread:

Gregg >>> Additionally, the Framing algorithm [2] has proven to be important, but work on the specification was never complete, and implementations  have moved beyond what was documented in any case.
Markus >> It is certainly handy but I'm not sure there's agreement on what exactly it should be. Initially it was just (or at least mostly) about re-framing an existing graph... I think what a lot of people (myself included) actually want and need is to query a graph and control the serialization of the result. Maybe we should start with a discussion on the role of framing!?
George >> I have a particular interest in framing, and I concur with Markus that what I actually want is (some degree of) graph query.
Gregg > I know there has been some discussion on more sophisticated querying, but I’m not aware of any specific proposals. And, for my part, it seems to me that SPARQL Construct pretty much handles these use cases, other than for named graphs. It seems to me that trying to do something very significant could easily be a rat-hole, but it’s worth a discussion.
>
> Another possibility I considered at one point was a JSON-LD based query specification language that would parse to the SPARQL Abstract Algebra (or simply generate SPARQL syntax), with triples derived from the JSON-LD used as the implicit dataset. This is probably more constrained, and leaves the messy query bits to a mature specification. This is significant enough, that it probably requires a specification separate from framing, and presumes that it’s the SPARQL syntax that is the issue being addressed.

The first internal POC I did with JSON-LD included a JSON query specification language, very closely related to a number of JSON query syntaxes such as MongoDB, FreeBase, Backbone-ORM and TaffyDB. In common with these it was deliberately limited in its capabilities, particularly for joins (ironically); but it was heavily invested in JSON-LD, effectively being a super-set with query operators. It was intended to be backed by our native Oracle schema, but it actually found more traction as an API to JSON-LD in elasticsearch.

I can go into more detail on that if there's interest. But in the meantime, earlier this year another POC led me to using an actual Triplestore for the first time, and I spent some happy hours fighting with constructing SPARQL in Node.js. Long story short, I ended up doing precisely what you (Gregg) just suggested :) I've shared it on GitHub and NPM [1].

> I think there are several ways we could go:
>
> 1) Improve framing based on the existing algorithms which provide some degree of manipulating and limiting the framed data based on existing relationships.
> 2) Consider a way to include a variable syntax, and how this might be used for both matching and constructing data

While I'm a fan of query-by-example, I think in the general case there's too much complexity in interlacing the Query (pattern-matching existing relationships), with the Frame (the structure I want to return). Personally, I've always ended up separating these concerns in the syntax. However, I think it does come down to how powerful you want your query language to be. GraphQL [2] happily combines the two into one tree, because its query syntax is very limited, deliberately. Trying to do the full power of SPARQL in this way would surely be messy. But these languages have different, almost non-overlapping, sweet-spots--one is for building application APIs, the other for database APIs.

> 3) Consider the implications of using SPARQL via de-serialization from JSON-LD to the RDF data model, performing a SPARQL query operation, and re-serializing back to JSON-LD and framing using some variation of the existing algorithms.

I'm not sure what you mean here. Can you elaborate?

>
> I’m certainly interested in hearing suggestions on other approaches, along with some use cases/examples.

[1] https://github.com/gsvarovsky/json-rql

[2] http://graphql.org/


-----Original Message-----
From: Gregg Kellogg [mailto:gregg@greggkellogg.net]
Sent: 10 October 2016 23:51
To: George Svarovsky <gsvarovsky@idbs.com>
Cc: Markus Lanthaler <markus.lanthaler@gmx.net>; Linked JSON <public-linked-json@w3.org>
Subject: Re: Reactivating the CG to work on updated versions of the specs

> On Oct 10, 2016, at 2:32 AM, George Svarovsky <gsvarovsky@idbs.com> wrote:
>
> Hi Markus & Gregg & everyone

Hi George, glad to have you! Please consider joining the Community Group [1], which simplifies IP issues.

> I've worked with JSON-LD since 2013, for IDBS internal POC work, including prototype APIs and indexing in elasticsearch. I'd like to make it the lingua franca of our foundational APIs going forward. So although I'm not currently a 'heavy user', I'd like to become one! and I'd be very happy to be involved in the new wave of progress.
>
> I have a particular interest in framing, and I concur with Markus that what I actually want is (some degree of) graph query. I have some thoughts, which I'll write out in a new thread.

I think there are several ways we could go:

1) Improve framing based on the existing algorithms which provide some degree of manipulating and limiting the framed data based on existing relationships.
2) Consider a way to include a variable syntax, and how this might be used for both matching and constructing data
3) Consider the implications of using SPARQL via de-serialization from JSON-LD to the RDF data model, performing a SPARQL query operation, and re-serializing back to JSON-LD and framing using some variation of the existing algorithms.

I’m certainly interested in hearing suggestions on other approaches, along with some use cases/examples.

> Otherwise do let me know the best way I can help…

Excellent.

> George
>
> George Svarovsky | Technical Director | IDBS gsvarovsky@idbs.com |
> www.idbs.com | @gsvarovsky

Gregg

[1] https://www.w3.org/community/json-ld/participants


> -----Original Message-----
> From: Markus Lanthaler [mailto:markus.lanthaler@gmx.net]
> Sent: 10 October 2016 09:55
> To: 'Linked JSON' <public-linked-json@w3.org>
> Subject: RE: Reactivating the CG to work on updated versions of the
> specs
>
> It is great to see you taking the initiative on this Gregg!
>
> On 30 Sep 2016 at 11:31, Gregg Kellogg wrote:
>> JSON-LD 1.0 and JSON-LD API 1.0 have been out and successful for many years now.
>> JSON-LD has succeeded beyond the wildest dreams of the CG, thanks to broad adoption.
>
> Indeed!
>
>
>> Additionally, the Framing algorithm [2] has proven to be important,
>> but work on the specification was never complete, and implementations
>> have moved beyond what was documented in any case.
>
> It is certainly handy but I'm not sure there's agreement on what exactly it should be. Initially it was just (or at least mostly) about re-framing an existing graph... I think what a lot of people (myself included) actually want and need is to query a graph and control the serialization of the result. Maybe we should start with a discussion on the role of framing!?
>
>
>> I think it’s time to get back to these documents to create a future
>> 1.1 Community Group release of the specifications;
>
> 1.1 sounds like minor tweaks to the existing official W3C specifications but some of the discussions and proposals I just saw go way beyond that. What do you consider to be in scope for 1.1?
>
>
>> At this point, I’d be happy to see active engagement on the mailing
>> list to move these issues forward; I’m prepared to do the heavy
>> lifting on the specification documents, and to maintain tests and my
>> own Ruby implementation to match. Hopefully, other implementors and
>> heavy users can actively engage in making this happen (perhaps an
>> hour a week). It may be that we’ll want to start up the bi-weekly calls we used to discuss and resolve on these issues prior to moving into the RDF WG.
>
> I'd definitely like to help with this but unfortunately my spare cycles are quite limited.
>
>
> Cheers,
> Markus
>
>
> --
> Markus Lanthaler
> @markuslanthaler
>
>
> The content of this e-mail, including any attachments, is confidential and may be commercially sensitive. If you are not, or believe you may not be, the intended recipient, please advise the sender immediately by return e-mail, delete this e-mail and destroy any copies.


The content of this e-mail, including any attachments, is confidential and may be commercially sensitive. If you are not, or believe you may not be, the intended recipient, please advise the sender immediately by return e-mail, delete this e-mail and destroy any copies.

Received on Tuesday, 11 October 2016 10:03:22 UTC