nodeSolidServer / nodeSolidServer/node-solid-server

Globbing, sorting and paging

Open
#956 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
JavaScript
Stars
1.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

Would it be possible to add query parameters for sorting and paging when requesting a "globbing" resource?

When presenting a list of items (blog comments, chat entries, pets, whatever), it is very common to let the server do paging and sorting to improve efficiency for browsing through large amounts of data (as compared to loading all N-thousand Turtle statements and throw away 99% of them in order to show the top 1%).

It could work as follows:

  • A globbing request like "/items/*" normally returns the Turtle content of all resources stored under "/items". Each of theses resources contains a set of Turtle statements.

  • One URL parameter, like for instance "orderBy", could define a predicate identifier (or multiple) to order the resources by.

  • Other URL parameters, like for instance "count" and "offset" could define which "slice" of the sorted resources to return.

  • As a result, only the content of the first "count" resources, from index "offset", when ordering the resources by the value of the predicates in the resources by "orderBy", would be returned.

Example, get the first 10 items ordered by the value of http://schema.org/name: /items/*?orderBy=https%3A%2F%2Fschema.org%2Fname&offset=0&count=10

The "orderBy" predicate is only evaluated for statements where the subject is identical to the resource URL.

I kind of assume this suggestion is covered in existing work on linked data.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by tracing how globbing requests such as /items/* are handled and how query parameters are parsed; then determine how sorting by a subject's predicate and offset/count paging should be specified and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.