capitalization in apiso common queryables
- Dominant language
- Python
- Stars
- 240
- Forks
- 179
- Avg merge
- 5d 8h
- Merged PRs (30d)
- 10
Description
We did not find existing issue or documentation on this topic, sorry if this is the case.
We have encountered an issue when querying a pycsw regarding capitalization on apiso attribute filters.
The following minimal query returns an error `Invalid Constraint: Invalid Filter request: Invalid PropertyName: apiso:type. 'apiso:type'`
```
curl -X POST https://demo.pycsw.org/gisdata/csw -d '
full
apiso:type
dataset
'
```
Switching to `apiso:Type` with capitalization is functional.
However, from our understanding, the spec would lead to use `apiso:type` with lowercase.
From [07-045 specification, section 7.2.4](https://docs.ogc.org/is/07-045r2/07-045r2.pdf)
> If the typeNames attribute of a query equals to ‘gmd:MD_Metadata’ (‘gmd’
representing the ‘http://www.isotc211.org/2005/gmd’ namespace) any queryable
that is part of the associated filter must be represented by a qualified name with a
prefix (e.g. ‘apiso’), representing the ‘http://www.opengis.net/cat/csw/apiso/1.0’
namespace. This is true for both application profile queryables as well as for the
OGC common core queryables (which are mapped to the gmd metadata schema
then). Case sensitivity is as follows: For the common queryables use the same
case as defined in the base specification (e.g. ‘apiso:title’), for the additional
queryables use the cases as defined in this profile (tables 9-14), e.g.
‘apiso:RevisionDate’.
In [pycsw mapping](https://github.com/geopython/pycsw/blob/21998dbf57a71d82fe8f4c711f9e0a953e1633a1/pycsw/plugins/profiles/apiso/apiso.py#L75), the supported queryables are in capital case, even for common queryables, ie `apiso:Type`.
If we understood the spec correctly, would it be possible to add support for lower case common queryables (`apiso:type`, `apiso:identifier`, etc.) ?
Contributor guide
Research direction
Start in pycsw/plugins/profiles/apiso/apiso.py at the supported queryables mapping around line 75, then compare the common and profile-specific names with section 7.2.4 of the linked specification. The change is complete when lowercase common queryables such as apiso:type and apiso:identifier are accepted while additional profile queryables retain their specified capitalization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100