nodeSolidServer / nodeSolidServer/node-solid-server

Globbing, sorting and paging

未关闭
#956 12 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feature
主要语言
JavaScript
星标
1.8k
派生
308
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

该 issue 没有指出任何文件、测试或入口点。首先跟踪 /items/* 之类的 globbing 请求是如何处理的,以及查询参数是如何解析的;然后确定应如何规定和测试按 subject 的 predicate 排序以及使用 offset/count 的分页。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, node.js
领域
api, backend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。