opengeospatial / ogcapi-records

An open standard for the discovery of geospatial resources on the Web.
https://ogcapi.ogc.org/records
Other
59 stars 28 forks source link

filter by keyword from specific controlled vocabulary #139

Closed pvgenuchten closed 1 year ago

pvgenuchten commented 3 years ago

What is the best approach to allow filtering on keyword-from-vocabulary?

For example:

?vocabulary=NGDA%20Theme&keyword=Transportation

But this is problematic if the filter has 2 keywords from 2 vocabularies

An optimal approach would be to filter by keyword uri (which binds the keyword to a vocabulary)?

pvretano commented 3 years ago

@pvgenuchten that is what the themes queryable is for ... so, from the example in the specification ...

        "themes": [
            {
                "concepts": [
                    "dobson",
                    "brewer",
                    "vassey",
                    "pion",
                    "microtops",
                    "spectral",
                    "hoelper",
                    "saoz",
                    "filter"
                ],
                "scheme": "https://geo.woudc.org/codelists.xml#WOUDC_InstrumentCode"
            },
            {
                "concepts": [
                    "atmosphericComposition",
                    "pollution",
                    "observationPlatform",
                    "rocketSounding"
                ],
                "scheme": "https://wis.wmo.int/2012/codelists/WMOCodeLists.xml#WMO_CategoryCode"
            }
        ],

You can then use a filter to say something like:

?scheme=https://geo.woudc.org/codelists.xml#WOUDC_InstrumentCode&term=spectral

Of course, you need to expose scheme and term as queryables from the /queryables endpoint.

Does that help?

pvretano commented 3 years ago

@pvgenuchten on second reading, I think this clause probably needs to be expanded a bit with more explanation. The idea is that you can tag a record with free form keywords AND/OR you can also tag a record with terms/concepts/nodes from a formal taxonomy. I think the example in the specification is great if you are a meteorologist but useless for everyone else. We probably need an additional example(s) using much simpler and more relatable taxonomies based on food or vehicles or something like that. I'll take a stab at an edit before the next meeting.

pvretano commented 1 year ago

07-APR-2023: Related to issue #181.

pvretano commented 1 year ago

21-APR-2023: @pvretano provides an example of how to search within a specific controlled vocabulary here. However, this example relies on the server implementing Part 3 of Features](https://docs.ogc.org/DRAFTS/19-079r1.html) and CQL2 to have access to the queryables. Without implementing Part 3, you would need to use a JSON path expression like: ...$.properties.themes.scheme=https://geo.woudc.org/codelists.xml#WOUDC_InstrumentCode&$.properties.themes.concepts=spectral... (if that is even valid in Features Part 1) and you would not be able to logically combine controlled vocabulary searches across multiple themes. It seems to us (@pvretano and @kalxas) that requiring Part 3 of Features and CQL2 for controlled vocabulary searches is not a big ask.
Will solicit feedback from the rest of the SWG.