-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blog post describes a mechanism to add keyword from thesaurus as queryable #14
blog post describes a mechanism to add keyword from thesaurus as queryable #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very useful post @pvgenuchten ! See minor change requests.
|
||
## Populate the parameter from record imports | ||
|
||
We have 2 options here, either manage the population of the column within the database as part of an insert trigger on the `record.themes` field. Alternatively update `pcsw/core/metadata.py` so the column is populated when records are imported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcsw/core/metadata.py
-> pycsw/core/metadata.py
@@ -0,0 +1,77 @@ | |||
--- | |||
layout: post | |||
title: Keywords from thesaurus as Queryable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Using keywords from a thesaurus as queryables
publish_date: 2024-09-18 14:59:00-0400 | ||
--- | ||
|
||
## Keywords from thesaurus as Queryable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using keywords from a thesaurus as queryables
|
||
A common convention in catalogues is the use of keywords from a dedicated thesaurus. The assignment of these keywords can then later be used to filter or query the catalogue by these terms. To achieve this use case in pycsw, some configuration needs to be tailored. This blog post indicates the changes needed for this scenario. | ||
|
||
For this example we'll use a keyword from the [INSPIRE Themes](http://inspire.ec.europa.eu/theme) thesaurus. We will define a new queryable `inspiretheme`, which will be populated with the relevant keyword (if present). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
Which of the parameters are queryable is defined in `pycsw/core/repository.py`. | ||
|
||
'inspiretheme': self.dataset.inspiretheme, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap in a python
code block/fence:
'inspiretheme': self.dataset.inspiretheme,
|
||
## Add parameter to record results? | ||
|
||
Keywords are already published in records, so there is generally no need to extend the record with the new parameter. If needed you can do so in `pycsw/ogc/api/records.py#Line=1150`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If needed you can do so in pycsw/ogc/api/records.py#Line=1150
. -> If needed you can do so in pycsw/ogc/api/records.py
(line 1150).
t.thesaurus['uri'] == 'http://inspire.ec.europa.eu/theme')))])) | ||
``` | ||
|
||
## Add parameter to OGCAPI - Records facets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add parameter to OGCAPI - Records facets -> Add parameter to OGC API - Records facets
|
||
## Add parameter to OGCAPI - Records facets | ||
|
||
Facets enable to further limit search results. Keywords from thesauri are very usefull to add as facet. Add the paremeter to `default.yml`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usefull -> useful
Thanks @pvgenuchten ! Now published to https://pycsw.org/2024/08/18/keyword-from-thesaurus.html |
No description provided.