Open etj opened 3 years ago
Constraint added unique_together = (("thesaurus", "lang"),)
for model ThesaurusLabel
Some RDF may report only localized titles:
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="it">Registro dei dati di interesse generale per il RNDT</dc:title>
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">Register of the reference data sets for RNDT</dc:title>
while other RDF may report only the generic title:
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">Conditions Applying To Access and Use</dc:title>
We want to deal with any combination of cases.
In the model, we have 2 fields for the Thesaurus title:
Thesaurus.title
: this is the default title. We may map on this field the value of the dc:title
with no xml:lang
attribute, if any.ThesaurusLabel.title
: this is a localized title: it's populated with each dc:title
which also declares xml:lang
.In the case we only have localized titles (the ones with xml:lang
), we shall take one of them to populate the default title. We'll have a new setting (e.g. THESAURUS_DEFAULT_LANG
) which tells us which language should be chosen. If the thesaurus title is not provided in such a language, we'll take the first localized title found.
E.g.:
Only localized defined, THESAURUS_DEFAULT_LANG=it
:
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="it">Registro dei dati di interesse generale per il RNDT</dc:title>
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">Register of the reference data sets for RNDT</dc:title>
will result in
e.g.2: All entries provided
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">General title</dc:title>
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="it">Italian title</dc:title>
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">English title</dc:title>
will result in
e.g.3: Only general title provided
In some rdf the field altLabel
is not available. For avoid loads errors we should implement the altLabel
in this way:
If the altlabel
exists we will take it, otherwise preflabel[DEFAULT_LANG]
or preflabel[0]
--> ThesaurusKeyword.altLabel
Thesaurus
table (update)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
(create)Contains localized version of the thesaurus title
lang = models.CharField(max_length=3)
label = models.CharField(max_length=255)