SciCatProject / SciCatProject/backend
Support for filters on nested `scientificMetadata` with `/api/v3/datasets/fullquery`?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 27
- Forks
- 37
- Avg merge
- 17h 32m
- Merged PRs (30d)
- 38
Description
For us having nested metadata is quite important, e.g. a simple (fake) example:
"scientificMetadata": {"attr6": {"attr7": {"value": "exampleValue"}}}
However, it seems that it's not possible to filter datasets on such metadata using the UI, using dots to represent the hierarchy. I think this is because in mapScientificQuery dots are escaped, I assume so that users can have keys in the metadata which themselves contain dots:
Deleting that line (mostly) solves the problem.
Are there any plans to support filtering on such metadata?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/common/utils.ts at mapScientificQuery around line 151, then trace how /api/v3/datasets/fullquery applies the resulting filters. Review the handling of escaped dots and nested scientificMetadata keys; done means nested metadata filters work without losing support for keys that contain dots.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100