ontola / ontola/atomic-server

Should sorting filter a value?

Open
#296 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.6k
Forks
82
Avg merge
10h 34m
Merged PRs (30d)
205

Description

Because of how I've implemented sorting, sorting now results in a filtered list. If the sorter property value is not present in a resource, it will be left out of the collection.

example: https://atomicdata.dev/collections?sort_by=https%3A%2F%2Fatomicdata.dev%2Fproperties%2Fdescription

Question is: is this OK? Is this what users will expect? I know it's not what I tested for in the sort functions themselves, it's a side effect happening in the Query Index.

On extra complex situation, is with false boolean values. I've decided to interpret no value to be the same as false, so when you sort a boolean value, you only see true values.

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

Start by reviewing the Query Index behavior described in the issue and reproduce the example collections URL. Resolve the expected semantics for missing sorter values and false booleans, then document and implement the agreed behavior with coverage for both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.