entryscape 1.3.0__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.
Files changed (82) hide show
  1. entryscape/__init__.py +219 -0
  2. entryscape/api/__init__.py +26 -0
  3. entryscape/api/app_token_api.py +835 -0
  4. entryscape/api/auth_api.py +965 -0
  5. entryscape/api/catalog_api.py +4473 -0
  6. entryscape/api/contact_api.py +3135 -0
  7. entryscape/api/dataservice_api.py +3135 -0
  8. entryscape/api/dataset_api.py +3804 -0
  9. entryscape/api/distribution_api.py +3135 -0
  10. entryscape/api/document_api.py +2740 -0
  11. entryscape/api/idea_api.py +2740 -0
  12. entryscape/api/job_api.py +360 -0
  13. entryscape/api/model_api.py +2446 -0
  14. entryscape/api/model_class_api.py +2611 -0
  15. entryscape/api/model_diagram_api.py +2611 -0
  16. entryscape/api/model_field_api.py +2611 -0
  17. entryscape/api/model_form_api.py +2611 -0
  18. entryscape/api/model_namespace_api.py +2611 -0
  19. entryscape/api/model_property_api.py +2611 -0
  20. entryscape/api/organization_api.py +3135 -0
  21. entryscape/api/search_api.py +1513 -0
  22. entryscape/api/showcase_api.py +2740 -0
  23. entryscape/api/suggestion_api.py +2740 -0
  24. entryscape/api/terminology_api.py +1726 -0
  25. entryscape/api/upload_api.py +814 -0
  26. entryscape/api_client.py +763 -0
  27. entryscape/api_response.py +20 -0
  28. entryscape/configuration.py +673 -0
  29. entryscape/exceptions.py +222 -0
  30. entryscape/models/__init__.py +71 -0
  31. entryscape/models/app_token.py +156 -0
  32. entryscape/models/app_token_create_request.py +98 -0
  33. entryscape/models/app_token_create_response.py +169 -0
  34. entryscape/models/app_token_status.py +35 -0
  35. entryscape/models/app_token_verify_request.py +109 -0
  36. entryscape/models/entity_list_item.py +175 -0
  37. entryscape/models/entity_list_response.py +139 -0
  38. entryscape/models/entity_reference.py +189 -0
  39. entryscape/models/entity_type.py +57 -0
  40. entryscape/models/error.py +135 -0
  41. entryscape/models/facet_field.py +115 -0
  42. entryscape/models/facet_field_values_inner.py +100 -0
  43. entryscape/models/facet_list.py +113 -0
  44. entryscape/models/facet_list_available_inner.py +107 -0
  45. entryscape/models/job_response.py +112 -0
  46. entryscape/models/job_status.py +189 -0
  47. entryscape/models/job_status_progress.py +100 -0
  48. entryscape/models/job_status_value.py +37 -0
  49. entryscape/models/job_type.py +37 -0
  50. entryscape/models/list_catalogs_entry_type_parameter.py +37 -0
  51. entryscape/models/list_catalogs_graph_type_parameter.py +44 -0
  52. entryscape/models/list_catalogs_resource_type_parameter.py +37 -0
  53. entryscape/models/login_request.py +108 -0
  54. entryscape/models/login_response.py +115 -0
  55. entryscape/models/metadata_format.py +38 -0
  56. entryscape/models/metadata_request.py +99 -0
  57. entryscape/models/parent_reference.py +130 -0
  58. entryscape/models/search_request.py +158 -0
  59. entryscape/models/search_request_filters.py +144 -0
  60. entryscape/models/search_request_filters_graph_type.py +44 -0
  61. entryscape/models/search_request_filters_resource_type.py +37 -0
  62. entryscape/models/search_request_sort.py +38 -0
  63. entryscape/models/search_request_sort_order.py +35 -0
  64. entryscape/models/search_response.py +175 -0
  65. entryscape/models/search_result.py +175 -0
  66. entryscape/models/search_result_graph_type.py +44 -0
  67. entryscape/models/search_result_resource_type.py +37 -0
  68. entryscape/models/search_sort_order_parameter.py +35 -0
  69. entryscape/models/terminology_import_mode.py +35 -0
  70. entryscape/models/validation_profile.py +36 -0
  71. entryscape/models/validation_response.py +149 -0
  72. entryscape/models/validation_result.py +162 -0
  73. entryscape/models/validation_severity.py +36 -0
  74. entryscape/models/validation_summary.py +122 -0
  75. entryscape/models/whoami_response.py +104 -0
  76. entryscape/py.typed +0 -0
  77. entryscape/rest.py +210 -0
  78. entryscape-1.3.0.dist-info/METADATA +696 -0
  79. entryscape-1.3.0.dist-info/RECORD +82 -0
  80. entryscape-1.3.0.dist-info/WHEEL +5 -0
  81. entryscape-1.3.0.dist-info/licenses/LICENSE.txt +165 -0
  82. entryscape-1.3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1726 @@
1
+ """
2
+ EntryScape API
3
+
4
+ This API provides structured access to EntryScape data following DCAT-AP standards. All entity endpoints follow a consistent pattern: - GET /{entity} - List all entities - POST /{entity} - Create a new entity (DCAT types only) - GET /{entity}/{context_id}/{entry_id} - Get entity reference info - DELETE /{entity}/{context_id}/{entry_id} - Delete an entity (DCAT types only) - GET /{entity}/{context_id}/{entry_id}/metadata - Get raw RDF metadata - PUT /{entity}/{context_id}/{entry_id}/metadata - Replace raw RDF metadata (JSON-LD, Turtle, RDF/XML, or N-Triples passthrough) ## Reading and consistency Reads of a single entity — `GET /{entity}/{context_id}/{entry_id}` and its `/metadata` — go straight to the store and always reflect the latest write. Lists and search do not. They are answered from a search index that is updated asynchronously, so for a short interval after a write: - an entry that was just created may be missing from the list it belongs to, while reading it by id already works; - an entry that was just deleted may still appear; - `results` counts what the index holds, not what the store holds. Write a client that tolerates this: after creating an entry, use the id the create returned rather than searching for what you just wrote. `results` is also an upper bound rather than an exact count when the caller cannot read every hit (see the field's own description). Separately, responses are cached for 15 minutes by default, which is a second and unrelated source of staleness. A write invalidates the cache entries it affects, but a read that lands in the indexing gap can cache a list that does not yet show it. ## Authentication Most endpoints require an authenticated session. Reading public data works without authentication, while creating, updating, and deleting entities requires a valid user session. 1. **Log in** with `POST /auth/login`, supplying an EntryStore username and password. The response returns an `auth_token`. 2. **Send the token** on subsequent requests via the `X-Auth-Token` header. This is the recommended method for SDK and programmatic access. Browser clients can instead rely on the `auth_token` cookie, which the server sets automatically on login (`SameSite=Lax; Secure`). 3. **Inspect the session** with `GET /auth/whoami`, which returns the current user or an anonymous/guest identity when no valid token is supplied. 4. **Log out** with `POST /auth/logout` to invalidate the token and clear the cookie. ### Writes and CSRF Send the token as the `X-Auth-Token` **header** and there is nothing else to do: creates, updates and deletes work as they are, which is how the SDKs and the MCP server are built. The `auth_token` cookie is different. A cookie is attached by the browser automatically, so a state-changing request authenticated by it alone is what cross-site request forgery abuses, and those requests additionally need a double-submit token: read the `XSRF-TOKEN` cookie the server sets on any response and send its value back as the `X-XSRF-TOKEN` header. Without it the request is rejected with `403` before it reaches the endpoint. A custom header cannot be forged this way — cross-origin JavaScript cannot set one without a CORS preflight, which this API grants only to configured origins — so the header is the recommended path for anything that is not a browser session. ### App Tokens An app token identifies an integration. Create one with `POST /app-token` (unauthenticated). Creation requires an email address: the token starts in the `pending` state and a 6-digit code is emailed to the owner. Confirm the code with `POST /app-token/verify` to activate the token and receive its value, which is shown only once — store it securely. `GET /app-token/{app_token_id}` then returns its details and quota usage, authenticated by the token itself via the `X-App-Token` header. **The `X-App-Token` header is accepted only by `GET /app-token/{app_token_id}`.** No other operation reads it, and the read quota is recorded but not yet enforced: reading public data needs no token of any kind, and sending an app token with a read neither grants nor meters anything. Metered public read access is the intent of the two-token model, not a description of this release — see the `security` declared on each operation for what it actually accepts. ## SDKs Generated clients for Python, TypeScript, JavaScript and C# wrap every operation below, and each operation on this page shows the SDK call beside the `curl` command. Two of them install from a public registry: ``` pip install entryscape # Python npm install @entryscape/api-client # TypeScript and JavaScript ``` `@entryscape/api-client` ships an ESM and a CommonJS build, so `import` and `require()` both work and TypeScript is not required to use it — the name describes what it is written in, not what you have to write. There is a separate generated JavaScript SDK, and it is deliberately **not** on npm; this package is the npm client for both languages. Every SDK, including the C# and JavaScript ones, is also published as a tarball. The downloads are linked in the sidebar, they are the route to take when a registry is unreachable or a build has to vendor its dependencies, and each archive carries the SDK's own README: - **Python** — `pip install entryscape`, or `python-sdk.tar.gz`. - **TypeScript and JavaScript** — `npm install @entryscape/api-client`, or `typescript-sdk.tar.gz`. - **JavaScript (the separate generated client)** — not published to a registry, by design; `javascript-sdk.tar.gz` only. - **C#** — not published to NuGet yet; `csharp-sdk.tar.gz` only. - **MCP server** — `npx -y @entryscape/mcp-server`, or `mcp-server.tar.gz`. ## MCP Server A Model Context Protocol (MCP) server is generated from this specification and published alongside the SDKs (`@entryscape/mcp-server`), exposing the API as tools for AI assistants and agents. Each operation becomes one tool named after its `operationId` — `listDatasets`, `createCatalog`, `search`, `getJobStatus`. The `auth` operations are the exception: the server reads its token once at startup, so a `login` tool could install nothing and a `logout` tool would only invalidate the token the server was started with. On connect the server also hands the assistant a short set of rules that hold across every tool: a token is bound to one EntryStore instance, the search index lags a write, uploads finish as jobs. ### Install The server is on npm, and MCP servers are normally launched straight from there, so nothing has to be installed first: ``` npx -y @entryscape/mcp-server ``` `npm install -g @entryscape/mcp-server` works too and puts an `entryscape-mcp` binary on `PATH`. It is also listed in the MCP Registry as `com.entryscape/mcp-server`, which is where clients and marketplaces look it up. Without npm, download `mcp-server.tar.gz` from the SDK downloads and unpack it. The package ships prebuilt; install its runtime dependency once: ``` mkdir entryscape-mcp && tar -xzf mcp-server.tar.gz -C entryscape-mcp cd entryscape-mcp && npm install --omit=dev ``` ### Configure The server is a stdio MCP server configured through environment variables, read once at startup: - `ENTRYSCAPE_API_URL` — base URL of the API server, path included. Required: there is no default, and the server refuses to start without it. - `ENTRYSCAPE_AUTH_TOKEN` — a session token from `POST /auth/login`, sent as the `X-Auth-Token` header. Optional: without it reads see public entries and every write is refused. A token is valid only for the EntryStore instance that issued it. - `ENTRYSCAPE_ENTRYSTORE_HOST` — the EntryStore instance the API server should use, for example `dev.entryscape.com/store/`. Unset means the API server's own default. - `ENTRYSCAPE_MCP_UPLOAD_ROOT` — the directory the upload tools may read files from. **Unset means uploads are disabled**: `addFileToDistribution`, `replaceFileInDistribution` and `importTerminology` refuse and say so. - `ENTRYSCAPE_MCP_TAGS` — comma-separated tags to serve tools for, for example `catalog,dataset,distribution,search`. Unset serves every tool. The package's `README.md` lists the remaining variables (timeouts and size caps). Register the server with any MCP-capable client by adding it to the client's `mcpServers` configuration: ```json { \"mcpServers\": { \"entryscape\": { \"command\": \"npx\", \"args\": [\"-y\", \"@entryscape/mcp-server\"], \"env\": { \"ENTRYSCAPE_API_URL\": \"https://<your EntryScape API host>\", \"ENTRYSCAPE_AUTH_TOKEN\": \"your-session-token\" } } } } ``` From an unpacked download instead, the command is `\"command\": \"node\", \"args\": [\"/path/to/entryscape-mcp/dist/bin/entryscape-mcp.js\"]`. ### Claude Code The unpacked package is also a Claude Code plugin, so one install gives the server and the skills below together. Claude Code installs plugins from marketplaces, and the package carries a one-entry marketplace pointing at itself: ``` claude plugin marketplace add /path/to/entryscape-mcp claude plugin install entryscape@entryscape --scope user ``` The plugin passes `ENTRYSCAPE_API_URL`, `ENTRYSCAPE_AUTH_TOKEN`, `ENTRYSCAPE_ENTRYSTORE_HOST`, `ENTRYSCAPE_MCP_TAGS` and `ENTRYSCAPE_MCP_UPLOAD_ROOT` through from the shell Claude Code was started in, so set them there. To try the plugin for one session without installing it, start Claude Code with `--plugin-dir /path/to/entryscape-mcp`. ### Skills `skills/` in the package holds procedures that span several tools, in the Agent Skills format (a `SKILL.md` with `name` and `description`): which tools to call in which order, what to check between calls, and where to stop. Claude Code loads them from the plugin; other clients that read the format can be pointed at the directory. The `find` skill covers discovery, facets and selective metadata reads; `publish-dataset` takes a dataset from catalog to validated distribution with its file; `edit-metadata` changes an entry that already exists without dropping the rest of its graph, models included; `migrate-from-taskrunner` moves an integration off the deprecated Taskrunner API. Every tool a skill names is checked against this specification when the package is built. ## Deprecation Policy When endpoints or features are deprecated: 1. The operation is marked with `deprecated: true` in this spec 2. The operation description documents the replacement endpoint and sunset date 3. Deprecated endpoints remain functional for at least 6 months after announcement 4. The server returns a `Sunset` header with the planned removal date 5. After the sunset date, the endpoint may be removed in a future release
5
+
6
+ The version of the OpenAPI document: 1.3.0
7
+ Contact: contact@entryscape.com
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from datetime import datetime
19
+ from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator
20
+ from typing import Optional, Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from entryscape.models.entity_list_response import EntityListResponse
23
+ from entryscape.models.entity_reference import EntityReference
24
+ from entryscape.models.job_response import JobResponse
25
+ from entryscape.models.terminology_import_mode import TerminologyImportMode
26
+
27
+ from entryscape.api_client import ApiClient, RequestSerialized
28
+ from entryscape.api_response import ApiResponse
29
+ from entryscape.rest import RESTResponseType
30
+
31
+
32
+ class TerminologyApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+ @validate_call
45
+ async def delete_terminology(
46
+ self,
47
+ context_id: Annotated[
48
+ str,
49
+ Field(
50
+ strict=True,
51
+ description="The context (catalog) identifier in EntryStore",
52
+ ),
53
+ ],
54
+ x_entrystore_host: Annotated[
55
+ Optional[StrictStr],
56
+ Field(
57
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
58
+ ),
59
+ ] = None,
60
+ entrystore_host: Annotated[
61
+ Optional[StrictStr],
62
+ Field(
63
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
64
+ ),
65
+ ] = None,
66
+ _request_timeout: Union[
67
+ None,
68
+ Annotated[StrictFloat, Field(gt=0)],
69
+ Tuple[
70
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
71
+ ],
72
+ ] = None,
73
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
74
+ _content_type: Optional[StrictStr] = None,
75
+ _headers: Optional[Dict[StrictStr, Any]] = None,
76
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
77
+ ) -> None:
78
+ """Delete terminology
79
+
80
+ Deletes a terminology: the EntryStore context together with the concept scheme and every concept it contains, and the group that was provisioned with it when that group serves nothing else. This operation is irreversible. Refuses (404) a context that is not a terminology, so a model's context id cannot be deleted through this operation; use `DELETE /model/{context_id}` for a model. Requires authentication with permission to delete the terminology's context.
81
+
82
+ :param context_id: The context (catalog) identifier in EntryStore (required)
83
+ :type context_id: str
84
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
85
+ :type x_entrystore_host: str
86
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
87
+ :type entrystore_host: str
88
+ :param _request_timeout: timeout setting for this request. If one
89
+ number provided, it will be total request
90
+ timeout. It can also be a pair (tuple) of
91
+ (connection, read) timeouts.
92
+ :type _request_timeout: int, tuple(int, int), optional
93
+ :param _request_auth: set to override the auth_settings for an a single
94
+ request; this effectively ignores the
95
+ authentication in the spec for a single request.
96
+ :type _request_auth: dict, optional
97
+ :param _content_type: force content-type for the request.
98
+ :type _content_type: str, Optional
99
+ :param _headers: set to override the headers for a single
100
+ request; this effectively ignores the headers
101
+ in the spec for a single request.
102
+ :type _headers: dict, optional
103
+ :param _host_index: set to override the host_index for a single
104
+ request; this effectively ignores the host_index
105
+ in the spec for a single request.
106
+ :type _host_index: int, optional
107
+ :return: Returns the result object.
108
+ """ # noqa: E501
109
+
110
+ _param = self._delete_terminology_serialize(
111
+ context_id=context_id,
112
+ x_entrystore_host=x_entrystore_host,
113
+ entrystore_host=entrystore_host,
114
+ _request_auth=_request_auth,
115
+ _content_type=_content_type,
116
+ _headers=_headers,
117
+ _host_index=_host_index,
118
+ )
119
+
120
+ _response_types_map: Dict[str, Optional[str]] = {
121
+ "204": None,
122
+ "400": "Error",
123
+ "401": "Error",
124
+ "403": "Error",
125
+ "404": "Error",
126
+ "409": "Error",
127
+ "500": "Error",
128
+ "503": "Error",
129
+ }
130
+ response_data = await self.api_client.call_api(
131
+ *_param, _request_timeout=_request_timeout
132
+ )
133
+ await response_data.read()
134
+ return self.api_client.response_deserialize(
135
+ response_data=response_data,
136
+ response_types_map=_response_types_map,
137
+ ).data
138
+
139
+ @validate_call
140
+ async def delete_terminology_with_http_info(
141
+ self,
142
+ context_id: Annotated[
143
+ str,
144
+ Field(
145
+ strict=True,
146
+ description="The context (catalog) identifier in EntryStore",
147
+ ),
148
+ ],
149
+ x_entrystore_host: Annotated[
150
+ Optional[StrictStr],
151
+ Field(
152
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
153
+ ),
154
+ ] = None,
155
+ entrystore_host: Annotated[
156
+ Optional[StrictStr],
157
+ Field(
158
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
159
+ ),
160
+ ] = None,
161
+ _request_timeout: Union[
162
+ None,
163
+ Annotated[StrictFloat, Field(gt=0)],
164
+ Tuple[
165
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
166
+ ],
167
+ ] = None,
168
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
169
+ _content_type: Optional[StrictStr] = None,
170
+ _headers: Optional[Dict[StrictStr, Any]] = None,
171
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
172
+ ) -> ApiResponse[None]:
173
+ """Delete terminology
174
+
175
+ Deletes a terminology: the EntryStore context together with the concept scheme and every concept it contains, and the group that was provisioned with it when that group serves nothing else. This operation is irreversible. Refuses (404) a context that is not a terminology, so a model's context id cannot be deleted through this operation; use `DELETE /model/{context_id}` for a model. Requires authentication with permission to delete the terminology's context.
176
+
177
+ :param context_id: The context (catalog) identifier in EntryStore (required)
178
+ :type context_id: str
179
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
180
+ :type x_entrystore_host: str
181
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
182
+ :type entrystore_host: str
183
+ :param _request_timeout: timeout setting for this request. If one
184
+ number provided, it will be total request
185
+ timeout. It can also be a pair (tuple) of
186
+ (connection, read) timeouts.
187
+ :type _request_timeout: int, tuple(int, int), optional
188
+ :param _request_auth: set to override the auth_settings for an a single
189
+ request; this effectively ignores the
190
+ authentication in the spec for a single request.
191
+ :type _request_auth: dict, optional
192
+ :param _content_type: force content-type for the request.
193
+ :type _content_type: str, Optional
194
+ :param _headers: set to override the headers for a single
195
+ request; this effectively ignores the headers
196
+ in the spec for a single request.
197
+ :type _headers: dict, optional
198
+ :param _host_index: set to override the host_index for a single
199
+ request; this effectively ignores the host_index
200
+ in the spec for a single request.
201
+ :type _host_index: int, optional
202
+ :return: Returns the result object.
203
+ """ # noqa: E501
204
+
205
+ _param = self._delete_terminology_serialize(
206
+ context_id=context_id,
207
+ x_entrystore_host=x_entrystore_host,
208
+ entrystore_host=entrystore_host,
209
+ _request_auth=_request_auth,
210
+ _content_type=_content_type,
211
+ _headers=_headers,
212
+ _host_index=_host_index,
213
+ )
214
+
215
+ _response_types_map: Dict[str, Optional[str]] = {
216
+ "204": None,
217
+ "400": "Error",
218
+ "401": "Error",
219
+ "403": "Error",
220
+ "404": "Error",
221
+ "409": "Error",
222
+ "500": "Error",
223
+ "503": "Error",
224
+ }
225
+ response_data = await self.api_client.call_api(
226
+ *_param, _request_timeout=_request_timeout
227
+ )
228
+ await response_data.read()
229
+ return self.api_client.response_deserialize(
230
+ response_data=response_data,
231
+ response_types_map=_response_types_map,
232
+ )
233
+
234
+ @validate_call
235
+ async def delete_terminology_without_preload_content(
236
+ self,
237
+ context_id: Annotated[
238
+ str,
239
+ Field(
240
+ strict=True,
241
+ description="The context (catalog) identifier in EntryStore",
242
+ ),
243
+ ],
244
+ x_entrystore_host: Annotated[
245
+ Optional[StrictStr],
246
+ Field(
247
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
248
+ ),
249
+ ] = None,
250
+ entrystore_host: Annotated[
251
+ Optional[StrictStr],
252
+ Field(
253
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
254
+ ),
255
+ ] = None,
256
+ _request_timeout: Union[
257
+ None,
258
+ Annotated[StrictFloat, Field(gt=0)],
259
+ Tuple[
260
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
261
+ ],
262
+ ] = None,
263
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
264
+ _content_type: Optional[StrictStr] = None,
265
+ _headers: Optional[Dict[StrictStr, Any]] = None,
266
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
267
+ ) -> RESTResponseType:
268
+ """Delete terminology
269
+
270
+ Deletes a terminology: the EntryStore context together with the concept scheme and every concept it contains, and the group that was provisioned with it when that group serves nothing else. This operation is irreversible. Refuses (404) a context that is not a terminology, so a model's context id cannot be deleted through this operation; use `DELETE /model/{context_id}` for a model. Requires authentication with permission to delete the terminology's context.
271
+
272
+ :param context_id: The context (catalog) identifier in EntryStore (required)
273
+ :type context_id: str
274
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
275
+ :type x_entrystore_host: str
276
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
277
+ :type entrystore_host: str
278
+ :param _request_timeout: timeout setting for this request. If one
279
+ number provided, it will be total request
280
+ timeout. It can also be a pair (tuple) of
281
+ (connection, read) timeouts.
282
+ :type _request_timeout: int, tuple(int, int), optional
283
+ :param _request_auth: set to override the auth_settings for an a single
284
+ request; this effectively ignores the
285
+ authentication in the spec for a single request.
286
+ :type _request_auth: dict, optional
287
+ :param _content_type: force content-type for the request.
288
+ :type _content_type: str, Optional
289
+ :param _headers: set to override the headers for a single
290
+ request; this effectively ignores the headers
291
+ in the spec for a single request.
292
+ :type _headers: dict, optional
293
+ :param _host_index: set to override the host_index for a single
294
+ request; this effectively ignores the host_index
295
+ in the spec for a single request.
296
+ :type _host_index: int, optional
297
+ :return: Returns the result object.
298
+ """ # noqa: E501
299
+
300
+ _param = self._delete_terminology_serialize(
301
+ context_id=context_id,
302
+ x_entrystore_host=x_entrystore_host,
303
+ entrystore_host=entrystore_host,
304
+ _request_auth=_request_auth,
305
+ _content_type=_content_type,
306
+ _headers=_headers,
307
+ _host_index=_host_index,
308
+ )
309
+
310
+ _response_types_map: Dict[str, Optional[str]] = {
311
+ "204": None,
312
+ "400": "Error",
313
+ "401": "Error",
314
+ "403": "Error",
315
+ "404": "Error",
316
+ "409": "Error",
317
+ "500": "Error",
318
+ "503": "Error",
319
+ }
320
+ response_data = await self.api_client.call_api(
321
+ *_param, _request_timeout=_request_timeout
322
+ )
323
+ return response_data.response
324
+
325
+ def _delete_terminology_serialize(
326
+ self,
327
+ context_id,
328
+ x_entrystore_host,
329
+ entrystore_host,
330
+ _request_auth,
331
+ _content_type,
332
+ _headers,
333
+ _host_index,
334
+ ) -> RequestSerialized:
335
+
336
+ _host = None
337
+
338
+ _collection_formats: Dict[str, str] = {}
339
+
340
+ _path_params: Dict[str, str] = {}
341
+ _query_params: List[Tuple[str, str]] = []
342
+ _header_params: Dict[str, Optional[str]] = _headers or {}
343
+ _form_params: List[Tuple[str, str]] = []
344
+ _files: Dict[
345
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
346
+ ] = {}
347
+ _body_params: Optional[bytes] = None
348
+
349
+ # process the path parameters
350
+ if context_id is not None:
351
+ _path_params["context_id"] = context_id
352
+ # process the query parameters
353
+ if entrystore_host is not None:
354
+
355
+ _query_params.append(("entrystore_host", entrystore_host))
356
+
357
+ # process the header parameters
358
+ if x_entrystore_host is not None:
359
+ _header_params["X-Entrystore-Host"] = x_entrystore_host
360
+ # process the form parameters
361
+ # process the body parameter
362
+
363
+ # set the HTTP header `Accept`
364
+ if "Accept" not in _header_params:
365
+ _header_params["Accept"] = self.api_client.select_header_accept(
366
+ ["application/json"]
367
+ )
368
+
369
+ # authentication setting
370
+ _auth_settings: List[str] = ["auth_token", "auth_header"]
371
+
372
+ return self.api_client.param_serialize(
373
+ method="DELETE",
374
+ resource_path="/terminology/{context_id}",
375
+ path_params=_path_params,
376
+ query_params=_query_params,
377
+ header_params=_header_params,
378
+ body=_body_params,
379
+ post_params=_form_params,
380
+ files=_files,
381
+ auth_settings=_auth_settings,
382
+ collection_formats=_collection_formats,
383
+ _host=_host,
384
+ _request_auth=_request_auth,
385
+ )
386
+
387
+ @validate_call
388
+ async def get_terminology(
389
+ self,
390
+ context_id: Annotated[
391
+ str,
392
+ Field(
393
+ strict=True,
394
+ description="The context (catalog) identifier in EntryStore",
395
+ ),
396
+ ],
397
+ x_entrystore_host: Annotated[
398
+ Optional[StrictStr],
399
+ Field(
400
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
401
+ ),
402
+ ] = None,
403
+ entrystore_host: Annotated[
404
+ Optional[StrictStr],
405
+ Field(
406
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
407
+ ),
408
+ ] = None,
409
+ _request_timeout: Union[
410
+ None,
411
+ Annotated[StrictFloat, Field(gt=0)],
412
+ Tuple[
413
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
414
+ ],
415
+ ] = None,
416
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
417
+ _content_type: Optional[StrictStr] = None,
418
+ _headers: Optional[Dict[StrictStr, Any]] = None,
419
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
420
+ ) -> EntityReference:
421
+ """Get terminology
422
+
423
+ Returns basic reference information for a terminology, addressed by the `context_id` that `POST /terminology/import` provisioned for it (the job's `resultUrl` names it). The reference's `context_id` and `entry_id` are both that id, and its `uri` is the context resource. Answers 404 for a context that exists but is not a terminology, so a model's context id cannot be read through this operation. Authentication is optional. Public terminologies are accessible without authentication. Authenticated requests may access additional non-public terminologies.
424
+
425
+ :param context_id: The context (catalog) identifier in EntryStore (required)
426
+ :type context_id: str
427
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
428
+ :type x_entrystore_host: str
429
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
430
+ :type entrystore_host: str
431
+ :param _request_timeout: timeout setting for this request. If one
432
+ number provided, it will be total request
433
+ timeout. It can also be a pair (tuple) of
434
+ (connection, read) timeouts.
435
+ :type _request_timeout: int, tuple(int, int), optional
436
+ :param _request_auth: set to override the auth_settings for an a single
437
+ request; this effectively ignores the
438
+ authentication in the spec for a single request.
439
+ :type _request_auth: dict, optional
440
+ :param _content_type: force content-type for the request.
441
+ :type _content_type: str, Optional
442
+ :param _headers: set to override the headers for a single
443
+ request; this effectively ignores the headers
444
+ in the spec for a single request.
445
+ :type _headers: dict, optional
446
+ :param _host_index: set to override the host_index for a single
447
+ request; this effectively ignores the host_index
448
+ in the spec for a single request.
449
+ :type _host_index: int, optional
450
+ :return: Returns the result object.
451
+ """ # noqa: E501
452
+
453
+ _param = self._get_terminology_serialize(
454
+ context_id=context_id,
455
+ x_entrystore_host=x_entrystore_host,
456
+ entrystore_host=entrystore_host,
457
+ _request_auth=_request_auth,
458
+ _content_type=_content_type,
459
+ _headers=_headers,
460
+ _host_index=_host_index,
461
+ )
462
+
463
+ _response_types_map: Dict[str, Optional[str]] = {
464
+ "200": "EntityReference",
465
+ "400": "Error",
466
+ "401": "Error",
467
+ "404": "Error",
468
+ "500": "Error",
469
+ "503": "Error",
470
+ }
471
+ response_data = await self.api_client.call_api(
472
+ *_param, _request_timeout=_request_timeout
473
+ )
474
+ await response_data.read()
475
+ return self.api_client.response_deserialize(
476
+ response_data=response_data,
477
+ response_types_map=_response_types_map,
478
+ ).data
479
+
480
+ @validate_call
481
+ async def get_terminology_with_http_info(
482
+ self,
483
+ context_id: Annotated[
484
+ str,
485
+ Field(
486
+ strict=True,
487
+ description="The context (catalog) identifier in EntryStore",
488
+ ),
489
+ ],
490
+ x_entrystore_host: Annotated[
491
+ Optional[StrictStr],
492
+ Field(
493
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
494
+ ),
495
+ ] = None,
496
+ entrystore_host: Annotated[
497
+ Optional[StrictStr],
498
+ Field(
499
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
500
+ ),
501
+ ] = None,
502
+ _request_timeout: Union[
503
+ None,
504
+ Annotated[StrictFloat, Field(gt=0)],
505
+ Tuple[
506
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
507
+ ],
508
+ ] = None,
509
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
510
+ _content_type: Optional[StrictStr] = None,
511
+ _headers: Optional[Dict[StrictStr, Any]] = None,
512
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
513
+ ) -> ApiResponse[EntityReference]:
514
+ """Get terminology
515
+
516
+ Returns basic reference information for a terminology, addressed by the `context_id` that `POST /terminology/import` provisioned for it (the job's `resultUrl` names it). The reference's `context_id` and `entry_id` are both that id, and its `uri` is the context resource. Answers 404 for a context that exists but is not a terminology, so a model's context id cannot be read through this operation. Authentication is optional. Public terminologies are accessible without authentication. Authenticated requests may access additional non-public terminologies.
517
+
518
+ :param context_id: The context (catalog) identifier in EntryStore (required)
519
+ :type context_id: str
520
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
521
+ :type x_entrystore_host: str
522
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
523
+ :type entrystore_host: str
524
+ :param _request_timeout: timeout setting for this request. If one
525
+ number provided, it will be total request
526
+ timeout. It can also be a pair (tuple) of
527
+ (connection, read) timeouts.
528
+ :type _request_timeout: int, tuple(int, int), optional
529
+ :param _request_auth: set to override the auth_settings for an a single
530
+ request; this effectively ignores the
531
+ authentication in the spec for a single request.
532
+ :type _request_auth: dict, optional
533
+ :param _content_type: force content-type for the request.
534
+ :type _content_type: str, Optional
535
+ :param _headers: set to override the headers for a single
536
+ request; this effectively ignores the headers
537
+ in the spec for a single request.
538
+ :type _headers: dict, optional
539
+ :param _host_index: set to override the host_index for a single
540
+ request; this effectively ignores the host_index
541
+ in the spec for a single request.
542
+ :type _host_index: int, optional
543
+ :return: Returns the result object.
544
+ """ # noqa: E501
545
+
546
+ _param = self._get_terminology_serialize(
547
+ context_id=context_id,
548
+ x_entrystore_host=x_entrystore_host,
549
+ entrystore_host=entrystore_host,
550
+ _request_auth=_request_auth,
551
+ _content_type=_content_type,
552
+ _headers=_headers,
553
+ _host_index=_host_index,
554
+ )
555
+
556
+ _response_types_map: Dict[str, Optional[str]] = {
557
+ "200": "EntityReference",
558
+ "400": "Error",
559
+ "401": "Error",
560
+ "404": "Error",
561
+ "500": "Error",
562
+ "503": "Error",
563
+ }
564
+ response_data = await self.api_client.call_api(
565
+ *_param, _request_timeout=_request_timeout
566
+ )
567
+ await response_data.read()
568
+ return self.api_client.response_deserialize(
569
+ response_data=response_data,
570
+ response_types_map=_response_types_map,
571
+ )
572
+
573
+ @validate_call
574
+ async def get_terminology_without_preload_content(
575
+ self,
576
+ context_id: Annotated[
577
+ str,
578
+ Field(
579
+ strict=True,
580
+ description="The context (catalog) identifier in EntryStore",
581
+ ),
582
+ ],
583
+ x_entrystore_host: Annotated[
584
+ Optional[StrictStr],
585
+ Field(
586
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
587
+ ),
588
+ ] = None,
589
+ entrystore_host: Annotated[
590
+ Optional[StrictStr],
591
+ Field(
592
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
593
+ ),
594
+ ] = None,
595
+ _request_timeout: Union[
596
+ None,
597
+ Annotated[StrictFloat, Field(gt=0)],
598
+ Tuple[
599
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
600
+ ],
601
+ ] = None,
602
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
603
+ _content_type: Optional[StrictStr] = None,
604
+ _headers: Optional[Dict[StrictStr, Any]] = None,
605
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
606
+ ) -> RESTResponseType:
607
+ """Get terminology
608
+
609
+ Returns basic reference information for a terminology, addressed by the `context_id` that `POST /terminology/import` provisioned for it (the job's `resultUrl` names it). The reference's `context_id` and `entry_id` are both that id, and its `uri` is the context resource. Answers 404 for a context that exists but is not a terminology, so a model's context id cannot be read through this operation. Authentication is optional. Public terminologies are accessible without authentication. Authenticated requests may access additional non-public terminologies.
610
+
611
+ :param context_id: The context (catalog) identifier in EntryStore (required)
612
+ :type context_id: str
613
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
614
+ :type x_entrystore_host: str
615
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
616
+ :type entrystore_host: str
617
+ :param _request_timeout: timeout setting for this request. If one
618
+ number provided, it will be total request
619
+ timeout. It can also be a pair (tuple) of
620
+ (connection, read) timeouts.
621
+ :type _request_timeout: int, tuple(int, int), optional
622
+ :param _request_auth: set to override the auth_settings for an a single
623
+ request; this effectively ignores the
624
+ authentication in the spec for a single request.
625
+ :type _request_auth: dict, optional
626
+ :param _content_type: force content-type for the request.
627
+ :type _content_type: str, Optional
628
+ :param _headers: set to override the headers for a single
629
+ request; this effectively ignores the headers
630
+ in the spec for a single request.
631
+ :type _headers: dict, optional
632
+ :param _host_index: set to override the host_index for a single
633
+ request; this effectively ignores the host_index
634
+ in the spec for a single request.
635
+ :type _host_index: int, optional
636
+ :return: Returns the result object.
637
+ """ # noqa: E501
638
+
639
+ _param = self._get_terminology_serialize(
640
+ context_id=context_id,
641
+ x_entrystore_host=x_entrystore_host,
642
+ entrystore_host=entrystore_host,
643
+ _request_auth=_request_auth,
644
+ _content_type=_content_type,
645
+ _headers=_headers,
646
+ _host_index=_host_index,
647
+ )
648
+
649
+ _response_types_map: Dict[str, Optional[str]] = {
650
+ "200": "EntityReference",
651
+ "400": "Error",
652
+ "401": "Error",
653
+ "404": "Error",
654
+ "500": "Error",
655
+ "503": "Error",
656
+ }
657
+ response_data = await self.api_client.call_api(
658
+ *_param, _request_timeout=_request_timeout
659
+ )
660
+ return response_data.response
661
+
662
+ def _get_terminology_serialize(
663
+ self,
664
+ context_id,
665
+ x_entrystore_host,
666
+ entrystore_host,
667
+ _request_auth,
668
+ _content_type,
669
+ _headers,
670
+ _host_index,
671
+ ) -> RequestSerialized:
672
+
673
+ _host = None
674
+
675
+ _collection_formats: Dict[str, str] = {}
676
+
677
+ _path_params: Dict[str, str] = {}
678
+ _query_params: List[Tuple[str, str]] = []
679
+ _header_params: Dict[str, Optional[str]] = _headers or {}
680
+ _form_params: List[Tuple[str, str]] = []
681
+ _files: Dict[
682
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
683
+ ] = {}
684
+ _body_params: Optional[bytes] = None
685
+
686
+ # process the path parameters
687
+ if context_id is not None:
688
+ _path_params["context_id"] = context_id
689
+ # process the query parameters
690
+ if entrystore_host is not None:
691
+
692
+ _query_params.append(("entrystore_host", entrystore_host))
693
+
694
+ # process the header parameters
695
+ if x_entrystore_host is not None:
696
+ _header_params["X-Entrystore-Host"] = x_entrystore_host
697
+ # process the form parameters
698
+ # process the body parameter
699
+
700
+ # set the HTTP header `Accept`
701
+ if "Accept" not in _header_params:
702
+ _header_params["Accept"] = self.api_client.select_header_accept(
703
+ ["application/json"]
704
+ )
705
+
706
+ # authentication setting
707
+ _auth_settings: List[str] = ["auth_token", "auth_header"]
708
+
709
+ return self.api_client.param_serialize(
710
+ method="GET",
711
+ resource_path="/terminology/{context_id}",
712
+ path_params=_path_params,
713
+ query_params=_query_params,
714
+ header_params=_header_params,
715
+ body=_body_params,
716
+ post_params=_form_params,
717
+ files=_files,
718
+ auth_settings=_auth_settings,
719
+ collection_formats=_collection_formats,
720
+ _host=_host,
721
+ _request_auth=_request_auth,
722
+ )
723
+
724
+ @validate_call
725
+ async def import_terminology(
726
+ self,
727
+ x_entrystore_host: Annotated[
728
+ Optional[StrictStr],
729
+ Field(
730
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
731
+ ),
732
+ ] = None,
733
+ entrystore_host: Annotated[
734
+ Optional[StrictStr],
735
+ Field(
736
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
737
+ ),
738
+ ] = None,
739
+ file: Annotated[
740
+ Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]],
741
+ Field(
742
+ description="RDF file containing the SKOS terminology to import. Required if `sourceUrl` is not provided. "
743
+ ),
744
+ ] = None,
745
+ source_url: Annotated[
746
+ Optional[Annotated[str, Field(strict=True, max_length=2048)]],
747
+ Field(
748
+ description="URL to fetch the RDF terminology from. Required if `file` is not provided. "
749
+ ),
750
+ ] = None,
751
+ mode: Optional[TerminologyImportMode] = None,
752
+ _request_timeout: Union[
753
+ None,
754
+ Annotated[StrictFloat, Field(gt=0)],
755
+ Tuple[
756
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
757
+ ],
758
+ ] = None,
759
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
760
+ _content_type: Optional[StrictStr] = None,
761
+ _headers: Optional[Dict[StrictStr, Any]] = None,
762
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
763
+ ) -> JobResponse:
764
+ """Import SKOS terminology
765
+
766
+ Import a SKOS terminology from an RDF file or URL. The server validates the RDF structure (exactly one `skos:ConceptScheme`, at least one `skos:Concept`), then queues the import for asynchronous processing. Use `GET /job/{job_id}` to poll for import status and progress. Supported RDF formats: RDF/XML (`application/rdf+xml`), Turtle (`text/turtle`), N-Triples (`application/n-triples`), TriG (`application/trig`). Authentication is required.
767
+
768
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
769
+ :type x_entrystore_host: str
770
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
771
+ :type entrystore_host: str
772
+ :param file: RDF file containing the SKOS terminology to import. Required if `sourceUrl` is not provided.
773
+ :type file: bytes
774
+ :param source_url: URL to fetch the RDF terminology from. Required if `file` is not provided.
775
+ :type source_url: str
776
+ :param mode:
777
+ :type mode: TerminologyImportMode
778
+ :param _request_timeout: timeout setting for this request. If one
779
+ number provided, it will be total request
780
+ timeout. It can also be a pair (tuple) of
781
+ (connection, read) timeouts.
782
+ :type _request_timeout: int, tuple(int, int), optional
783
+ :param _request_auth: set to override the auth_settings for an a single
784
+ request; this effectively ignores the
785
+ authentication in the spec for a single request.
786
+ :type _request_auth: dict, optional
787
+ :param _content_type: force content-type for the request.
788
+ :type _content_type: str, Optional
789
+ :param _headers: set to override the headers for a single
790
+ request; this effectively ignores the headers
791
+ in the spec for a single request.
792
+ :type _headers: dict, optional
793
+ :param _host_index: set to override the host_index for a single
794
+ request; this effectively ignores the host_index
795
+ in the spec for a single request.
796
+ :type _host_index: int, optional
797
+ :return: Returns the result object.
798
+ """ # noqa: E501
799
+
800
+ _param = self._import_terminology_serialize(
801
+ x_entrystore_host=x_entrystore_host,
802
+ entrystore_host=entrystore_host,
803
+ file=file,
804
+ source_url=source_url,
805
+ mode=mode,
806
+ _request_auth=_request_auth,
807
+ _content_type=_content_type,
808
+ _headers=_headers,
809
+ _host_index=_host_index,
810
+ )
811
+
812
+ _response_types_map: Dict[str, Optional[str]] = {
813
+ "202": "JobResponse",
814
+ "400": "Error",
815
+ "401": "Error",
816
+ "403": "Error",
817
+ "413": "Error",
818
+ "422": "Error",
819
+ "500": "Error",
820
+ "503": "Error",
821
+ }
822
+ response_data = await self.api_client.call_api(
823
+ *_param, _request_timeout=_request_timeout
824
+ )
825
+ await response_data.read()
826
+ return self.api_client.response_deserialize(
827
+ response_data=response_data,
828
+ response_types_map=_response_types_map,
829
+ ).data
830
+
831
+ @validate_call
832
+ async def import_terminology_with_http_info(
833
+ self,
834
+ x_entrystore_host: Annotated[
835
+ Optional[StrictStr],
836
+ Field(
837
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
838
+ ),
839
+ ] = None,
840
+ entrystore_host: Annotated[
841
+ Optional[StrictStr],
842
+ Field(
843
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
844
+ ),
845
+ ] = None,
846
+ file: Annotated[
847
+ Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]],
848
+ Field(
849
+ description="RDF file containing the SKOS terminology to import. Required if `sourceUrl` is not provided. "
850
+ ),
851
+ ] = None,
852
+ source_url: Annotated[
853
+ Optional[Annotated[str, Field(strict=True, max_length=2048)]],
854
+ Field(
855
+ description="URL to fetch the RDF terminology from. Required if `file` is not provided. "
856
+ ),
857
+ ] = None,
858
+ mode: Optional[TerminologyImportMode] = None,
859
+ _request_timeout: Union[
860
+ None,
861
+ Annotated[StrictFloat, Field(gt=0)],
862
+ Tuple[
863
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
864
+ ],
865
+ ] = None,
866
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
867
+ _content_type: Optional[StrictStr] = None,
868
+ _headers: Optional[Dict[StrictStr, Any]] = None,
869
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
870
+ ) -> ApiResponse[JobResponse]:
871
+ """Import SKOS terminology
872
+
873
+ Import a SKOS terminology from an RDF file or URL. The server validates the RDF structure (exactly one `skos:ConceptScheme`, at least one `skos:Concept`), then queues the import for asynchronous processing. Use `GET /job/{job_id}` to poll for import status and progress. Supported RDF formats: RDF/XML (`application/rdf+xml`), Turtle (`text/turtle`), N-Triples (`application/n-triples`), TriG (`application/trig`). Authentication is required.
874
+
875
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
876
+ :type x_entrystore_host: str
877
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
878
+ :type entrystore_host: str
879
+ :param file: RDF file containing the SKOS terminology to import. Required if `sourceUrl` is not provided.
880
+ :type file: bytes
881
+ :param source_url: URL to fetch the RDF terminology from. Required if `file` is not provided.
882
+ :type source_url: str
883
+ :param mode:
884
+ :type mode: TerminologyImportMode
885
+ :param _request_timeout: timeout setting for this request. If one
886
+ number provided, it will be total request
887
+ timeout. It can also be a pair (tuple) of
888
+ (connection, read) timeouts.
889
+ :type _request_timeout: int, tuple(int, int), optional
890
+ :param _request_auth: set to override the auth_settings for an a single
891
+ request; this effectively ignores the
892
+ authentication in the spec for a single request.
893
+ :type _request_auth: dict, optional
894
+ :param _content_type: force content-type for the request.
895
+ :type _content_type: str, Optional
896
+ :param _headers: set to override the headers for a single
897
+ request; this effectively ignores the headers
898
+ in the spec for a single request.
899
+ :type _headers: dict, optional
900
+ :param _host_index: set to override the host_index for a single
901
+ request; this effectively ignores the host_index
902
+ in the spec for a single request.
903
+ :type _host_index: int, optional
904
+ :return: Returns the result object.
905
+ """ # noqa: E501
906
+
907
+ _param = self._import_terminology_serialize(
908
+ x_entrystore_host=x_entrystore_host,
909
+ entrystore_host=entrystore_host,
910
+ file=file,
911
+ source_url=source_url,
912
+ mode=mode,
913
+ _request_auth=_request_auth,
914
+ _content_type=_content_type,
915
+ _headers=_headers,
916
+ _host_index=_host_index,
917
+ )
918
+
919
+ _response_types_map: Dict[str, Optional[str]] = {
920
+ "202": "JobResponse",
921
+ "400": "Error",
922
+ "401": "Error",
923
+ "403": "Error",
924
+ "413": "Error",
925
+ "422": "Error",
926
+ "500": "Error",
927
+ "503": "Error",
928
+ }
929
+ response_data = await self.api_client.call_api(
930
+ *_param, _request_timeout=_request_timeout
931
+ )
932
+ await response_data.read()
933
+ return self.api_client.response_deserialize(
934
+ response_data=response_data,
935
+ response_types_map=_response_types_map,
936
+ )
937
+
938
+ @validate_call
939
+ async def import_terminology_without_preload_content(
940
+ self,
941
+ x_entrystore_host: Annotated[
942
+ Optional[StrictStr],
943
+ Field(
944
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
945
+ ),
946
+ ] = None,
947
+ entrystore_host: Annotated[
948
+ Optional[StrictStr],
949
+ Field(
950
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
951
+ ),
952
+ ] = None,
953
+ file: Annotated[
954
+ Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]],
955
+ Field(
956
+ description="RDF file containing the SKOS terminology to import. Required if `sourceUrl` is not provided. "
957
+ ),
958
+ ] = None,
959
+ source_url: Annotated[
960
+ Optional[Annotated[str, Field(strict=True, max_length=2048)]],
961
+ Field(
962
+ description="URL to fetch the RDF terminology from. Required if `file` is not provided. "
963
+ ),
964
+ ] = None,
965
+ mode: Optional[TerminologyImportMode] = None,
966
+ _request_timeout: Union[
967
+ None,
968
+ Annotated[StrictFloat, Field(gt=0)],
969
+ Tuple[
970
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
971
+ ],
972
+ ] = None,
973
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
974
+ _content_type: Optional[StrictStr] = None,
975
+ _headers: Optional[Dict[StrictStr, Any]] = None,
976
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
977
+ ) -> RESTResponseType:
978
+ """Import SKOS terminology
979
+
980
+ Import a SKOS terminology from an RDF file or URL. The server validates the RDF structure (exactly one `skos:ConceptScheme`, at least one `skos:Concept`), then queues the import for asynchronous processing. Use `GET /job/{job_id}` to poll for import status and progress. Supported RDF formats: RDF/XML (`application/rdf+xml`), Turtle (`text/turtle`), N-Triples (`application/n-triples`), TriG (`application/trig`). Authentication is required.
981
+
982
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
983
+ :type x_entrystore_host: str
984
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
985
+ :type entrystore_host: str
986
+ :param file: RDF file containing the SKOS terminology to import. Required if `sourceUrl` is not provided.
987
+ :type file: bytes
988
+ :param source_url: URL to fetch the RDF terminology from. Required if `file` is not provided.
989
+ :type source_url: str
990
+ :param mode:
991
+ :type mode: TerminologyImportMode
992
+ :param _request_timeout: timeout setting for this request. If one
993
+ number provided, it will be total request
994
+ timeout. It can also be a pair (tuple) of
995
+ (connection, read) timeouts.
996
+ :type _request_timeout: int, tuple(int, int), optional
997
+ :param _request_auth: set to override the auth_settings for an a single
998
+ request; this effectively ignores the
999
+ authentication in the spec for a single request.
1000
+ :type _request_auth: dict, optional
1001
+ :param _content_type: force content-type for the request.
1002
+ :type _content_type: str, Optional
1003
+ :param _headers: set to override the headers for a single
1004
+ request; this effectively ignores the headers
1005
+ in the spec for a single request.
1006
+ :type _headers: dict, optional
1007
+ :param _host_index: set to override the host_index for a single
1008
+ request; this effectively ignores the host_index
1009
+ in the spec for a single request.
1010
+ :type _host_index: int, optional
1011
+ :return: Returns the result object.
1012
+ """ # noqa: E501
1013
+
1014
+ _param = self._import_terminology_serialize(
1015
+ x_entrystore_host=x_entrystore_host,
1016
+ entrystore_host=entrystore_host,
1017
+ file=file,
1018
+ source_url=source_url,
1019
+ mode=mode,
1020
+ _request_auth=_request_auth,
1021
+ _content_type=_content_type,
1022
+ _headers=_headers,
1023
+ _host_index=_host_index,
1024
+ )
1025
+
1026
+ _response_types_map: Dict[str, Optional[str]] = {
1027
+ "202": "JobResponse",
1028
+ "400": "Error",
1029
+ "401": "Error",
1030
+ "403": "Error",
1031
+ "413": "Error",
1032
+ "422": "Error",
1033
+ "500": "Error",
1034
+ "503": "Error",
1035
+ }
1036
+ response_data = await self.api_client.call_api(
1037
+ *_param, _request_timeout=_request_timeout
1038
+ )
1039
+ return response_data.response
1040
+
1041
+ def _import_terminology_serialize(
1042
+ self,
1043
+ x_entrystore_host,
1044
+ entrystore_host,
1045
+ file,
1046
+ source_url,
1047
+ mode,
1048
+ _request_auth,
1049
+ _content_type,
1050
+ _headers,
1051
+ _host_index,
1052
+ ) -> RequestSerialized:
1053
+
1054
+ _host = None
1055
+
1056
+ _collection_formats: Dict[str, str] = {}
1057
+
1058
+ _path_params: Dict[str, str] = {}
1059
+ _query_params: List[Tuple[str, str]] = []
1060
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1061
+ _form_params: List[Tuple[str, str]] = []
1062
+ _files: Dict[
1063
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1064
+ ] = {}
1065
+ _body_params: Optional[bytes] = None
1066
+
1067
+ # process the path parameters
1068
+ # process the query parameters
1069
+ if entrystore_host is not None:
1070
+
1071
+ _query_params.append(("entrystore_host", entrystore_host))
1072
+
1073
+ # process the header parameters
1074
+ if x_entrystore_host is not None:
1075
+ _header_params["X-Entrystore-Host"] = x_entrystore_host
1076
+ # process the form parameters
1077
+ if file is not None:
1078
+ _files["file"] = file
1079
+ if source_url is not None:
1080
+ _form_params.append(("sourceUrl", source_url))
1081
+ if mode is not None:
1082
+ _form_params.append(("mode", mode))
1083
+ # process the body parameter
1084
+
1085
+ # set the HTTP header `Accept`
1086
+ if "Accept" not in _header_params:
1087
+ _header_params["Accept"] = self.api_client.select_header_accept(
1088
+ ["application/json"]
1089
+ )
1090
+
1091
+ # set the HTTP header `Content-Type`
1092
+ if _content_type:
1093
+ _header_params["Content-Type"] = _content_type
1094
+ else:
1095
+ _default_content_type = self.api_client.select_header_content_type(
1096
+ ["multipart/form-data"]
1097
+ )
1098
+ if _default_content_type is not None:
1099
+ _header_params["Content-Type"] = _default_content_type
1100
+
1101
+ # authentication setting
1102
+ _auth_settings: List[str] = ["auth_token", "auth_header"]
1103
+
1104
+ return self.api_client.param_serialize(
1105
+ method="POST",
1106
+ resource_path="/terminology/import",
1107
+ path_params=_path_params,
1108
+ query_params=_query_params,
1109
+ header_params=_header_params,
1110
+ body=_body_params,
1111
+ post_params=_form_params,
1112
+ files=_files,
1113
+ auth_settings=_auth_settings,
1114
+ collection_formats=_collection_formats,
1115
+ _host=_host,
1116
+ _request_auth=_request_auth,
1117
+ )
1118
+
1119
+ @validate_call
1120
+ async def list_terminologies(
1121
+ self,
1122
+ x_entrystore_host: Annotated[
1123
+ Optional[StrictStr],
1124
+ Field(
1125
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
1126
+ ),
1127
+ ] = None,
1128
+ entrystore_host: Annotated[
1129
+ Optional[StrictStr],
1130
+ Field(
1131
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
1132
+ ),
1133
+ ] = None,
1134
+ limit: Annotated[
1135
+ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1136
+ Field(description="Results per page"),
1137
+ ] = None,
1138
+ offset: Annotated[
1139
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
1140
+ Field(description="Results to skip before the first one returned"),
1141
+ ] = None,
1142
+ cursor: Annotated[
1143
+ Optional[Annotated[str, Field(strict=True, max_length=512)]],
1144
+ Field(
1145
+ description="Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response. "
1146
+ ),
1147
+ ] = None,
1148
+ query: Annotated[
1149
+ Optional[Annotated[str, Field(strict=True, max_length=1000)]],
1150
+ Field(
1151
+ description="Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own. "
1152
+ ),
1153
+ ] = None,
1154
+ sort: Annotated[
1155
+ Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]],
1156
+ Field(
1157
+ description="Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400. "
1158
+ ),
1159
+ ] = None,
1160
+ public: Annotated[
1161
+ Optional[StrictBool],
1162
+ Field(
1163
+ description="true: only publicly readable entries; false: only non-public entries"
1164
+ ),
1165
+ ] = None,
1166
+ created_after: Annotated[
1167
+ Optional[datetime], Field(description="Created at or after this instant")
1168
+ ] = None,
1169
+ created_before: Annotated[
1170
+ Optional[datetime], Field(description="Created before this instant")
1171
+ ] = None,
1172
+ modified_after: Annotated[
1173
+ Optional[datetime], Field(description="Modified at or after this instant")
1174
+ ] = None,
1175
+ modified_before: Annotated[
1176
+ Optional[datetime], Field(description="Modified before this instant")
1177
+ ] = None,
1178
+ _request_timeout: Union[
1179
+ None,
1180
+ Annotated[StrictFloat, Field(gt=0)],
1181
+ Tuple[
1182
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1183
+ ],
1184
+ ] = None,
1185
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1186
+ _content_type: Optional[StrictStr] = None,
1187
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1188
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1189
+ ) -> EntityListResponse:
1190
+ """List terminologies
1191
+
1192
+ Returns a paginated list of the SKOS terminologies on the EntryStore instance. A terminology is an EntryStore context (`es:TerminologyContext`) holding one `skos:ConceptScheme` and its concepts, provisioned by `POST /terminology/import`, so a terminology is addressed by its `context_id` alone. Each item's `context_id` and `entry_id` both carry that id. Authentication is optional. Without authentication, only publicly readable terminologies are returned. Authenticated requests may return additional non-public terminologies. Answered from an asynchronously updated index: a terminology imported moments ago may be missing here while reading it by id already returns it.
1193
+
1194
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
1195
+ :type x_entrystore_host: str
1196
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
1197
+ :type entrystore_host: str
1198
+ :param limit: Results per page
1199
+ :type limit: int
1200
+ :param offset: Results to skip before the first one returned
1201
+ :type offset: int
1202
+ :param cursor: Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response.
1203
+ :type cursor: str
1204
+ :param query: Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own.
1205
+ :type query: str
1206
+ :param sort: Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400.
1207
+ :type sort: str
1208
+ :param public: true: only publicly readable entries; false: only non-public entries
1209
+ :type public: bool
1210
+ :param created_after: Created at or after this instant
1211
+ :type created_after: datetime
1212
+ :param created_before: Created before this instant
1213
+ :type created_before: datetime
1214
+ :param modified_after: Modified at or after this instant
1215
+ :type modified_after: datetime
1216
+ :param modified_before: Modified before this instant
1217
+ :type modified_before: datetime
1218
+ :param _request_timeout: timeout setting for this request. If one
1219
+ number provided, it will be total request
1220
+ timeout. It can also be a pair (tuple) of
1221
+ (connection, read) timeouts.
1222
+ :type _request_timeout: int, tuple(int, int), optional
1223
+ :param _request_auth: set to override the auth_settings for an a single
1224
+ request; this effectively ignores the
1225
+ authentication in the spec for a single request.
1226
+ :type _request_auth: dict, optional
1227
+ :param _content_type: force content-type for the request.
1228
+ :type _content_type: str, Optional
1229
+ :param _headers: set to override the headers for a single
1230
+ request; this effectively ignores the headers
1231
+ in the spec for a single request.
1232
+ :type _headers: dict, optional
1233
+ :param _host_index: set to override the host_index for a single
1234
+ request; this effectively ignores the host_index
1235
+ in the spec for a single request.
1236
+ :type _host_index: int, optional
1237
+ :return: Returns the result object.
1238
+ """ # noqa: E501
1239
+
1240
+ _param = self._list_terminologies_serialize(
1241
+ x_entrystore_host=x_entrystore_host,
1242
+ entrystore_host=entrystore_host,
1243
+ limit=limit,
1244
+ offset=offset,
1245
+ cursor=cursor,
1246
+ query=query,
1247
+ sort=sort,
1248
+ public=public,
1249
+ created_after=created_after,
1250
+ created_before=created_before,
1251
+ modified_after=modified_after,
1252
+ modified_before=modified_before,
1253
+ _request_auth=_request_auth,
1254
+ _content_type=_content_type,
1255
+ _headers=_headers,
1256
+ _host_index=_host_index,
1257
+ )
1258
+
1259
+ _response_types_map: Dict[str, Optional[str]] = {
1260
+ "200": "EntityListResponse",
1261
+ "400": "Error",
1262
+ "401": "Error",
1263
+ "500": "Error",
1264
+ "503": "Error",
1265
+ }
1266
+ response_data = await self.api_client.call_api(
1267
+ *_param, _request_timeout=_request_timeout
1268
+ )
1269
+ await response_data.read()
1270
+ return self.api_client.response_deserialize(
1271
+ response_data=response_data,
1272
+ response_types_map=_response_types_map,
1273
+ ).data
1274
+
1275
+ @validate_call
1276
+ async def list_terminologies_with_http_info(
1277
+ self,
1278
+ x_entrystore_host: Annotated[
1279
+ Optional[StrictStr],
1280
+ Field(
1281
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
1282
+ ),
1283
+ ] = None,
1284
+ entrystore_host: Annotated[
1285
+ Optional[StrictStr],
1286
+ Field(
1287
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
1288
+ ),
1289
+ ] = None,
1290
+ limit: Annotated[
1291
+ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1292
+ Field(description="Results per page"),
1293
+ ] = None,
1294
+ offset: Annotated[
1295
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
1296
+ Field(description="Results to skip before the first one returned"),
1297
+ ] = None,
1298
+ cursor: Annotated[
1299
+ Optional[Annotated[str, Field(strict=True, max_length=512)]],
1300
+ Field(
1301
+ description="Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response. "
1302
+ ),
1303
+ ] = None,
1304
+ query: Annotated[
1305
+ Optional[Annotated[str, Field(strict=True, max_length=1000)]],
1306
+ Field(
1307
+ description="Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own. "
1308
+ ),
1309
+ ] = None,
1310
+ sort: Annotated[
1311
+ Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]],
1312
+ Field(
1313
+ description="Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400. "
1314
+ ),
1315
+ ] = None,
1316
+ public: Annotated[
1317
+ Optional[StrictBool],
1318
+ Field(
1319
+ description="true: only publicly readable entries; false: only non-public entries"
1320
+ ),
1321
+ ] = None,
1322
+ created_after: Annotated[
1323
+ Optional[datetime], Field(description="Created at or after this instant")
1324
+ ] = None,
1325
+ created_before: Annotated[
1326
+ Optional[datetime], Field(description="Created before this instant")
1327
+ ] = None,
1328
+ modified_after: Annotated[
1329
+ Optional[datetime], Field(description="Modified at or after this instant")
1330
+ ] = None,
1331
+ modified_before: Annotated[
1332
+ Optional[datetime], Field(description="Modified before this instant")
1333
+ ] = None,
1334
+ _request_timeout: Union[
1335
+ None,
1336
+ Annotated[StrictFloat, Field(gt=0)],
1337
+ Tuple[
1338
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1339
+ ],
1340
+ ] = None,
1341
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1342
+ _content_type: Optional[StrictStr] = None,
1343
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1344
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1345
+ ) -> ApiResponse[EntityListResponse]:
1346
+ """List terminologies
1347
+
1348
+ Returns a paginated list of the SKOS terminologies on the EntryStore instance. A terminology is an EntryStore context (`es:TerminologyContext`) holding one `skos:ConceptScheme` and its concepts, provisioned by `POST /terminology/import`, so a terminology is addressed by its `context_id` alone. Each item's `context_id` and `entry_id` both carry that id. Authentication is optional. Without authentication, only publicly readable terminologies are returned. Authenticated requests may return additional non-public terminologies. Answered from an asynchronously updated index: a terminology imported moments ago may be missing here while reading it by id already returns it.
1349
+
1350
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
1351
+ :type x_entrystore_host: str
1352
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
1353
+ :type entrystore_host: str
1354
+ :param limit: Results per page
1355
+ :type limit: int
1356
+ :param offset: Results to skip before the first one returned
1357
+ :type offset: int
1358
+ :param cursor: Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response.
1359
+ :type cursor: str
1360
+ :param query: Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own.
1361
+ :type query: str
1362
+ :param sort: Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400.
1363
+ :type sort: str
1364
+ :param public: true: only publicly readable entries; false: only non-public entries
1365
+ :type public: bool
1366
+ :param created_after: Created at or after this instant
1367
+ :type created_after: datetime
1368
+ :param created_before: Created before this instant
1369
+ :type created_before: datetime
1370
+ :param modified_after: Modified at or after this instant
1371
+ :type modified_after: datetime
1372
+ :param modified_before: Modified before this instant
1373
+ :type modified_before: datetime
1374
+ :param _request_timeout: timeout setting for this request. If one
1375
+ number provided, it will be total request
1376
+ timeout. It can also be a pair (tuple) of
1377
+ (connection, read) timeouts.
1378
+ :type _request_timeout: int, tuple(int, int), optional
1379
+ :param _request_auth: set to override the auth_settings for an a single
1380
+ request; this effectively ignores the
1381
+ authentication in the spec for a single request.
1382
+ :type _request_auth: dict, optional
1383
+ :param _content_type: force content-type for the request.
1384
+ :type _content_type: str, Optional
1385
+ :param _headers: set to override the headers for a single
1386
+ request; this effectively ignores the headers
1387
+ in the spec for a single request.
1388
+ :type _headers: dict, optional
1389
+ :param _host_index: set to override the host_index for a single
1390
+ request; this effectively ignores the host_index
1391
+ in the spec for a single request.
1392
+ :type _host_index: int, optional
1393
+ :return: Returns the result object.
1394
+ """ # noqa: E501
1395
+
1396
+ _param = self._list_terminologies_serialize(
1397
+ x_entrystore_host=x_entrystore_host,
1398
+ entrystore_host=entrystore_host,
1399
+ limit=limit,
1400
+ offset=offset,
1401
+ cursor=cursor,
1402
+ query=query,
1403
+ sort=sort,
1404
+ public=public,
1405
+ created_after=created_after,
1406
+ created_before=created_before,
1407
+ modified_after=modified_after,
1408
+ modified_before=modified_before,
1409
+ _request_auth=_request_auth,
1410
+ _content_type=_content_type,
1411
+ _headers=_headers,
1412
+ _host_index=_host_index,
1413
+ )
1414
+
1415
+ _response_types_map: Dict[str, Optional[str]] = {
1416
+ "200": "EntityListResponse",
1417
+ "400": "Error",
1418
+ "401": "Error",
1419
+ "500": "Error",
1420
+ "503": "Error",
1421
+ }
1422
+ response_data = await self.api_client.call_api(
1423
+ *_param, _request_timeout=_request_timeout
1424
+ )
1425
+ await response_data.read()
1426
+ return self.api_client.response_deserialize(
1427
+ response_data=response_data,
1428
+ response_types_map=_response_types_map,
1429
+ )
1430
+
1431
+ @validate_call
1432
+ async def list_terminologies_without_preload_content(
1433
+ self,
1434
+ x_entrystore_host: Annotated[
1435
+ Optional[StrictStr],
1436
+ Field(
1437
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
1438
+ ),
1439
+ ] = None,
1440
+ entrystore_host: Annotated[
1441
+ Optional[StrictStr],
1442
+ Field(
1443
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
1444
+ ),
1445
+ ] = None,
1446
+ limit: Annotated[
1447
+ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1448
+ Field(description="Results per page"),
1449
+ ] = None,
1450
+ offset: Annotated[
1451
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
1452
+ Field(description="Results to skip before the first one returned"),
1453
+ ] = None,
1454
+ cursor: Annotated[
1455
+ Optional[Annotated[str, Field(strict=True, max_length=512)]],
1456
+ Field(
1457
+ description="Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response. "
1458
+ ),
1459
+ ] = None,
1460
+ query: Annotated[
1461
+ Optional[Annotated[str, Field(strict=True, max_length=1000)]],
1462
+ Field(
1463
+ description="Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own. "
1464
+ ),
1465
+ ] = None,
1466
+ sort: Annotated[
1467
+ Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]],
1468
+ Field(
1469
+ description="Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400. "
1470
+ ),
1471
+ ] = None,
1472
+ public: Annotated[
1473
+ Optional[StrictBool],
1474
+ Field(
1475
+ description="true: only publicly readable entries; false: only non-public entries"
1476
+ ),
1477
+ ] = None,
1478
+ created_after: Annotated[
1479
+ Optional[datetime], Field(description="Created at or after this instant")
1480
+ ] = None,
1481
+ created_before: Annotated[
1482
+ Optional[datetime], Field(description="Created before this instant")
1483
+ ] = None,
1484
+ modified_after: Annotated[
1485
+ Optional[datetime], Field(description="Modified at or after this instant")
1486
+ ] = None,
1487
+ modified_before: Annotated[
1488
+ Optional[datetime], Field(description="Modified before this instant")
1489
+ ] = None,
1490
+ _request_timeout: Union[
1491
+ None,
1492
+ Annotated[StrictFloat, Field(gt=0)],
1493
+ Tuple[
1494
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1495
+ ],
1496
+ ] = None,
1497
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1498
+ _content_type: Optional[StrictStr] = None,
1499
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1500
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1501
+ ) -> RESTResponseType:
1502
+ """List terminologies
1503
+
1504
+ Returns a paginated list of the SKOS terminologies on the EntryStore instance. A terminology is an EntryStore context (`es:TerminologyContext`) holding one `skos:ConceptScheme` and its concepts, provisioned by `POST /terminology/import`, so a terminology is addressed by its `context_id` alone. Each item's `context_id` and `entry_id` both carry that id. Authentication is optional. Without authentication, only publicly readable terminologies are returned. Authenticated requests may return additional non-public terminologies. Answered from an asynchronously updated index: a terminology imported moments ago may be missing here while reading it by id already returns it.
1505
+
1506
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
1507
+ :type x_entrystore_host: str
1508
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
1509
+ :type entrystore_host: str
1510
+ :param limit: Results per page
1511
+ :type limit: int
1512
+ :param offset: Results to skip before the first one returned
1513
+ :type offset: int
1514
+ :param cursor: Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response.
1515
+ :type cursor: str
1516
+ :param query: Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own.
1517
+ :type query: str
1518
+ :param sort: Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400.
1519
+ :type sort: str
1520
+ :param public: true: only publicly readable entries; false: only non-public entries
1521
+ :type public: bool
1522
+ :param created_after: Created at or after this instant
1523
+ :type created_after: datetime
1524
+ :param created_before: Created before this instant
1525
+ :type created_before: datetime
1526
+ :param modified_after: Modified at or after this instant
1527
+ :type modified_after: datetime
1528
+ :param modified_before: Modified before this instant
1529
+ :type modified_before: datetime
1530
+ :param _request_timeout: timeout setting for this request. If one
1531
+ number provided, it will be total request
1532
+ timeout. It can also be a pair (tuple) of
1533
+ (connection, read) timeouts.
1534
+ :type _request_timeout: int, tuple(int, int), optional
1535
+ :param _request_auth: set to override the auth_settings for an a single
1536
+ request; this effectively ignores the
1537
+ authentication in the spec for a single request.
1538
+ :type _request_auth: dict, optional
1539
+ :param _content_type: force content-type for the request.
1540
+ :type _content_type: str, Optional
1541
+ :param _headers: set to override the headers for a single
1542
+ request; this effectively ignores the headers
1543
+ in the spec for a single request.
1544
+ :type _headers: dict, optional
1545
+ :param _host_index: set to override the host_index for a single
1546
+ request; this effectively ignores the host_index
1547
+ in the spec for a single request.
1548
+ :type _host_index: int, optional
1549
+ :return: Returns the result object.
1550
+ """ # noqa: E501
1551
+
1552
+ _param = self._list_terminologies_serialize(
1553
+ x_entrystore_host=x_entrystore_host,
1554
+ entrystore_host=entrystore_host,
1555
+ limit=limit,
1556
+ offset=offset,
1557
+ cursor=cursor,
1558
+ query=query,
1559
+ sort=sort,
1560
+ public=public,
1561
+ created_after=created_after,
1562
+ created_before=created_before,
1563
+ modified_after=modified_after,
1564
+ modified_before=modified_before,
1565
+ _request_auth=_request_auth,
1566
+ _content_type=_content_type,
1567
+ _headers=_headers,
1568
+ _host_index=_host_index,
1569
+ )
1570
+
1571
+ _response_types_map: Dict[str, Optional[str]] = {
1572
+ "200": "EntityListResponse",
1573
+ "400": "Error",
1574
+ "401": "Error",
1575
+ "500": "Error",
1576
+ "503": "Error",
1577
+ }
1578
+ response_data = await self.api_client.call_api(
1579
+ *_param, _request_timeout=_request_timeout
1580
+ )
1581
+ return response_data.response
1582
+
1583
+ def _list_terminologies_serialize(
1584
+ self,
1585
+ x_entrystore_host,
1586
+ entrystore_host,
1587
+ limit,
1588
+ offset,
1589
+ cursor,
1590
+ query,
1591
+ sort,
1592
+ public,
1593
+ created_after,
1594
+ created_before,
1595
+ modified_after,
1596
+ modified_before,
1597
+ _request_auth,
1598
+ _content_type,
1599
+ _headers,
1600
+ _host_index,
1601
+ ) -> RequestSerialized:
1602
+
1603
+ _host = None
1604
+
1605
+ _collection_formats: Dict[str, str] = {}
1606
+
1607
+ _path_params: Dict[str, str] = {}
1608
+ _query_params: List[Tuple[str, str]] = []
1609
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1610
+ _form_params: List[Tuple[str, str]] = []
1611
+ _files: Dict[
1612
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1613
+ ] = {}
1614
+ _body_params: Optional[bytes] = None
1615
+
1616
+ # process the path parameters
1617
+ # process the query parameters
1618
+ if entrystore_host is not None:
1619
+
1620
+ _query_params.append(("entrystore_host", entrystore_host))
1621
+
1622
+ if limit is not None:
1623
+
1624
+ _query_params.append(("limit", limit))
1625
+
1626
+ if offset is not None:
1627
+
1628
+ _query_params.append(("offset", offset))
1629
+
1630
+ if cursor is not None:
1631
+
1632
+ _query_params.append(("cursor", cursor))
1633
+
1634
+ if query is not None:
1635
+
1636
+ _query_params.append(("query", query))
1637
+
1638
+ if sort is not None:
1639
+
1640
+ _query_params.append(("sort", sort))
1641
+
1642
+ if public is not None:
1643
+
1644
+ _query_params.append(("public", public))
1645
+
1646
+ if created_after is not None:
1647
+ if isinstance(created_after, datetime):
1648
+ _query_params.append(
1649
+ (
1650
+ "created_after",
1651
+ created_after.strftime(
1652
+ self.api_client.configuration.datetime_format
1653
+ ),
1654
+ )
1655
+ )
1656
+ else:
1657
+ _query_params.append(("created_after", created_after))
1658
+
1659
+ if created_before is not None:
1660
+ if isinstance(created_before, datetime):
1661
+ _query_params.append(
1662
+ (
1663
+ "created_before",
1664
+ created_before.strftime(
1665
+ self.api_client.configuration.datetime_format
1666
+ ),
1667
+ )
1668
+ )
1669
+ else:
1670
+ _query_params.append(("created_before", created_before))
1671
+
1672
+ if modified_after is not None:
1673
+ if isinstance(modified_after, datetime):
1674
+ _query_params.append(
1675
+ (
1676
+ "modified_after",
1677
+ modified_after.strftime(
1678
+ self.api_client.configuration.datetime_format
1679
+ ),
1680
+ )
1681
+ )
1682
+ else:
1683
+ _query_params.append(("modified_after", modified_after))
1684
+
1685
+ if modified_before is not None:
1686
+ if isinstance(modified_before, datetime):
1687
+ _query_params.append(
1688
+ (
1689
+ "modified_before",
1690
+ modified_before.strftime(
1691
+ self.api_client.configuration.datetime_format
1692
+ ),
1693
+ )
1694
+ )
1695
+ else:
1696
+ _query_params.append(("modified_before", modified_before))
1697
+
1698
+ # process the header parameters
1699
+ if x_entrystore_host is not None:
1700
+ _header_params["X-Entrystore-Host"] = x_entrystore_host
1701
+ # process the form parameters
1702
+ # process the body parameter
1703
+
1704
+ # set the HTTP header `Accept`
1705
+ if "Accept" not in _header_params:
1706
+ _header_params["Accept"] = self.api_client.select_header_accept(
1707
+ ["application/json"]
1708
+ )
1709
+
1710
+ # authentication setting
1711
+ _auth_settings: List[str] = ["auth_token", "auth_header"]
1712
+
1713
+ return self.api_client.param_serialize(
1714
+ method="GET",
1715
+ resource_path="/terminology",
1716
+ path_params=_path_params,
1717
+ query_params=_query_params,
1718
+ header_params=_header_params,
1719
+ body=_body_params,
1720
+ post_params=_form_params,
1721
+ files=_files,
1722
+ auth_settings=_auth_settings,
1723
+ collection_formats=_collection_formats,
1724
+ _host=_host,
1725
+ _request_auth=_request_auth,
1726
+ )