-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
GNIP 82 - Thesauri improvements #6925
Comments
… on thesaurus avaiable, fix test on thesaurus load, add migration file for updated thesaurus schema
… key for each thesaurus
Just to be clear: If you mention 'will be moved to DB' you mean this will get its own model and therefore admin panel page, right? I like the concept of the GNIP backend and frontend-wise. |
…ew thesaurus information as template tags, add tests for new template tags
My +1 |
Some missing details about the GUI:
Please note that when retrieving the records for GUI display, the |
Thesauri editing in maps and documents should be added. |
Is the loading of an RDF thesaurus still valid? See https://docs.geonode.org/en/master/admin/thesaurus/#loading-a-thesaurus |
@gannebamm sure, we also made some improvements related to importing the items in various languages. |
@etj No, I will need those soonish and was just curious if the old way of loading thesauri still work. Nice job. |
* [Fixes: #7033] Mandatory fields in editor * [Fixes #6925] Add new thesaurus behaviour for documents and maps * [Fixes #6925] Facet endpoint changed to serve default label if translated one does not exists * [Fixes #6925] Facet endpoint changed to serve default label if translated one does not exists
WIP
GNIP 82 - Thesauri improvements
Overview
Thesauri implementation needs some revision, update and improvements.
Currently it's only possibile to have a single thesaurus in the GUI, while INSPIRE and other profiles require keywords from different thesauri.
We want to:
Proposed By
@etj (Emanuele Tajariol)
Assigned to Release
This proposal is for GeoNode ???
State
Motivation
Thesaurus code is stale and needs some revisions.
Currently it's only possibile to have a single thesaurus in the GUI, while INSPIRE and other profiles require keywords from different thesauri.
Furthermore, when compiling a 19115 metadata, recent INSPIRE specs (and related profiles) require both href and title of the cited thesaurus.
Proposal
Model
Thesaurus
table (to be updated)We need to support an href referencing the thesaurus; it's stored into the
rdf:about
field.about = models.CharField(max_length=255, null=True, blank=True)
We need to move into the DB the config currently kept in SETTINGS (see https://docs.geonode.org/en/master/admin/thesaurus/#configure-a-thesaurus-in-geonode).
This is an excerpt from the current doc:
name
will not be ported, since it's a FK to the Thesaurus identifier;required
will be enhanced, in order to better support cardinality info; we'll havecard_min
andcard_max
filter
is a too general concept, so we can transform it into a field namedfacet
We'll add:
card_min
integercard_max
integerfacet
booleanWarning: the change about moving the settings from the
SETTINGS
file into the DB is breaking backcompatibility, so we'll have to change the logic accordingly:ThesaurusLabel
table (new)Contains localized version of the thesaurus title
lang = models.CharField(max_length=3)
label = models.CharField(max_length=255)
We'll use the localized label in the GUI, and the general title (in the
Thesaurus
class) for the xml template.Commands
The command to load the thesaurus will be improved in order to support the thesaurus label localization.
In particular, we may have rdf files which only have localized titles, and a missing "general" title.
We need to handle all condition:
e.g.: only general title:
Thesaurus.title
--> "Continents, countries, sea regions of the world."ThesaurusLabel
--> no recordse.g.: only localized titles:
ThesaurusLabel
--> entries forit
anden
Thesaurus.title
--> We have to chose one.DEFAULT_THESAURUS_LANG
, so that the title with the selected language will be chosenDEFAULT_THESAURUS_LANG
, chose that one to fill theThesaurus.title
fielden
languageMetadata Editing GUI
Modify the editing GUI so that thesauri selection is rendered in the first tab.
We want to display all of the thesauri set as required in the GUI.
The requirement is set in the DB (
card_min
,card_max
), but we also have a legacy setting (https://docs.geonode.org/en/2.10/admin/thesaurus/index.html#configure-a-thesaurus-in-geonode)In the GUI we will have, according to the
card_max
andcard_min
values,card_max=0
--> Disabled, won't be shown in the GUI (card_min
is not even checked in this case)card_max=1
--> Single choicecard_min = 0
--> Single choice, optional --> rendered as a dropdown, with an empty/unselected elementcard_min = 1
--> Single choice, required --> rendered as a dropdowncard_max=-1
--> Multiple choicecard_min = 0
--> [0..N] Multiple choices, optional --> rendered as a typeahead badges(?)card_min = 1
--> [1..N] Multiple choices, required --> rendered as a typeahead badges(?) + apply check for the mandatory warningIf the legacy
required
boolean setting is in the configuration, we'll use it as if we'd found:required
=true
card_min = 1
card_max = -1
required
=false
card_min = 0
card_max = -1
As stated elewhere also, when a legacy settings is found, we'll use it and notify a warning about the deprecated setting.
The displayed thesaurus label should be the localized one, if any, otherwise the generic title will be used.
GUI should be restructed as follows:
Also, the validation checks should act according to the mandatory requirements of the displayed thesauri.
Metadata template
The XML metadata template has to be modified in order to include all of the thesauri keywords added to the layer metadata.
The thesaurus title to be put into the template is the generic (non localized)
Thesaurus.title
.Settings changes
THESAURUS
entry ( https://docs.geonode.org/en/master/admin/thesaurus/#configure-a-thesaurus-in-geonode).DEFAULT_THESAURUS_LANG
for Thesaurus title, default 'en'.Backwards Compatibility
Thesaurus configuration is currently made in the
settings
file (asTHESAURUS
entry), and this is going to be moved to DB.As noted in the proposal, if file configuration is present, it will be used instead of the DB data for a given thesaurus, but a warning log will be notified about the deprecation of the file setting.
Future evolution
Feedback
Update this section with relevant feedbacks, if any.
Voting
Project Steering Committee:
Links
Remove unused links below.
The text was updated successfully, but these errors were encountered: