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.
- entryscape/__init__.py +219 -0
- entryscape/api/__init__.py +26 -0
- entryscape/api/app_token_api.py +835 -0
- entryscape/api/auth_api.py +965 -0
- entryscape/api/catalog_api.py +4473 -0
- entryscape/api/contact_api.py +3135 -0
- entryscape/api/dataservice_api.py +3135 -0
- entryscape/api/dataset_api.py +3804 -0
- entryscape/api/distribution_api.py +3135 -0
- entryscape/api/document_api.py +2740 -0
- entryscape/api/idea_api.py +2740 -0
- entryscape/api/job_api.py +360 -0
- entryscape/api/model_api.py +2446 -0
- entryscape/api/model_class_api.py +2611 -0
- entryscape/api/model_diagram_api.py +2611 -0
- entryscape/api/model_field_api.py +2611 -0
- entryscape/api/model_form_api.py +2611 -0
- entryscape/api/model_namespace_api.py +2611 -0
- entryscape/api/model_property_api.py +2611 -0
- entryscape/api/organization_api.py +3135 -0
- entryscape/api/search_api.py +1513 -0
- entryscape/api/showcase_api.py +2740 -0
- entryscape/api/suggestion_api.py +2740 -0
- entryscape/api/terminology_api.py +1726 -0
- entryscape/api/upload_api.py +814 -0
- entryscape/api_client.py +763 -0
- entryscape/api_response.py +20 -0
- entryscape/configuration.py +673 -0
- entryscape/exceptions.py +222 -0
- entryscape/models/__init__.py +71 -0
- entryscape/models/app_token.py +156 -0
- entryscape/models/app_token_create_request.py +98 -0
- entryscape/models/app_token_create_response.py +169 -0
- entryscape/models/app_token_status.py +35 -0
- entryscape/models/app_token_verify_request.py +109 -0
- entryscape/models/entity_list_item.py +175 -0
- entryscape/models/entity_list_response.py +139 -0
- entryscape/models/entity_reference.py +189 -0
- entryscape/models/entity_type.py +57 -0
- entryscape/models/error.py +135 -0
- entryscape/models/facet_field.py +115 -0
- entryscape/models/facet_field_values_inner.py +100 -0
- entryscape/models/facet_list.py +113 -0
- entryscape/models/facet_list_available_inner.py +107 -0
- entryscape/models/job_response.py +112 -0
- entryscape/models/job_status.py +189 -0
- entryscape/models/job_status_progress.py +100 -0
- entryscape/models/job_status_value.py +37 -0
- entryscape/models/job_type.py +37 -0
- entryscape/models/list_catalogs_entry_type_parameter.py +37 -0
- entryscape/models/list_catalogs_graph_type_parameter.py +44 -0
- entryscape/models/list_catalogs_resource_type_parameter.py +37 -0
- entryscape/models/login_request.py +108 -0
- entryscape/models/login_response.py +115 -0
- entryscape/models/metadata_format.py +38 -0
- entryscape/models/metadata_request.py +99 -0
- entryscape/models/parent_reference.py +130 -0
- entryscape/models/search_request.py +158 -0
- entryscape/models/search_request_filters.py +144 -0
- entryscape/models/search_request_filters_graph_type.py +44 -0
- entryscape/models/search_request_filters_resource_type.py +37 -0
- entryscape/models/search_request_sort.py +38 -0
- entryscape/models/search_request_sort_order.py +35 -0
- entryscape/models/search_response.py +175 -0
- entryscape/models/search_result.py +175 -0
- entryscape/models/search_result_graph_type.py +44 -0
- entryscape/models/search_result_resource_type.py +37 -0
- entryscape/models/search_sort_order_parameter.py +35 -0
- entryscape/models/terminology_import_mode.py +35 -0
- entryscape/models/validation_profile.py +36 -0
- entryscape/models/validation_response.py +149 -0
- entryscape/models/validation_result.py +162 -0
- entryscape/models/validation_severity.py +36 -0
- entryscape/models/validation_summary.py +122 -0
- entryscape/models/whoami_response.py +104 -0
- entryscape/py.typed +0 -0
- entryscape/rest.py +210 -0
- entryscape-1.3.0.dist-info/METADATA +696 -0
- entryscape-1.3.0.dist-info/RECORD +82 -0
- entryscape-1.3.0.dist-info/WHEEL +5 -0
- entryscape-1.3.0.dist-info/licenses/LICENSE.txt +165 -0
- entryscape-1.3.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EntryScape API
|
|
5
|
+
|
|
6
|
+
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
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.3.0
|
|
9
|
+
Contact: contact@entryscape.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from entryscape.models.entity_list_item import EntityListItem
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class EntityListResponse(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
A paginated list response for entity listings. This is the standard response structure for GET /{entity} list endpoints.
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
|
|
34
|
+
offset: Annotated[int, Field(strict=True, ge=0)] = Field(
|
|
35
|
+
description="Number of resources to skip before returning results (for pagination)"
|
|
36
|
+
)
|
|
37
|
+
limit: Annotated[int, Field(le=100, strict=True, ge=1)] = Field(
|
|
38
|
+
description="Maximum number of resources to return in the response"
|
|
39
|
+
)
|
|
40
|
+
results: Annotated[int, Field(strict=True, ge=0)] = Field(
|
|
41
|
+
description="Total number of results available for this query"
|
|
42
|
+
)
|
|
43
|
+
items: Annotated[List[EntityListItem], Field(max_length=100)] = Field(
|
|
44
|
+
description="The list of entities"
|
|
45
|
+
)
|
|
46
|
+
next_cursor: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field(
|
|
47
|
+
default=None,
|
|
48
|
+
description="Opaque cursor token for fetching the next page. Pass this value as the `cursor` query parameter in the next request. Always present, and `null` when there is no next page — so paging can read one field rather than test for its absence. It is the only field in a response that is sent when empty; every other optional field is omitted when it has no value. ",
|
|
49
|
+
)
|
|
50
|
+
__properties: ClassVar[List[str]] = [
|
|
51
|
+
"offset",
|
|
52
|
+
"limit",
|
|
53
|
+
"results",
|
|
54
|
+
"items",
|
|
55
|
+
"next_cursor",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
model_config = ConfigDict(
|
|
59
|
+
validate_by_name=True,
|
|
60
|
+
validate_by_alias=True,
|
|
61
|
+
validate_assignment=True,
|
|
62
|
+
protected_namespaces=(),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
def to_str(self) -> str:
|
|
66
|
+
"""Returns the string representation of the model using alias"""
|
|
67
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
68
|
+
|
|
69
|
+
def to_json(self) -> str:
|
|
70
|
+
"""Returns the JSON representation of the model using alias"""
|
|
71
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of EntityListResponse from a JSON string"""
|
|
76
|
+
return cls.from_dict(json.loads(json_str))
|
|
77
|
+
|
|
78
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
79
|
+
"""Return the dictionary representation of the model using alias.
|
|
80
|
+
|
|
81
|
+
This has the following differences from calling pydantic's
|
|
82
|
+
`self.model_dump(by_alias=True)`:
|
|
83
|
+
|
|
84
|
+
* `None` is only added to the output dict for nullable fields that
|
|
85
|
+
were set at model initialization. Other fields with value `None`
|
|
86
|
+
are ignored.
|
|
87
|
+
"""
|
|
88
|
+
excluded_fields: Set[str] = set([])
|
|
89
|
+
|
|
90
|
+
_dict = self.model_dump(
|
|
91
|
+
by_alias=True,
|
|
92
|
+
exclude=excluded_fields,
|
|
93
|
+
exclude_none=True,
|
|
94
|
+
)
|
|
95
|
+
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
|
96
|
+
_items = []
|
|
97
|
+
if self.items:
|
|
98
|
+
for _item_items in self.items:
|
|
99
|
+
if _item_items:
|
|
100
|
+
_items.append(_item_items.to_dict())
|
|
101
|
+
_dict["items"] = _items
|
|
102
|
+
# set to None if next_cursor (nullable) is None
|
|
103
|
+
# and model_fields_set contains the field
|
|
104
|
+
if self.next_cursor is None and "next_cursor" in self.model_fields_set:
|
|
105
|
+
_dict["next_cursor"] = None
|
|
106
|
+
|
|
107
|
+
return _dict
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
111
|
+
"""Create an instance of EntityListResponse from a dict"""
|
|
112
|
+
if obj is None:
|
|
113
|
+
return None
|
|
114
|
+
|
|
115
|
+
if not isinstance(obj, dict):
|
|
116
|
+
return cls.model_validate(obj)
|
|
117
|
+
|
|
118
|
+
# raise errors for additional fields in the input
|
|
119
|
+
for _key in obj.keys():
|
|
120
|
+
if _key not in cls.__properties:
|
|
121
|
+
raise ValueError(
|
|
122
|
+
"Error due to additional fields (not defined in EntityListResponse) in the input: "
|
|
123
|
+
+ _key
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
_obj = cls.model_validate(
|
|
127
|
+
{
|
|
128
|
+
"offset": obj.get("offset") if obj.get("offset") is not None else 0,
|
|
129
|
+
"limit": obj.get("limit") if obj.get("limit") is not None else 10,
|
|
130
|
+
"results": obj.get("results"),
|
|
131
|
+
"items": (
|
|
132
|
+
[EntityListItem.from_dict(_item) for _item in obj["items"]]
|
|
133
|
+
if obj.get("items") is not None
|
|
134
|
+
else None
|
|
135
|
+
),
|
|
136
|
+
"next_cursor": obj.get("next_cursor"),
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
return _obj
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EntryScape API
|
|
5
|
+
|
|
6
|
+
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
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.3.0
|
|
9
|
+
Contact: contact@entryscape.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from entryscape.models.entity_type import EntityType
|
|
25
|
+
from entryscape.models.parent_reference import ParentReference
|
|
26
|
+
from entryscape.models.validation_response import ValidationResponse
|
|
27
|
+
from typing import Optional, Set
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
from pydantic_core import to_jsonable_python
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class EntityReference(BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
A reference to an entity in EntryStore with basic identification and metadata. This is the standard response structure for GET /{entity}/{context_id}/{entry_id} endpoints.
|
|
35
|
+
""" # noqa: E501
|
|
36
|
+
|
|
37
|
+
context_id: Annotated[str, Field(strict=True)] = Field(
|
|
38
|
+
description="Context identifier generated by EntryStore. While typically numeric, treated as an opaque string."
|
|
39
|
+
)
|
|
40
|
+
entry_id: Annotated[str, Field(strict=True)] = Field(
|
|
41
|
+
description="Entry identifier generated by EntryStore. While typically numeric, treated as an opaque string."
|
|
42
|
+
)
|
|
43
|
+
entity_type: EntityType
|
|
44
|
+
uri: StrictStr = Field(
|
|
45
|
+
description="Resource URI of the entry, of the form `{store}/{context}/resource/{entry}`. This is the URI the entry is known by in RDF: what its own metadata graph describes, what another entry's metadata links to with `dcat:dataset`, `dcat:distribution` or `dcterms:publisher`, and what the upload operations take as their `resourceURI`. For harvested entries it is the external resource URI, not a URI on this EntryStore instance. "
|
|
46
|
+
)
|
|
47
|
+
created: Optional[datetime] = Field(
|
|
48
|
+
default=None, description="When the entry was created"
|
|
49
|
+
)
|
|
50
|
+
modified: Optional[datetime] = Field(
|
|
51
|
+
default=None, description="When the entry was last modified"
|
|
52
|
+
)
|
|
53
|
+
parent: Optional[ParentReference] = Field(
|
|
54
|
+
default=None,
|
|
55
|
+
description="Reference to the parent entity in the DCAT-AP hierarchy. For datasets, this is the containing catalog. For distributions, this is the containing dataset. ",
|
|
56
|
+
)
|
|
57
|
+
validation: Optional[ValidationResponse] = Field(
|
|
58
|
+
default=None,
|
|
59
|
+
description="Write-time validation report against the domain's custom SHACL shapes. Only present on create responses when the domain has custom validation configured and the report contains warning or info results. Violations never appear here — they block the write with a 422 response instead. ",
|
|
60
|
+
)
|
|
61
|
+
__properties: ClassVar[List[str]] = [
|
|
62
|
+
"context_id",
|
|
63
|
+
"entry_id",
|
|
64
|
+
"entity_type",
|
|
65
|
+
"uri",
|
|
66
|
+
"created",
|
|
67
|
+
"modified",
|
|
68
|
+
"parent",
|
|
69
|
+
"validation",
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
@field_validator("context_id")
|
|
73
|
+
def context_id_validate_regular_expression(cls, value):
|
|
74
|
+
"""Validates the regular expression"""
|
|
75
|
+
if not isinstance(value, str):
|
|
76
|
+
value = str(value)
|
|
77
|
+
|
|
78
|
+
if not re.match(r"^[a-zA-Z0-9._~-]+$", value):
|
|
79
|
+
raise ValueError(
|
|
80
|
+
r"must validate the regular expression /^[a-zA-Z0-9._~-]+$/"
|
|
81
|
+
)
|
|
82
|
+
return value
|
|
83
|
+
|
|
84
|
+
@field_validator("entry_id")
|
|
85
|
+
def entry_id_validate_regular_expression(cls, value):
|
|
86
|
+
"""Validates the regular expression"""
|
|
87
|
+
if not isinstance(value, str):
|
|
88
|
+
value = str(value)
|
|
89
|
+
|
|
90
|
+
if not re.match(r"^[a-zA-Z0-9._~-]+$", value):
|
|
91
|
+
raise ValueError(
|
|
92
|
+
r"must validate the regular expression /^[a-zA-Z0-9._~-]+$/"
|
|
93
|
+
)
|
|
94
|
+
return value
|
|
95
|
+
|
|
96
|
+
model_config = ConfigDict(
|
|
97
|
+
validate_by_name=True,
|
|
98
|
+
validate_by_alias=True,
|
|
99
|
+
validate_assignment=True,
|
|
100
|
+
protected_namespaces=(),
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
def to_str(self) -> str:
|
|
104
|
+
"""Returns the string representation of the model using alias"""
|
|
105
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
106
|
+
|
|
107
|
+
def to_json(self) -> str:
|
|
108
|
+
"""Returns the JSON representation of the model using alias"""
|
|
109
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
110
|
+
|
|
111
|
+
@classmethod
|
|
112
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
113
|
+
"""Create an instance of EntityReference from a JSON string"""
|
|
114
|
+
return cls.from_dict(json.loads(json_str))
|
|
115
|
+
|
|
116
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
117
|
+
"""Return the dictionary representation of the model using alias.
|
|
118
|
+
|
|
119
|
+
This has the following differences from calling pydantic's
|
|
120
|
+
`self.model_dump(by_alias=True)`:
|
|
121
|
+
|
|
122
|
+
* `None` is only added to the output dict for nullable fields that
|
|
123
|
+
were set at model initialization. Other fields with value `None`
|
|
124
|
+
are ignored.
|
|
125
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
126
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
127
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
128
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
129
|
+
"""
|
|
130
|
+
excluded_fields: Set[str] = set(
|
|
131
|
+
[
|
|
132
|
+
"uri",
|
|
133
|
+
"created",
|
|
134
|
+
"modified",
|
|
135
|
+
"validation",
|
|
136
|
+
]
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
_dict = self.model_dump(
|
|
140
|
+
by_alias=True,
|
|
141
|
+
exclude=excluded_fields,
|
|
142
|
+
exclude_none=True,
|
|
143
|
+
)
|
|
144
|
+
# override the default output from pydantic by calling `to_dict()` of parent
|
|
145
|
+
if self.parent:
|
|
146
|
+
_dict["parent"] = self.parent.to_dict()
|
|
147
|
+
# override the default output from pydantic by calling `to_dict()` of validation
|
|
148
|
+
if self.validation:
|
|
149
|
+
_dict["validation"] = self.validation.to_dict()
|
|
150
|
+
return _dict
|
|
151
|
+
|
|
152
|
+
@classmethod
|
|
153
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
154
|
+
"""Create an instance of EntityReference from a dict"""
|
|
155
|
+
if obj is None:
|
|
156
|
+
return None
|
|
157
|
+
|
|
158
|
+
if not isinstance(obj, dict):
|
|
159
|
+
return cls.model_validate(obj)
|
|
160
|
+
|
|
161
|
+
# raise errors for additional fields in the input
|
|
162
|
+
for _key in obj.keys():
|
|
163
|
+
if _key not in cls.__properties:
|
|
164
|
+
raise ValueError(
|
|
165
|
+
"Error due to additional fields (not defined in EntityReference) in the input: "
|
|
166
|
+
+ _key
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
_obj = cls.model_validate(
|
|
170
|
+
{
|
|
171
|
+
"context_id": obj.get("context_id"),
|
|
172
|
+
"entry_id": obj.get("entry_id"),
|
|
173
|
+
"entity_type": obj.get("entity_type"),
|
|
174
|
+
"uri": obj.get("uri"),
|
|
175
|
+
"created": obj.get("created"),
|
|
176
|
+
"modified": obj.get("modified"),
|
|
177
|
+
"parent": (
|
|
178
|
+
ParentReference.from_dict(obj["parent"])
|
|
179
|
+
if obj.get("parent") is not None
|
|
180
|
+
else None
|
|
181
|
+
),
|
|
182
|
+
"validation": (
|
|
183
|
+
ValidationResponse.from_dict(obj["validation"])
|
|
184
|
+
if obj.get("validation") is not None
|
|
185
|
+
else None
|
|
186
|
+
),
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
return _obj
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EntryScape API
|
|
5
|
+
|
|
6
|
+
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
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.3.0
|
|
9
|
+
Contact: contact@entryscape.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class EntityType(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
The entity type classification. Includes DCAT 3 types and EntryScape extensions: - Agent: An entity responsible for making resources available - Catalog: A curated collection of metadata about datasets and data services - Class: An RDF Schema class defined in an EntryScape Models model (rdfs:Class) - ContactPoint: Contact information for a resource - Dataset: A collection of data published or curated by a single agent - DataService: A collection of operations accessible through an API providing access to datasets - DatasetSeries: A collection of datasets published separately but sharing characteristics - Diagram: A diagram in an EntryScape Models model (esterms:Diagram) - Distribution: An accessible form of a dataset such as a downloadable file - Document: A general document resource (foaf:Document) - Field: An RDForms field defined in an EntryScape Models model (rdforms:Field) - Form: An RDForms form defined in an EntryScape Models model (rdforms:Form) - Idea: A user-submitted idea for new or improved data (esc:Idea) - Model: An EntryScape Models application-profile context (esc:FormsContext) - Namespace: A SHACL prefix declaration in an EntryScape Models model (sh:PrefixDeclaration) - Property: An RDF property defined in an EntryScape Models model (rdf:Property) - Relationship: A qualified relation between DCAT resources - Resource: Abstract parent class for cataloged items (not used directly) - ResourceDescriptor: A PROF resource descriptor in an EntryScape Models specification (prof:ResourceDescriptor) - Role: A function of an entity or agent with respect to another resource - Showcase: A showcase of how data is used or reused (esc:Result) - Specification: A PROF specification in an EntryScape Models model (prof:Profile + dcterms:Standard) - Suggestion: A user suggestion for data improvements (esc:Suggestion) - Terminology: A SKOS terminology context provisioned by a terminology import (es:TerminologyContext)
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
Agent = "Agent"
|
|
30
|
+
Catalog = "Catalog"
|
|
31
|
+
Class = "Class"
|
|
32
|
+
ContactPoint = "ContactPoint"
|
|
33
|
+
Dataset = "Dataset"
|
|
34
|
+
DataService = "DataService"
|
|
35
|
+
DatasetSeries = "DatasetSeries"
|
|
36
|
+
Diagram = "Diagram"
|
|
37
|
+
Distribution = "Distribution"
|
|
38
|
+
Document = "Document"
|
|
39
|
+
Field = "Field"
|
|
40
|
+
Form = "Form"
|
|
41
|
+
Idea = "Idea"
|
|
42
|
+
Model = "Model"
|
|
43
|
+
Namespace = "Namespace"
|
|
44
|
+
Property = "Property"
|
|
45
|
+
Relationship = "Relationship"
|
|
46
|
+
Resource = "Resource"
|
|
47
|
+
ResourceDescriptor = "ResourceDescriptor"
|
|
48
|
+
Role = "Role"
|
|
49
|
+
Showcase = "Showcase"
|
|
50
|
+
Specification = "Specification"
|
|
51
|
+
Suggestion = "Suggestion"
|
|
52
|
+
Terminology = "Terminology"
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Self:
|
|
56
|
+
"""Create an instance of EntityType from a JSON string"""
|
|
57
|
+
return cls(json.loads(json_str))
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
EntryScape API
|
|
5
|
+
|
|
6
|
+
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
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.3.0
|
|
9
|
+
Contact: contact@entryscape.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Error(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
Standard error response returned by API when a request fails.
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
|
|
34
|
+
error: Annotated[str, Field(min_length=1, strict=True, max_length=256)] = Field(
|
|
35
|
+
description="Error type/name"
|
|
36
|
+
)
|
|
37
|
+
message: Annotated[str, Field(min_length=1, strict=True, max_length=2000)] = Field(
|
|
38
|
+
description="Detailed error message"
|
|
39
|
+
)
|
|
40
|
+
code: Annotated[int, Field(le=599, strict=True, ge=100)] = Field(
|
|
41
|
+
description="HTTP status code"
|
|
42
|
+
)
|
|
43
|
+
timestamp: Optional[datetime] = Field(
|
|
44
|
+
default=None, description="When the error occurred"
|
|
45
|
+
)
|
|
46
|
+
path: Optional[
|
|
47
|
+
Annotated[str, Field(min_length=1, strict=True, max_length=1000)]
|
|
48
|
+
] = Field(default=None, description="Request path that failed")
|
|
49
|
+
__properties: ClassVar[List[str]] = [
|
|
50
|
+
"error",
|
|
51
|
+
"message",
|
|
52
|
+
"code",
|
|
53
|
+
"timestamp",
|
|
54
|
+
"path",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
model_config = ConfigDict(
|
|
58
|
+
validate_by_name=True,
|
|
59
|
+
validate_by_alias=True,
|
|
60
|
+
validate_assignment=True,
|
|
61
|
+
protected_namespaces=(),
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
def to_str(self) -> str:
|
|
65
|
+
"""Returns the string representation of the model using alias"""
|
|
66
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
67
|
+
|
|
68
|
+
def to_json(self) -> str:
|
|
69
|
+
"""Returns the JSON representation of the model using alias"""
|
|
70
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of Error from a JSON string"""
|
|
75
|
+
return cls.from_dict(json.loads(json_str))
|
|
76
|
+
|
|
77
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
78
|
+
"""Return the dictionary representation of the model using alias.
|
|
79
|
+
|
|
80
|
+
This has the following differences from calling pydantic's
|
|
81
|
+
`self.model_dump(by_alias=True)`:
|
|
82
|
+
|
|
83
|
+
* `None` is only added to the output dict for nullable fields that
|
|
84
|
+
were set at model initialization. Other fields with value `None`
|
|
85
|
+
are ignored.
|
|
86
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
87
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
88
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
89
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
90
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
91
|
+
"""
|
|
92
|
+
excluded_fields: Set[str] = set(
|
|
93
|
+
[
|
|
94
|
+
"error",
|
|
95
|
+
"message",
|
|
96
|
+
"code",
|
|
97
|
+
"timestamp",
|
|
98
|
+
"path",
|
|
99
|
+
]
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
_dict = self.model_dump(
|
|
103
|
+
by_alias=True,
|
|
104
|
+
exclude=excluded_fields,
|
|
105
|
+
exclude_none=True,
|
|
106
|
+
)
|
|
107
|
+
return _dict
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
111
|
+
"""Create an instance of Error from a dict"""
|
|
112
|
+
if obj is None:
|
|
113
|
+
return None
|
|
114
|
+
|
|
115
|
+
if not isinstance(obj, dict):
|
|
116
|
+
return cls.model_validate(obj)
|
|
117
|
+
|
|
118
|
+
# raise errors for additional fields in the input
|
|
119
|
+
for _key in obj.keys():
|
|
120
|
+
if _key not in cls.__properties:
|
|
121
|
+
raise ValueError(
|
|
122
|
+
"Error due to additional fields (not defined in Error) in the input: "
|
|
123
|
+
+ _key
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
_obj = cls.model_validate(
|
|
127
|
+
{
|
|
128
|
+
"error": obj.get("error"),
|
|
129
|
+
"message": obj.get("message"),
|
|
130
|
+
"code": obj.get("code"),
|
|
131
|
+
"timestamp": obj.get("timestamp"),
|
|
132
|
+
"path": obj.get("path"),
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
return _obj
|