This was my thinking as well. Annotating GraphQL query result with JSON-LD would seem to be useful only for converting JSON returned by the GraphQL query back to RDF. In our experience, however, GraphQl queries are used by applications that are not RDF aware. They do not need to get RDF back from the GraphQL endpoint. We have not, so far, received any requirements (or even questions) about supporting JSON-LD context in GraphQL.
I would also not go as far as describe GraphQL as “the main query interface” in TopBraid EDG. SPARQL is and always has been fully supported. I think GraphQL is the main and preferred interface for the traditional client-side applications. > On Mar 2, 2020, at 6:52 PM, Holger Knublauch <[email protected]> wrote: > > Hi Rob, > > I am aware that other GraphQL implementations on top of RDF do support > JSON-LD context generation. Technically, this might be doable, although there > are some cases like sh:path expressions where there is no single property or > triple that we could map to, and of course no JSON-LD would be able to map > partial queries like { label } without also having a uri field. > > The thing I would like to better understand is what would clients do with > that info. My assumption is that we use GraphQL to "flatten" a graph into a > tree structure for easy consumption by rather traditional client-side code, > e.g. written in React or other JS libraries. Would those clients really have > a full RDF-based API, and would they be able to make sense of the partial > graphs that would be returned by the server? If yes, isn't a SPARQL CONSTRUCT > a more natural way to produce graphs, instead of relying on another set of > intermediate steps? > > Holger > > > > On 3/03/2020 09:22, Rob Atkinson wrote: >> >> to fully "support" JSON-LD it would be required to support it in the main >> query interface - i.e. the GraphQL JSON response should be decorated with a >> JSON-LD context statement that binds the available URI identifiers to the >> graphql schema elements - after all the graphql schema is generated from the >> underlying SHACL models. >> >> For interoperability such JSON-LD contexts should be modular of course - if >> a model imports SKOS then the JSON-LD context should import a SKOS context >> rather than dump it out. If this is too much work in the short term, I'd >> suggest that the injection of a context via a URI referencing another >> service which constructs the context for a given graphql schema - and if >> necessary leave it empty, but allow this to be customised by users to be >> more modular in future. This at least establishes an architecture which can >> be evolved to seamlessly allow more natively supplied detail in future, >> without too much effort in the short term. >> >> >> >> On Tuesday, 3 March 2020 09:29:44 UTC+11, R. U.S. wrote: >> Hi, I've been working with Topbraid for a while and now I need to support >> JSON-LD files (importing/editing/exporting). What is the current support for >> it? Can you point me to the documentation for this? >> -- >> You received this message because you are subscribed to the Google Groups >> "TopBraid Suite Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <mailto:[email protected]>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/topbraid-users/bbe0d0c2-6326-4dda-a107-703a3cdef750%40googlegroups.com >> >> <https://groups.google.com/d/msgid/topbraid-users/bbe0d0c2-6326-4dda-a107-703a3cdef750%40googlegroups.com?utm_medium=email&utm_source=footer>. > > > -- > You received this message because you are subscribed to the Google Groups > "TopBraid Suite Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/topbraid-users/2f99615b-75f8-7820-0d3c-3bd9d77f96c0%40topquadrant.com > > <https://groups.google.com/d/msgid/topbraid-users/2f99615b-75f8-7820-0d3c-3bd9d77f96c0%40topquadrant.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/34CC39D6-3971-45D2-BADB-E9F2497ECD62%40topquadrant.com.
