-
Notifications
You must be signed in to change notification settings - Fork 59
Description
In an RDF based app I was working on, we started out with a RESTful RDF API where the client used one request to fetch one resource (one GET to each subject). This was quite costly, since every HTTP request has some overhead, and in many single page views, many resources would need to be fetched. To fix this, we implemented a 'bulk-API' which basically boils down to an endpoint where you could post a body of new-line-deliniated URLs, and the server would reply with one large n-triples document that contains all the statements for the requested subjects. Not a pretty solution, but it helped make the app faster.
Currently, most solid apps work like our old API: one request per subject. In order to provide a snappy UI, we need a more performant way to query pods.
Options
SPARQL endpoint
SPARQL is a very powerful query language that will definitely solve this problem, but it can be hard for new developers and costly on the server. Exposing a SPARQL endpoint is often not a great solution for production apps.
TPF endpoint (+ multiple subjects!)
Triple Pattern Fragments were designed as a easier, low-cost SPARQL alternative. However, the spec does not allow for querying multiple subjects in one request. If we allow multiple subjects in the subject field, this would the the aforementioned usecase.
Perhaps there are other options, would love to hear your thoughts.