diff --git a/invenio_vocabularies/contrib/awards/datastreams.py b/invenio_vocabularies/contrib/awards/datastreams.py index 789d878f..cf66c488 100644 --- a/invenio_vocabularies/contrib/awards/datastreams.py +++ b/invenio_vocabularies/contrib/awards/datastreams.py @@ -122,7 +122,7 @@ def apply(self, stream_entry, **kwargs): if "endDate" in record: award["end_date"] = record["endDate"] if "summary" in record: - award["description"] = record["summary"] + award["description"] = {"en": record["summary"]} stream_entry.entry = award return stream_entry diff --git a/invenio_vocabularies/contrib/awards/jsonschemas/awards/award-v1.0.0.json b/invenio_vocabularies/contrib/awards/jsonschemas/awards/award-v1.0.0.json index 398148ee..15dc12e8 100644 --- a/invenio_vocabularies/contrib/awards/jsonschemas/awards/award-v1.0.0.json +++ b/invenio_vocabularies/contrib/awards/jsonschemas/awards/award-v1.0.0.json @@ -50,7 +50,7 @@ "type": "string" }, "description": { - "type": "string" + "$ref": "local://vocabularies/definitions-v1.0.0.json#/description" }, "subjects": { "description": "Award's subjects.", diff --git a/invenio_vocabularies/contrib/awards/mappings/os-v1/awards/award-v1.0.0.json b/invenio_vocabularies/contrib/awards/mappings/os-v1/awards/award-v1.0.0.json index 84b5e6e2..78d95dda 100644 --- a/invenio_vocabularies/contrib/awards/mappings/os-v1/awards/award-v1.0.0.json +++ b/invenio_vocabularies/contrib/awards/mappings/os-v1/awards/award-v1.0.0.json @@ -9,6 +9,15 @@ "type": "search_as_you_type" } } + }, + { + "i18n_description": { + "path_match": "description.*", + "match_mapping_type": "string", + "mapping": { + "type": "text" + } + } } ], "dynamic": "strict", @@ -70,7 +79,8 @@ "type": "date" }, "description": { - "type": "text" + "type": "object", + "dynamic": "true" }, "program": { "type": "keyword" diff --git a/invenio_vocabularies/contrib/awards/mappings/os-v2/awards/award-v1.0.0.json b/invenio_vocabularies/contrib/awards/mappings/os-v2/awards/award-v1.0.0.json index 84b5e6e2..78d95dda 100644 --- a/invenio_vocabularies/contrib/awards/mappings/os-v2/awards/award-v1.0.0.json +++ b/invenio_vocabularies/contrib/awards/mappings/os-v2/awards/award-v1.0.0.json @@ -9,6 +9,15 @@ "type": "search_as_you_type" } } + }, + { + "i18n_description": { + "path_match": "description.*", + "match_mapping_type": "string", + "mapping": { + "type": "text" + } + } } ], "dynamic": "strict", @@ -70,7 +79,8 @@ "type": "date" }, "description": { - "type": "text" + "type": "object", + "dynamic": "true" }, "program": { "type": "keyword" diff --git a/invenio_vocabularies/contrib/awards/mappings/v7/awards/award-v1.0.0.json b/invenio_vocabularies/contrib/awards/mappings/v7/awards/award-v1.0.0.json index 84b5e6e2..78d95dda 100644 --- a/invenio_vocabularies/contrib/awards/mappings/v7/awards/award-v1.0.0.json +++ b/invenio_vocabularies/contrib/awards/mappings/v7/awards/award-v1.0.0.json @@ -9,6 +9,15 @@ "type": "search_as_you_type" } } + }, + { + "i18n_description": { + "path_match": "description.*", + "match_mapping_type": "string", + "mapping": { + "type": "text" + } + } } ], "dynamic": "strict", @@ -70,7 +79,8 @@ "type": "date" }, "description": { - "type": "text" + "type": "object", + "dynamic": "true" }, "program": { "type": "keyword" diff --git a/invenio_vocabularies/contrib/awards/schema.py b/invenio_vocabularies/contrib/awards/schema.py index 29c807de..99a919d0 100644 --- a/invenio_vocabularies/contrib/awards/schema.py +++ b/invenio_vocabularies/contrib/awards/schema.py @@ -61,8 +61,6 @@ class AwardSchema(BaseVocabularySchema, ModePIDFieldVocabularyMixin): organizations = fields.List(fields.Nested(AwardOrganizationRelationSchema)) - description = SanitizedUnicode() - start_date = ISODateString() end_date = ISODateString() diff --git a/invenio_vocabularies/records/jsonschemas/vocabularies/definitions-v1.0.0.json b/invenio_vocabularies/records/jsonschemas/vocabularies/definitions-v1.0.0.json index 62a7362a..0fa5ff36 100644 --- a/invenio_vocabularies/records/jsonschemas/vocabularies/definitions-v1.0.0.json +++ b/invenio_vocabularies/records/jsonschemas/vocabularies/definitions-v1.0.0.json @@ -8,6 +8,15 @@ } } }, + "description": { + "type": "object", + "description": "Description of vocabulary item. Keys are locale codes.", + "patternProperties": { + "^[a-z]{2}$": { + "type": "string" + } + } + }, "icon": { "type": "string" },