Skip to content

Query use cases

Henry Story edited this page Jan 30, 2016 · 2 revisions

This is a wiki page to document use cases where having the server support QUERY may be helpful. See issue-46.

Use Cases

Speed up data display and resilience

In order to build a dynamic application that consumes data, it will often help if the browser only downloads the data it needs to build the display. This would also protect the client from downloading large files when perhaps only a couple of relations are important for its display.

Ideally a browser supporting this would cache the partial data downloaded and know when it needs to fetch more.

motto: Query is to GET what PATCH is to PUT - an optimisation technique

finding application workspaces

If every application creates its workspace in a special container, then every application can describe itself in that container. But with LDP currently it is not clear how an application reaching the workspaces directory can find out what LDPC belongs to it (for example if it somehow lost that info). If one wants to keep the vocabulary creation to a minimum and have a simple architecture an application would have to step through every container it has access to and query it. A Query could allow this to happen quickly on the server.

Other methods would be:

  • to put more information about the contents of LDPCs in the LDPC description. But how does one do this in a generic way without the server needing to be hard coded to learn what to display?
  • to create a special file that contains that data about all the container spaces, but this would have to be writeable by every application if this LDPR is not going to be hard coded on the server.

Verbs

SEARCH

Proposed HTTP SEARCH method by the LDP group in April to the HTTP mailing list.

Implemented by rww-play but only currently for one LDPR (it does not search the content of an LDPC)

GET + Body

This possibility was discussed on the IETF HTTP mailing list.

Query Languages

List different languages and their pros and cons for different use cases.

SPARQL Query

The advantage is that this is specified, On the other hand it is a powerful language difficult to implement from scratch.

Limited to one graph

Rww-play implements SEARCH supporting SPARQL on one graph only in order to speed up request, though to be really useful it would require the CORS proxy to also support such a QUERY.

Description and content of container

It is easy to see how contents of an LDPC map to subgraphs of an LDP Container.