A graphql-esque framework to query linked data

I am thinking about implementing a framework that is inspired by the design of graphql and the prisma client to query linked data.

This is my design draft that also includes some intentions behind this: https://docs.google.com/document/d/16Ac7lI_gHn-9eYIlws26je4miCic4DzNXzvM4glP7OQ/edit?usp=sharing

If you are also a solid/linked data developer, you could maybe give me some feedback/criticism or just elaborate on a use case/edge case that you would have with this. This is a very rough first draft, so if you find something that is incomplete or false, feel free to point it out as I am just starting this project now.

3 Likes

@RubenVerborgh might be able to comment or know someone who can.

4 Likes

Are you aware of GraphQL-LD and HyperGraphQL?

3 Likes

@aveltens Didn’t know about HyperGraphQL thank you for showing me that :slight_smile: but i was more looking for a js/ts lib that queries resources directly from the browser env

The reasons i don’t use graphql-ld are mainly context objects vs prefixes, no custom resolvers and no mutations. Regarding the general design of the queries and the client think it is also possible to be even closer to the regular graphql and therefore make it really easy for people that come from this background.

2 Likes

Sorry to be late to the party, but you may be interested by json-rql, which is very simply a serialisation of SPARQL, but intended to be used in a GraphQL-like way. In particular, being JSON it’s easy to construct in javascript, and easy to validate on the server, for example using JSON Schemas.

json-rql is just a language and does not have the framework and caching support that you want, though those things should be fairly straightforward to put together. The npm Javascript library offers a reference translation to/from SPARQL, and there is a Java AST library including integration with Jena.

My project m-ld uses json-rql for its API, with the intention of hiding complexity for common use-cases. m-ld is decentralised so it doesn’t have a server-side, but it’s easy to envisage. Happy to talk about it more if it’s of interest.

2 Likes