Standards · Query

GraphQL-LD: GraphQL queries over linked data

GraphQL-LD translates a GraphQL query plus a JSON-LD context into SPARQL, so a developer who already knows GraphQL can query RDF without learning triple patterns.

Standards · SPARQL · JSON-LD · Why knowledge

What it is

GraphQL-LD is an approach for querying linked data with GraphQL queries and a JSON-LD context. The query states the shape of the answer, the context maps terms to IRIs, and a translation step turns the pair into SPARQL; results return as the tree the query described.

What it gives the knowledge layer

It gives the knowledge layer a lower entry cost for application teams. The paper argues that most application developers are not experienced with RDF triples and are better equipped to handle nested objects, and that GraphQL is tightly integrated into the frameworks they already use.

Where the spec lives

There is no W3C specification. The approach is documented in an ISWC 2018 poster and demo paper by Taelman, Vander Sande and Verborgh, and implemented in GraphQL-LD.js, which converts the query, executes the SPARQL against a local or remote engine, and converts results into a tree. It rests on SPARQL and JSON-LD 1.1.

What it does not solve

It is deliberately less expressive than SPARQL: the authors state that GraphQL queries represent trees rather than full graphs, so GraphQL-LD covers many typical retrieval tasks but not the whole language. It is also a research-and-tooling approach rather than a ratified standard, and the paper lists formalising the conversion algorithm as future work.

FAQ

No. GraphQL-LD is a research approach documented in an ISWC 2018 demo paper, with an open-source implementation and no W3C Recommendation to conform to. SPARQL and JSON-LD are the standards underneath it.

The query and the JSON-LD context are converted into SPARQL, the SPARQL is executed against a local engine or a remote endpoint, and the results are converted back into a tree.

No, and the authors say so: GraphQL queries represent trees rather than full graphs, making the approach less expressive than SPARQL while still covering many typical retrieval tasks.

A GraphQL query and a JSON-LD context mapping the terms used in the query to IRIs. The paper notes the context can come from external domain experts.

Sources

  1. GraphQL-LD: Linked Data Querying with GraphQL — Taelman, Vander Sande, Verborgh (ISWC 2018 poster and demo)
  2. GraphQL-LD.js — open-source implementation