Skip to content

Commit

Permalink
global: add "tags" field to all vocabularies
Browse files Browse the repository at this point in the history
  • Loading branch information
slint authored and ptamarit committed Jun 10, 2024
1 parent 18c4cec commit 94d9453
Show file tree
Hide file tree
Showing 24 changed files with 75 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
"$schema": {
"$ref": "local://definitions-v1.0.0.json#/$schema"
},
"tags": {
"$ref": "local://vocabularies/definitions-v1.0.0.json#/tags"
},
"acronym": {
"type": "string"
},
"identifiers": {
"description": "Alternate identifiers for the record.",
"type": "array",
"items": {"$ref": "local://definitions-v1.0.0.json#/identifiers_with_scheme"},
"items": {
"$ref": "local://definitions-v1.0.0.json#/identifiers_with_scheme"
},
"uniqueItems": true
},
"name": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
"title": {
"type": "object",
"dynamic": "true"
},
"tags": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
"title": {
"type": "object",
"dynamic": "true"
},
"tags": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
"title": {
"type": "object",
"dynamic": "true"
},
"tags": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"$schema": {
"$ref": "local://definitions-v1.0.0.json#/$schema"
},
"tags": {
"$ref": "local://vocabularies/definitions-v1.0.0.json#/tags"
},
"identifiers": {
"description": "Alternate identifiers for the award.",
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"type": "object",
"dynamic": "true"
},
"tags": {
"type": "keyword"
},
"number": {
"type": "keyword"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"type": "object",
"dynamic": "true"
},
"tags": {
"type": "keyword"
},
"number": {
"type": "keyword"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"type": "object",
"dynamic": "true"
},
"tags": {
"type": "keyword"
},
"number": {
"type": "keyword"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"$schema": {
"$ref": "local://definitions-v1.0.0.json#/$schema"
},
"tags": {
"$ref": "local://vocabularies/definitions-v1.0.0.json#/tags"
},
"country": {
"type": "string",
"description": "Represents a funder's origin country as a country code."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
"title": {
"type": "object",
"dynamic": "true"
},
"tags": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
"title": {
"type": "object",
"dynamic": "true"
},
"tags": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
"title": {
"type": "object",
"dynamic": "true"
},
"tags": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"$schema": {
"$ref": "local://definitions-v1.0.0.json#/$schema"
},
"tags": {
"$ref": "local://vocabularies/definitions-v1.0.0.json#/tags"
},
"scheme": {
"description": "Identifier of the name scheme.",
"$ref": "local://definitions-v1.0.0.json#/identifier"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"id": {
"type": "keyword"
},
"tags": {
"type": "keyword"
},
"name_sort": {
"type": "keyword"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"id": {
"type": "keyword"
},
"tags": {
"type": "keyword"
},
"name_sort": {
"type": "keyword"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"id": {
"type": "keyword"
},
"tags": {
"type": "keyword"
},
"name_sort": {
"type": "keyword"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"$schema": {
"$ref": "local://definitions-v1.0.0.json#/$schema"
},
"tags": {
"$ref": "local://vocabularies/definitions-v1.0.0.json#/tags"
},
"id": {
"description": "URI or classification code as identifier - globally unique among all subject schemes.",
"$ref": "local://definitions-v1.0.0.json#/identifier"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"type": "keyword"
}
}
},
"tags": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"type": "keyword"
}
}
},
"tags": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"type": "keyword"
}
}
},
"tags": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@
},
"icon": {
"type": "string"
},
"tags": {
"type": "array",
"description": "Tags for a vocabulary item.",
"items": {
"type": "string"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
}
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
"$ref": "local://vocabularies/definitions-v1.0.0.json#/tags"
},
"title": {
"$ref": "local://vocabularies/definitions-v1.0.0.json#/title"
Expand Down
2 changes: 1 addition & 1 deletion invenio_vocabularies/services/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ class BaseVocabularySchema(BaseRecordSchema):
title = i18n_strings
description = i18n_strings
icon = fields.Str(allow_none=False)
tags = fields.List(SanitizedUnicode())


class VocabularySchema(BaseVocabularySchema):
"""Service schema for vocabulary records."""

props = fields.Dict(allow_none=False, keys=fields.Str(), values=fields.Str())
tags = fields.List(SanitizedUnicode())
type = fields.Str(attribute="type.id", required=True)


Expand Down
3 changes: 3 additions & 0 deletions tests/mock_module/jsonschemas/records/record-v1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"description": "JSONSchema declaration.",
"type": "string"
},
"tags": {
"$ref": "local://vocabularies/definitions-v1.0.0.json#/tags"
},
"id": {
"description": "Persistent record identifier (alphanumeric).",
"type": "string"
Expand Down

0 comments on commit 94d9453

Please sign in to comment.