Materials-Consortia / Materials-Consortia/optimade-python-tools

Validation of HAS ONLY queries

Open
#1,013 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted priority/medium suggestions validator
Dominant language
Python
Stars
91
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Quite a few databases now implement the optional "HAS ONLY" filter construct, though it seems that many do it incorrectly (like we did until @JPBergsma fixed it in #810 and #861). We should try to add a test for it in the validator (if the server implements it) - unfortunately it will be a bit tricky to construct test queries as the current failure mode is that "x HAS ONLY A, B, C" does not return results where x is a subset of {A, B, C}, so we will an additional query to that any entries exist with only {A, B} (say) and check that they are also returned in the final HAS ONLY query.

Typed this in a hurry, but hope that makes sense! I am also writing this issue so that I remember to bring it up at the next OPTIMADE meeting.

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 at the validator and review the HAS ONLY fixes referenced in #810 and #861, then examine how existing validation tests construct queries. Add coverage that checks subset results, including an additional query confirming entries with only {A, B}, and verify the test works when the server implements HAS ONLY.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.