inveniosoftware / inveniosoftware/docs-invenio-rdm
Inaccurate cardinality and JSON structure for locations metadata
- Dominant language
- HTML
- Stars
- 55
- Forks
- 84
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 9
Description
Hi team,
While working with the REST API and referring to the [Metadata Reference](https://inveniordm.docs.cern.ch/reference/metadata/#locations-0-n) (in `docs/reference/metadata.md`), I noticed a slight inconsistency regarding the `locations` field.
Currently, the heading states **Locations (0-n)**, which implies the field itself should be an array. However, the `locations` field in InvenioRDM expects a single object (following the GeoJSON `FeatureCollection` pattern), where the multiple geographical points are actually stored inside a nested `features` array.
This expected structure is also confirmed by a recent PR in the core repository ([inveniosoftware/invenio-rdm-records#2397](https://github.com/inveniosoftware/invenio-rdm-records/pull/2397)), which addresses OpenSearch indexing for the `locations` field and explicitly treats `metadata.locations` as an object containing the `features` array.
**Suggested corrections:**
1. Change the main heading from `Locations (0-n)` to **`Locations (0-1)`**.
2. Clarify in the subfields description that the `features` property is the actual array **`(0-n)`** holding the location objects.
3. Update the JSON snippet to reflect the correct nested structure.
Here is an example of the correct JSON structure for reference:
```json
{
"metadata": {
"locations": {
"features": [
{
"geometry": {
"type": "Point",
"coordinates": [10.2, 5.0]
}
},
{
"geometry": {
"type": "Point",
"coordinates": [5.1, 1.23]
}
}
]
}
}
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Open docs/reference/metadata.md and locate the Locations (0-n) entry in the Metadata Reference. Update the heading, clarify that features is the (0-n) array inside the locations object, and revise the JSON example to match the nested FeatureCollection structure. Done means the prose and snippet consistently describe locations as (0-1) with multiple points under features.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100