Implement LDP paging
Specs: https://www.w3.org/TR/ldp-paging/
Implementation note:
A subset query should work better for pagination:
CONSTRUCT { ?s ?p ?o }
WHERE {
{ SELECT ?s WHERE { ?s a <http://dbpedia.org/ontology/MusicalArtist> } LIMIT 50 }
?s ?p ?o
}
If you put the LIMIT directly in the main query, it won't work because it stops after 50 triplets.
Reading the specs, I conclude that LDP pagination is optional, so as not to impact clients who don't understand this standard.
If you do a GET on a container like this:
GET /projects HTTP/1.1
Host: example.org
Prefer: return=representation; max-member-count=“10”
In the documentation they use
max-triple-countby default, but it seems complicated to use.
The server must return a 303 with the URL to the first page (which can be formatted as you like):
HTTP/1.1 303 See Other
Location: <http://example.org/projects?page=1>
If we then fetch page 1, always indicating the max-member-count (so that the server knows how many elements there should be on this first page):
GET /projects?page=1 HTTP/1.1
Host: example.org
Prefer: return=representation; max-member-count=“10”
In the response header, we indicate that this is a ldp:Page. There's also a link to the following page:
HTTP/1.1 200 OK
Link: <http://www.w3.org/ns/ldp#Resource>; rel=“type”,
<http://www.w3.org/ns/ldp#Page>; rel=“type”
Link: <http://example.org/projects?page=2>; rel=“next”
... the data
You can also optionally use rel “first”, “prev” and “last” (see https://www.w3.org/TR/ldp-paging/#ldpp-ex-paging-other-links).
All in all, it doesn't look too complicated, and has the advantage of being optional and flexible (you can choose the number of elements to return per page). The main difficulty will be to make an efficient SPARQL query.
Génial que ca n'ait pas l'air trop compliqué ! T'aurais une estimation du nombre de jours nécessaires @srosset81 ?
Je dirais 2 JH, et 1 JH supplémentaires pour intégrer ça dans le data provider de React-Admin.
Huuum ca semble intéressant comme amélioration, la question des performances étant fondamentale ... un cofinancement de la part de plusieurs orgas / utilisateurs de SemApps serait je crois pertinent ! Je vais y réfléchir !
Florian des Colibris a fait ressortir ce besoin. Il fait des fetch sur les containers LDP pour intégrer les données sémantique de colibris.social dans un Wordpress. Mais certains containers ont des milliers de ressources, ce qui génère des timeouts (sauf lorsque tout est en cache). Si on avait la pagination implémentée, ce serait beaucoup plus simple à gérer.