invenio-vocabularies 2.3.1__py2.py3-none-any.whl → 6.3.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of invenio-vocabularies might be problematic. Click here for more details.

Files changed (165) hide show
  1. invenio_vocabularies/__init__.py +2 -2
  2. invenio_vocabularies/administration/__init__.py +10 -0
  3. invenio_vocabularies/administration/views/__init__.py +10 -0
  4. invenio_vocabularies/administration/views/vocabularies.py +45 -0
  5. invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/package.json +1 -7
  6. invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/CustomAwardForm.js +80 -64
  7. invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingField.js +49 -41
  8. invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/FundingModal.js +5 -7
  9. invenio_vocabularies/assets/semantic-ui/js/invenio_vocabularies/src/contrib/forms/Funding/NoAwardResults.js +3 -3
  10. invenio_vocabularies/cli.py +31 -44
  11. invenio_vocabularies/config.py +68 -4
  12. invenio_vocabularies/contrib/affiliations/affiliations.py +11 -0
  13. invenio_vocabularies/contrib/affiliations/api.py +1 -2
  14. invenio_vocabularies/contrib/affiliations/config.py +13 -2
  15. invenio_vocabularies/contrib/affiliations/datastreams.py +186 -0
  16. invenio_vocabularies/contrib/affiliations/jsonschemas/affiliations/affiliation-v1.0.0.json +38 -1
  17. invenio_vocabularies/contrib/affiliations/mappings/os-v1/affiliations/affiliation-v1.0.0.json +22 -1
  18. invenio_vocabularies/contrib/affiliations/mappings/os-v1/affiliations/affiliation-v2.0.0.json +171 -0
  19. invenio_vocabularies/contrib/affiliations/mappings/os-v2/affiliations/affiliation-v1.0.0.json +22 -1
  20. invenio_vocabularies/contrib/affiliations/mappings/os-v2/affiliations/affiliation-v2.0.0.json +171 -0
  21. invenio_vocabularies/contrib/affiliations/mappings/v7/affiliations/affiliation-v1.0.0.json +22 -1
  22. invenio_vocabularies/contrib/affiliations/schema.py +17 -3
  23. invenio_vocabularies/contrib/affiliations/services.py +1 -2
  24. invenio_vocabularies/contrib/awards/awards.py +17 -5
  25. invenio_vocabularies/contrib/awards/datastreams.py +241 -7
  26. invenio_vocabularies/contrib/awards/jsonschemas/awards/award-v1.0.0.json +38 -0
  27. invenio_vocabularies/contrib/awards/mappings/os-v1/awards/award-v1.0.0.json +51 -2
  28. invenio_vocabularies/contrib/awards/mappings/os-v2/awards/award-v1.0.0.json +51 -2
  29. invenio_vocabularies/contrib/awards/mappings/v7/awards/award-v1.0.0.json +51 -2
  30. invenio_vocabularies/contrib/awards/schema.py +16 -1
  31. invenio_vocabularies/contrib/awards/serializer.py +8 -1
  32. invenio_vocabularies/contrib/awards/services.py +1 -2
  33. invenio_vocabularies/contrib/common/__init__.py +9 -0
  34. invenio_vocabularies/contrib/common/openaire/__init__.py +9 -0
  35. invenio_vocabularies/contrib/common/openaire/datastreams.py +84 -0
  36. invenio_vocabularies/contrib/common/ror/__init__.py +9 -0
  37. invenio_vocabularies/contrib/common/ror/datastreams.py +220 -0
  38. invenio_vocabularies/contrib/funders/config.py +11 -2
  39. invenio_vocabularies/contrib/funders/datastreams.py +40 -62
  40. invenio_vocabularies/contrib/funders/funders.py +3 -1
  41. invenio_vocabularies/contrib/funders/jsonschemas/funders/funder-v1.0.0.json +36 -1
  42. invenio_vocabularies/contrib/funders/mappings/os-v1/funders/funder-v1.0.0.json +22 -1
  43. invenio_vocabularies/contrib/funders/mappings/os-v1/funders/funder-v2.0.0.json +156 -0
  44. invenio_vocabularies/contrib/funders/mappings/os-v2/funders/funder-v1.0.0.json +22 -1
  45. invenio_vocabularies/contrib/funders/mappings/os-v2/funders/funder-v2.0.0.json +156 -0
  46. invenio_vocabularies/contrib/funders/mappings/v7/funders/funder-v1.0.0.json +22 -1
  47. invenio_vocabularies/contrib/funders/schema.py +8 -0
  48. invenio_vocabularies/contrib/funders/serializer.py +2 -1
  49. invenio_vocabularies/contrib/names/config.py +5 -3
  50. invenio_vocabularies/contrib/names/datastreams.py +172 -4
  51. invenio_vocabularies/contrib/names/jsonschemas/names/name-v1.0.0.json +3 -0
  52. invenio_vocabularies/contrib/names/mappings/os-v1/names/name-v1.0.0.json +3 -0
  53. invenio_vocabularies/contrib/names/mappings/os-v1/names/name-v2.0.0.json +150 -0
  54. invenio_vocabularies/contrib/names/mappings/os-v2/names/name-v1.0.0.json +3 -0
  55. invenio_vocabularies/contrib/names/mappings/os-v2/names/name-v2.0.0.json +150 -0
  56. invenio_vocabularies/contrib/names/mappings/v7/names/name-v1.0.0.json +3 -0
  57. invenio_vocabularies/contrib/names/names.py +15 -3
  58. invenio_vocabularies/contrib/names/permissions.py +20 -0
  59. invenio_vocabularies/contrib/names/s3client.py +44 -0
  60. invenio_vocabularies/contrib/names/schema.py +14 -0
  61. invenio_vocabularies/contrib/subjects/config.py +9 -3
  62. invenio_vocabularies/contrib/subjects/datastreams.py +61 -0
  63. invenio_vocabularies/contrib/subjects/euroscivoc/__init__.py +9 -0
  64. invenio_vocabularies/contrib/subjects/euroscivoc/datastreams.py +171 -0
  65. invenio_vocabularies/contrib/subjects/jsonschemas/subjects/subject-v1.0.0.json +31 -0
  66. invenio_vocabularies/contrib/subjects/mappings/os-v1/subjects/subject-v1.0.0.json +35 -0
  67. invenio_vocabularies/contrib/subjects/mappings/os-v2/subjects/subject-v1.0.0.json +35 -0
  68. invenio_vocabularies/contrib/subjects/mappings/v7/subjects/subject-v1.0.0.json +35 -0
  69. invenio_vocabularies/contrib/subjects/mesh/__init__.py +9 -0
  70. invenio_vocabularies/contrib/subjects/mesh/datastreams.py +43 -0
  71. invenio_vocabularies/contrib/subjects/schema.py +47 -5
  72. invenio_vocabularies/contrib/subjects/subjects.py +10 -0
  73. invenio_vocabularies/datastreams/datastreams.py +61 -13
  74. invenio_vocabularies/datastreams/factories.py +1 -2
  75. invenio_vocabularies/datastreams/readers.py +138 -29
  76. invenio_vocabularies/datastreams/tasks.py +37 -0
  77. invenio_vocabularies/datastreams/transformers.py +17 -27
  78. invenio_vocabularies/datastreams/writers.py +116 -14
  79. invenio_vocabularies/datastreams/xml.py +34 -0
  80. invenio_vocabularies/ext.py +59 -5
  81. invenio_vocabularies/factories.py +137 -0
  82. invenio_vocabularies/jobs.py +133 -0
  83. invenio_vocabularies/proxies.py +2 -2
  84. invenio_vocabularies/records/jsonschemas/vocabularies/definitions-v1.0.0.json +7 -0
  85. invenio_vocabularies/records/jsonschemas/vocabularies/vocabulary-v1.0.0.json +1 -4
  86. invenio_vocabularies/records/mappings/os-v1/vocabularies/vocabulary-v1.0.0.json +3 -3
  87. invenio_vocabularies/records/mappings/os-v2/vocabularies/vocabulary-v1.0.0.json +3 -3
  88. invenio_vocabularies/records/mappings/v7/vocabularies/vocabulary-v1.0.0.json +3 -3
  89. invenio_vocabularies/records/models.py +2 -4
  90. invenio_vocabularies/records/pidprovider.py +1 -2
  91. invenio_vocabularies/records/systemfields/relations.py +2 -2
  92. invenio_vocabularies/resources/__init__.py +9 -1
  93. invenio_vocabularies/resources/config.py +105 -0
  94. invenio_vocabularies/resources/resource.py +31 -41
  95. invenio_vocabularies/resources/schema.py +2 -1
  96. invenio_vocabularies/services/__init__.py +5 -2
  97. invenio_vocabularies/services/config.py +179 -0
  98. invenio_vocabularies/services/custom_fields/__init__.py +6 -2
  99. invenio_vocabularies/services/custom_fields/subject.py +82 -0
  100. invenio_vocabularies/services/custom_fields/vocabulary.py +5 -3
  101. invenio_vocabularies/services/permissions.py +3 -1
  102. invenio_vocabularies/services/results.py +110 -0
  103. invenio_vocabularies/services/schema.py +11 -2
  104. invenio_vocabularies/services/service.py +46 -94
  105. invenio_vocabularies/services/tasks.py +1 -1
  106. invenio_vocabularies/templates/semantic-ui/invenio_vocabularies/subjects.html +23 -0
  107. invenio_vocabularies/templates/semantic-ui/invenio_vocabularies/vocabularies-list.html +12 -0
  108. invenio_vocabularies/templates/semantic-ui/invenio_vocabularies/vocabulary-details.html +71 -0
  109. invenio_vocabularies/translations/af/LC_MESSAGES/messages.mo +0 -0
  110. invenio_vocabularies/translations/ar/LC_MESSAGES/messages.mo +0 -0
  111. invenio_vocabularies/translations/bg/LC_MESSAGES/messages.mo +0 -0
  112. invenio_vocabularies/translations/ca/LC_MESSAGES/messages.mo +0 -0
  113. invenio_vocabularies/translations/cs/LC_MESSAGES/messages.mo +0 -0
  114. invenio_vocabularies/translations/da/LC_MESSAGES/messages.mo +0 -0
  115. invenio_vocabularies/translations/de/LC_MESSAGES/messages.mo +0 -0
  116. invenio_vocabularies/translations/de_AT/LC_MESSAGES/messages.mo +0 -0
  117. invenio_vocabularies/translations/de_DE/LC_MESSAGES/messages.mo +0 -0
  118. invenio_vocabularies/translations/el/LC_MESSAGES/messages.mo +0 -0
  119. invenio_vocabularies/translations/en/LC_MESSAGES/messages.mo +0 -0
  120. invenio_vocabularies/translations/en_AT/LC_MESSAGES/messages.mo +0 -0
  121. invenio_vocabularies/translations/en_HU/LC_MESSAGES/messages.mo +0 -0
  122. invenio_vocabularies/translations/es/LC_MESSAGES/messages.mo +0 -0
  123. invenio_vocabularies/translations/es_CU/LC_MESSAGES/messages.mo +0 -0
  124. invenio_vocabularies/translations/es_MX/LC_MESSAGES/messages.mo +0 -0
  125. invenio_vocabularies/translations/et/LC_MESSAGES/messages.mo +0 -0
  126. invenio_vocabularies/translations/et_EE/LC_MESSAGES/messages.mo +0 -0
  127. invenio_vocabularies/translations/fa/LC_MESSAGES/messages.mo +0 -0
  128. invenio_vocabularies/translations/fa_IR/LC_MESSAGES/messages.mo +0 -0
  129. invenio_vocabularies/translations/fr/LC_MESSAGES/messages.mo +0 -0
  130. invenio_vocabularies/translations/fr_CI/LC_MESSAGES/messages.mo +0 -0
  131. invenio_vocabularies/translations/fr_FR/LC_MESSAGES/messages.mo +0 -0
  132. invenio_vocabularies/translations/gl/LC_MESSAGES/messages.mo +0 -0
  133. invenio_vocabularies/translations/hi_IN/LC_MESSAGES/messages.mo +0 -0
  134. invenio_vocabularies/translations/hr/LC_MESSAGES/messages.mo +0 -0
  135. invenio_vocabularies/translations/hu/LC_MESSAGES/messages.mo +0 -0
  136. invenio_vocabularies/translations/hu_HU/LC_MESSAGES/messages.mo +0 -0
  137. invenio_vocabularies/translations/it/LC_MESSAGES/messages.mo +0 -0
  138. invenio_vocabularies/translations/ja/LC_MESSAGES/messages.mo +0 -0
  139. invenio_vocabularies/translations/ka/LC_MESSAGES/messages.mo +0 -0
  140. invenio_vocabularies/translations/lt/LC_MESSAGES/messages.mo +0 -0
  141. invenio_vocabularies/translations/messages.pot +95 -48
  142. invenio_vocabularies/translations/ne/LC_MESSAGES/messages.mo +0 -0
  143. invenio_vocabularies/translations/no/LC_MESSAGES/messages.mo +0 -0
  144. invenio_vocabularies/translations/pl/LC_MESSAGES/messages.mo +0 -0
  145. invenio_vocabularies/translations/pt/LC_MESSAGES/messages.mo +0 -0
  146. invenio_vocabularies/translations/ro/LC_MESSAGES/messages.mo +0 -0
  147. invenio_vocabularies/translations/ru/LC_MESSAGES/messages.mo +0 -0
  148. invenio_vocabularies/translations/rw/LC_MESSAGES/messages.mo +0 -0
  149. invenio_vocabularies/translations/sk/LC_MESSAGES/messages.mo +0 -0
  150. invenio_vocabularies/translations/sv/LC_MESSAGES/messages.mo +0 -0
  151. invenio_vocabularies/translations/sv_SE/LC_MESSAGES/messages.mo +0 -0
  152. invenio_vocabularies/translations/tr/LC_MESSAGES/messages.mo +0 -0
  153. invenio_vocabularies/translations/uk/LC_MESSAGES/messages.mo +0 -0
  154. invenio_vocabularies/translations/uk_UA/LC_MESSAGES/messages.mo +0 -0
  155. invenio_vocabularies/translations/zh_CN/LC_MESSAGES/messages.mo +0 -0
  156. invenio_vocabularies/translations/zh_TW/LC_MESSAGES/messages.mo +0 -0
  157. invenio_vocabularies/views.py +12 -26
  158. invenio_vocabularies/webpack.py +3 -3
  159. {invenio_vocabularies-2.3.1.dist-info → invenio_vocabularies-6.3.1.dist-info}/METADATA +150 -6
  160. {invenio_vocabularies-2.3.1.dist-info → invenio_vocabularies-6.3.1.dist-info}/RECORD +165 -132
  161. {invenio_vocabularies-2.3.1.dist-info → invenio_vocabularies-6.3.1.dist-info}/WHEEL +1 -1
  162. {invenio_vocabularies-2.3.1.dist-info → invenio_vocabularies-6.3.1.dist-info}/entry_points.txt +17 -0
  163. {invenio_vocabularies-2.3.1.dist-info → invenio_vocabularies-6.3.1.dist-info}/AUTHORS.rst +0 -0
  164. {invenio_vocabularies-2.3.1.dist-info → invenio_vocabularies-6.3.1.dist-info}/LICENSE +0 -0
  165. {invenio_vocabularies-2.3.1.dist-info → invenio_vocabularies-6.3.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2022 CERN.
3
+ # Copyright (C) 2022-2024 CERN.
4
+ # Copyright (C) 2024 California Institute of Technology.
4
5
  #
5
6
  # Invenio-Vocabularies is free software; you can redistribute it and/or
6
7
  # modify it under the terms of the MIT License; see LICENSE file for more
@@ -8,14 +9,11 @@
8
9
 
9
10
  """Funders datastreams, transformers, writers and readers."""
10
11
 
11
- from idutils import normalize_ror
12
- from invenio_access.permissions import system_identity
12
+ from flask import current_app
13
13
  from invenio_i18n import lazy_gettext as _
14
14
 
15
- from ...datastreams.errors import TransformerError
16
- from ...datastreams.transformers import BaseTransformer
17
15
  from ...datastreams.writers import ServiceWriter
18
- from .config import funder_fundref_doi_prefix, funder_schemes
16
+ from ..common.ror.datastreams import RORTransformer
19
17
 
20
18
 
21
19
  class FundersServiceWriter(ServiceWriter):
@@ -31,64 +29,40 @@ class FundersServiceWriter(ServiceWriter):
31
29
  return entry["id"]
32
30
 
33
31
 
34
- class RORTransformer(BaseTransformer):
35
- """Transforms a JSON ROR record into a funders record."""
36
-
37
- def apply(self, stream_entry, **kwargs):
38
- """Applies the transformation to the stream entry."""
39
- record = stream_entry.entry
40
- funder = {}
41
-
42
- funder["id"] = normalize_ror(record.get("id"))
43
- if not funder["id"]:
44
- raise TransformerError(_("Id not found in ROR entry."))
45
-
46
- funder["name"] = record.get("name")
47
- if not funder["name"]:
48
- raise TransformerError(_("Name not found in ROR entry."))
49
-
50
- country_code = record.get("country", {}).get("country_code")
51
- if country_code:
52
- funder["country"] = country_code
53
-
54
- funder["title"] = {"en": funder["name"]}
55
- for label in record.get("labels", []):
56
- funder["title"][label["iso639"]] = label["label"]
57
-
58
- # The ROR is always listed in identifiers, expected by serialization
59
- funder["identifiers"] = [{"identifier": funder["id"], "scheme": "ror"}]
60
- valid_schemes = set(funder_schemes.keys())
61
- fund_ref = "fundref"
62
- valid_schemes.add(fund_ref)
63
- for scheme, identifier in record.get("external_ids", {}).items():
64
- scheme = scheme.lower()
65
- if scheme in valid_schemes:
66
- value = identifier.get("preferred") or identifier.get("all")[0]
67
- if scheme == fund_ref:
68
- value = f"{funder_fundref_doi_prefix}/{value}"
69
- scheme = "doi"
70
-
71
- funder["identifiers"].append(
72
- {
73
- "identifier": value,
74
- "scheme": scheme,
75
- }
76
- )
77
-
78
- stream_entry.entry = funder
79
- return stream_entry
32
+ class FundersRORTransformer(RORTransformer):
33
+ """Funders ROR Transformer."""
80
34
 
35
+ def __init__(
36
+ self, *args, vocab_schemes=None, funder_fundref_doi_prefix=None, **kwargs
37
+ ):
38
+ """Constructor."""
39
+ if vocab_schemes is None:
40
+ vocab_schemes = current_app.config.get("VOCABULARIES_FUNDER_SCHEMES")
41
+ if funder_fundref_doi_prefix is None:
42
+ funder_fundref_doi_prefix = current_app.config.get(
43
+ "VOCABULARIES_FUNDER_DOI_PREFIX"
44
+ )
45
+ super().__init__(
46
+ *args,
47
+ vocab_schemes=vocab_schemes,
48
+ funder_fundref_doi_prefix=funder_fundref_doi_prefix,
49
+ **kwargs,
50
+ )
51
+
52
+
53
+ VOCABULARIES_DATASTREAM_READERS = {}
54
+ """Funders datastreams writers."""
81
55
 
82
- VOCABULARIES_DATASTREAM_TRANSFORMERS = {
83
- "ror-funder": RORTransformer,
56
+ VOCABULARIES_DATASTREAM_WRITERS = {
57
+ "funders-service": FundersServiceWriter,
84
58
  }
85
- """ROR Data Streams transformers."""
59
+ """Funders datastreams writers."""
86
60
 
87
61
 
88
- VOCABULARIES_DATASTREAM_WRITERS = {
89
- "funders-service": FundersServiceWriter,
62
+ VOCABULARIES_DATASTREAM_TRANSFORMERS = {
63
+ "ror-funders": FundersRORTransformer,
90
64
  }
91
- """Funders Data Streams transformers."""
65
+ """Funders datastreams transformers."""
92
66
 
93
67
 
94
68
  DATASTREAM_CONFIG = {
@@ -96,19 +70,23 @@ DATASTREAM_CONFIG = {
96
70
  {
97
71
  "type": "zip",
98
72
  "args": {
99
- "regex": ".json$",
73
+ "regex": "_schema_v2\\.json$",
100
74
  },
101
75
  },
102
76
  {"type": "json"},
103
77
  ],
104
78
  "transformers": [
105
- {"type": "ror-funder"},
79
+ {
80
+ "type": "ror-funders",
81
+ },
106
82
  ],
107
83
  "writers": [
108
84
  {
109
- "type": "funders-service",
85
+ "type": "async",
110
86
  "args": {
111
- "identity": system_identity,
87
+ "writer": {
88
+ "type": "funders-service",
89
+ }
112
90
  },
113
91
  }
114
92
  ],
@@ -1,12 +1,13 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2022 CERN.
3
+ # Copyright (C) 2022-2024 CERN.
4
4
  #
5
5
  # Invenio-Vocabularies is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the MIT License; see LICENSE file for more
7
7
  # details.
8
8
 
9
9
  """Vocabulary funders."""
10
+
10
11
  from flask_resources import (
11
12
  BaseListSchema,
12
13
  JSONSerializer,
@@ -45,6 +46,7 @@ record_type = RecordTypeFactory(
45
46
  ),
46
47
  schema_version="1.0.0",
47
48
  schema_path="local://funders/funder-v1.0.0.json",
49
+ index_name="funders-funder-v2.0.0",
48
50
  # Service layer
49
51
  service_id="funders",
50
52
  service_schema=FunderSchema,
@@ -7,9 +7,20 @@
7
7
  "$schema": {
8
8
  "$ref": "local://definitions-v1.0.0.json#/$schema"
9
9
  },
10
+ "tags": {
11
+ "$ref": "local://vocabularies/definitions-v1.0.0.json#/tags"
12
+ },
10
13
  "country": {
11
14
  "type": "string",
12
- "description": "Represents a funder's origin country."
15
+ "description": "Represents a funder's origin country as a country code."
16
+ },
17
+ "country_name": {
18
+ "type": "string",
19
+ "description": "Represents a funder's origin country as a full name."
20
+ },
21
+ "location_name": {
22
+ "type": "string",
23
+ "description": "Represents a funder's location name (usually a city)."
13
24
  },
14
25
  "identifiers": {
15
26
  "description": "Alternate identifiers for the record.",
@@ -23,6 +34,30 @@
23
34
  "type": "string",
24
35
  "description": "Funders name."
25
36
  },
37
+ "acronym": {
38
+ "type": "string",
39
+ "description": "Acronym for funders name."
40
+ },
41
+ "status": {
42
+ "type": "string",
43
+ "description": "Status of the funder."
44
+ },
45
+ "aliases": {
46
+ "description": "Alternate names for the funder.",
47
+ "type": "array",
48
+ "items": {
49
+ "type": "string"
50
+ },
51
+ "uniqueItems": true
52
+ },
53
+ "types": {
54
+ "description": "Types of funders.",
55
+ "type": "array",
56
+ "items": {
57
+ "type": "string"
58
+ },
59
+ "uniqueItems": true
60
+ },
26
61
  "title": {
27
62
  "$ref": "local://vocabularies/definitions-v1.0.0.json#/title"
28
63
  }
@@ -57,12 +57,33 @@
57
57
  "country": {
58
58
  "type": "text"
59
59
  },
60
+ "country_name": {
61
+ "type": "text"
62
+ },
63
+ "location_name": {
64
+ "type": "text"
65
+ },
66
+ "acronym": {
67
+ "type": "text"
68
+ },
69
+ "status": {
70
+ "type": "keyword"
71
+ },
72
+ "aliases": {
73
+ "type": "text"
74
+ },
75
+ "types": {
76
+ "type": "keyword"
77
+ },
60
78
  "id": {
61
79
  "type": "keyword"
62
80
  },
63
81
  "title": {
64
82
  "type": "object",
65
- "dynamic": true
83
+ "dynamic": "true"
84
+ },
85
+ "tags": {
86
+ "type": "keyword"
66
87
  }
67
88
  }
68
89
  }
@@ -0,0 +1,156 @@
1
+ {
2
+ "settings": {
3
+ "analysis": {
4
+ "char_filter": {
5
+ "strip_special_chars": {
6
+ "type": "pattern_replace",
7
+ "pattern": "[\\p{Punct}\\p{S}]",
8
+ "replacement": ""
9
+ }
10
+ },
11
+ "analyzer": {
12
+ "accent_edge_analyzer": {
13
+ "tokenizer": "standard",
14
+ "type": "custom",
15
+ "char_filter": ["strip_special_chars"],
16
+ "filter": [
17
+ "lowercase",
18
+ "asciifolding",
19
+ "edgegrams"
20
+ ]
21
+ },
22
+ "accent_analyzer": {
23
+ "tokenizer": "standard",
24
+ "type": "custom",
25
+ "char_filter": ["strip_special_chars"],
26
+ "filter": [
27
+ "lowercase",
28
+ "asciifolding"
29
+ ]
30
+ }
31
+ },
32
+ "normalizer": {
33
+ "accent_normalizer": {
34
+ "type": "custom",
35
+ "char_filter": ["strip_special_chars"],
36
+ "filter": [
37
+ "lowercase",
38
+ "asciifolding"
39
+ ]
40
+ }
41
+ },
42
+ "filter": {
43
+ "lowercase": {
44
+ "type": "lowercase",
45
+ "preserve_original": true
46
+ },
47
+ "asciifolding": {
48
+ "type": "asciifolding",
49
+ "preserve_original": true
50
+ },
51
+ "edgegrams": {
52
+ "type": "edge_ngram",
53
+ "min_gram": 2,
54
+ "max_gram": 20
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "mappings": {
60
+ "dynamic_templates": [
61
+ {
62
+ "i18n_title": {
63
+ "path_match": "title.*",
64
+ "match_mapping_type": "string",
65
+ "mapping": {
66
+ "type": "text",
67
+ "analyzer": "accent_edge_analyzer",
68
+ "search_analyzer": "accent_analyzer"
69
+ }
70
+ }
71
+ }
72
+ ],
73
+ "dynamic": "strict",
74
+ "properties": {
75
+ "$schema": {
76
+ "type": "keyword",
77
+ "index": "false"
78
+ },
79
+ "created": {
80
+ "type": "date"
81
+ },
82
+ "updated": {
83
+ "type": "date"
84
+ },
85
+ "indexed_at": {
86
+ "type": "date"
87
+ },
88
+ "uuid": {
89
+ "type": "keyword"
90
+ },
91
+ "version_id": {
92
+ "type": "integer"
93
+ },
94
+ "identifiers": {
95
+ "properties": {
96
+ "identifier": {
97
+ "type": "keyword"
98
+ },
99
+ "scheme": {
100
+ "type": "keyword"
101
+ }
102
+ }
103
+ },
104
+ "name_sort": {
105
+ "type": "keyword"
106
+ },
107
+ "name": {
108
+ "type": "text",
109
+ "analyzer": "accent_edge_analyzer",
110
+ "search_analyzer": "accent_analyzer",
111
+ "copy_to": "name_sort"
112
+ },
113
+ "country": {
114
+ "type": "text"
115
+ },
116
+ "country_name": {
117
+ "type": "text"
118
+ },
119
+ "location_name": {
120
+ "type": "text"
121
+ },
122
+ "acronym": {
123
+ "type": "text",
124
+ "analyzer": "accent_edge_analyzer",
125
+ "search_analyzer": "accent_analyzer",
126
+ "fields": {
127
+ "keyword": {
128
+ "type": "keyword",
129
+ "normalizer": "accent_normalizer"
130
+ }
131
+ }
132
+ },
133
+ "status": {
134
+ "type": "keyword"
135
+ },
136
+ "aliases": {
137
+ "type": "text",
138
+ "analyzer": "accent_edge_analyzer",
139
+ "search_analyzer": "accent_analyzer"
140
+ },
141
+ "types": {
142
+ "type": "keyword"
143
+ },
144
+ "id": {
145
+ "type": "keyword"
146
+ },
147
+ "title": {
148
+ "type": "object",
149
+ "dynamic": "true"
150
+ },
151
+ "tags": {
152
+ "type": "keyword"
153
+ }
154
+ }
155
+ }
156
+ }
@@ -57,12 +57,33 @@
57
57
  "country": {
58
58
  "type": "text"
59
59
  },
60
+ "country_name": {
61
+ "type": "text"
62
+ },
63
+ "location_name": {
64
+ "type": "text"
65
+ },
66
+ "acronym": {
67
+ "type": "text"
68
+ },
69
+ "status": {
70
+ "type": "keyword"
71
+ },
72
+ "aliases": {
73
+ "type": "text"
74
+ },
75
+ "types": {
76
+ "type": "keyword"
77
+ },
60
78
  "id": {
61
79
  "type": "keyword"
62
80
  },
63
81
  "title": {
64
82
  "type": "object",
65
- "dynamic": true
83
+ "dynamic": "true"
84
+ },
85
+ "tags": {
86
+ "type": "keyword"
66
87
  }
67
88
  }
68
89
  }
@@ -0,0 +1,156 @@
1
+ {
2
+ "settings": {
3
+ "analysis": {
4
+ "char_filter": {
5
+ "strip_special_chars": {
6
+ "type": "pattern_replace",
7
+ "pattern": "[\\p{Punct}\\p{S}]",
8
+ "replacement": ""
9
+ }
10
+ },
11
+ "analyzer": {
12
+ "accent_edge_analyzer": {
13
+ "tokenizer": "standard",
14
+ "type": "custom",
15
+ "char_filter": ["strip_special_chars"],
16
+ "filter": [
17
+ "lowercase",
18
+ "asciifolding",
19
+ "edgegrams"
20
+ ]
21
+ },
22
+ "accent_analyzer": {
23
+ "tokenizer": "standard",
24
+ "type": "custom",
25
+ "char_filter": ["strip_special_chars"],
26
+ "filter": [
27
+ "lowercase",
28
+ "asciifolding"
29
+ ]
30
+ }
31
+ },
32
+ "normalizer": {
33
+ "accent_normalizer": {
34
+ "type": "custom",
35
+ "char_filter": ["strip_special_chars"],
36
+ "filter": [
37
+ "lowercase",
38
+ "asciifolding"
39
+ ]
40
+ }
41
+ },
42
+ "filter": {
43
+ "lowercase": {
44
+ "type": "lowercase",
45
+ "preserve_original": true
46
+ },
47
+ "asciifolding": {
48
+ "type": "asciifolding",
49
+ "preserve_original": true
50
+ },
51
+ "edgegrams": {
52
+ "type": "edge_ngram",
53
+ "min_gram": 2,
54
+ "max_gram": 20
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "mappings": {
60
+ "dynamic_templates": [
61
+ {
62
+ "i18n_title": {
63
+ "path_match": "title.*",
64
+ "match_mapping_type": "string",
65
+ "mapping": {
66
+ "type": "text",
67
+ "analyzer": "accent_edge_analyzer",
68
+ "search_analyzer": "accent_analyzer"
69
+ }
70
+ }
71
+ }
72
+ ],
73
+ "dynamic": "strict",
74
+ "properties": {
75
+ "$schema": {
76
+ "type": "keyword",
77
+ "index": "false"
78
+ },
79
+ "created": {
80
+ "type": "date"
81
+ },
82
+ "updated": {
83
+ "type": "date"
84
+ },
85
+ "indexed_at": {
86
+ "type": "date"
87
+ },
88
+ "uuid": {
89
+ "type": "keyword"
90
+ },
91
+ "version_id": {
92
+ "type": "integer"
93
+ },
94
+ "identifiers": {
95
+ "properties": {
96
+ "identifier": {
97
+ "type": "keyword"
98
+ },
99
+ "scheme": {
100
+ "type": "keyword"
101
+ }
102
+ }
103
+ },
104
+ "name_sort": {
105
+ "type": "keyword"
106
+ },
107
+ "name": {
108
+ "type": "text",
109
+ "analyzer": "accent_edge_analyzer",
110
+ "search_analyzer": "accent_analyzer",
111
+ "copy_to": "name_sort"
112
+ },
113
+ "country": {
114
+ "type": "text"
115
+ },
116
+ "country_name": {
117
+ "type": "text"
118
+ },
119
+ "location_name": {
120
+ "type": "text"
121
+ },
122
+ "acronym": {
123
+ "type": "text",
124
+ "analyzer": "accent_edge_analyzer",
125
+ "search_analyzer": "accent_analyzer",
126
+ "fields": {
127
+ "keyword": {
128
+ "type": "keyword",
129
+ "normalizer": "accent_normalizer"
130
+ }
131
+ }
132
+ },
133
+ "status": {
134
+ "type": "keyword"
135
+ },
136
+ "aliases": {
137
+ "type": "text",
138
+ "analyzer": "accent_edge_analyzer",
139
+ "search_analyzer": "accent_analyzer"
140
+ },
141
+ "types": {
142
+ "type": "keyword"
143
+ },
144
+ "id": {
145
+ "type": "keyword"
146
+ },
147
+ "title": {
148
+ "type": "object",
149
+ "dynamic": "true"
150
+ },
151
+ "tags": {
152
+ "type": "keyword"
153
+ }
154
+ }
155
+ }
156
+ }
@@ -57,12 +57,33 @@
57
57
  "country": {
58
58
  "type": "text"
59
59
  },
60
+ "country_name": {
61
+ "type": "text"
62
+ },
63
+ "location_name": {
64
+ "type": "text"
65
+ },
66
+ "acronym": {
67
+ "type": "text"
68
+ },
69
+ "status": {
70
+ "type": "keyword"
71
+ },
72
+ "aliases": {
73
+ "type": "text"
74
+ },
75
+ "types": {
76
+ "type": "keyword"
77
+ },
60
78
  "id": {
61
79
  "type": "keyword"
62
80
  },
63
81
  "title": {
64
82
  "type": "object",
65
- "dynamic": true
83
+ "dynamic": "true"
84
+ },
85
+ "tags": {
86
+ "type": "keyword"
66
87
  }
67
88
  }
68
89
  }
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
3
  # Copyright (C) 2021-2022 CERN.
4
+ # Copyright (C) 2024 California Institute of Technology.
4
5
  #
5
6
  # Invenio-Vocabularies is free software; you can redistribute it and/or
6
7
  # modify it under the terms of the MIT License; see LICENSE file for more
@@ -43,6 +44,8 @@ class FunderSchema(BaseVocabularySchema):
43
44
  required=True, validate=validate.Length(min=1, error=_("Name cannot be blank."))
44
45
  )
45
46
  country = SanitizedUnicode()
47
+ country_name = SanitizedUnicode()
48
+ location_name = SanitizedUnicode()
46
49
  identifiers = IdentifierSet(
47
50
  fields.Nested(
48
51
  partial(
@@ -57,6 +60,11 @@ class FunderSchema(BaseVocabularySchema):
57
60
  validate=validate.Length(min=1, error=_("PID cannot be blank."))
58
61
  )
59
62
 
63
+ acronym = SanitizedUnicode()
64
+ aliases = fields.List(SanitizedUnicode())
65
+ status = SanitizedUnicode()
66
+ types = fields.List(SanitizedUnicode())
67
+
60
68
  @validates_schema
61
69
  def validate_id(self, data, **kwargs):
62
70
  """Validates ID."""
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2022 CERN.
3
+ # Copyright (C) 2022-2024 CERN.
4
4
  #
5
5
  # Invenio-Vocabularies is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the MIT License; see LICENSE file for more
@@ -29,4 +29,5 @@ class FunderL10NItemSchema(Schema):
29
29
  props = fields.Dict(dump_only=True)
30
30
  name = fields.String(dump_only=True)
31
31
  country = fields.String(dump_only=True)
32
+ country_name = fields.String(dump_only=True)
32
33
  identifiers = fields.List(fields.Nested(IdentifierSchema), dump_only=True)