dss-ai-tools 0.4.0__tar.gz

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.
@@ -0,0 +1,19 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ venv/
6
+ *.egg-info/
7
+ build/
8
+ dist/
9
+
10
+ # Env / secrets
11
+ .env
12
+ *.env
13
+
14
+ # OS
15
+ .DS_Store
16
+
17
+ # Editor
18
+ .idea/
19
+ .vscode/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Institute of Mathematics and Computer Science, University of Latvia (IMCS)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: dss-ai-tools
3
+ Version: 0.4.0
4
+ Summary: Command-line client for exploring a Data Shape Server (DSS) knowledge-graph schemas.
5
+ Project-URL: Homepage, https://github.com/LUMII-Syslab/dss-ai-tools
6
+ Project-URL: Repository, https://github.com/LUMII-Syslab/dss-ai-tools
7
+ Author: Institute of Mathematics and Computer Science, University of Latvia (IMCS)
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Keywords: claude,data-shape-server,dss,knowledge-graphs,mcp,rdf,sparql
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Classifier: Topic :: Utilities
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+
21
+ # dss-ai-tools
22
+
23
+ Tools for exploring a [Data Shape Server (DSS)](https://github.com/LUMII-Syslab/data-shape-server) knowledge-graph schema — classes, properties, their relations, and namespaces — over the DSS HTTP API. Three ways to use it, all sharing one small client:
24
+
25
+ | Component | What it is | Where |
26
+ | --- | --- | --- |
27
+ | **CLI** | A single-file Python client (`dss`), standard library only, Python ≥ 3.9. | [`dss.py`](dss.py) |
28
+ | **Claude skill** | A self-contained Claude Code skill that drives the CLI. | [`skill/`](skill/) |
29
+ | **MCP server** | An [MCP](https://modelcontextprotocol.io) server exposing the same endpoints as tools. | [`mcp-server/`](mcp-server/) |
30
+
31
+ The CLI is the source of truth; the skill and MCP server bundle a copy of `dss.py` so each is self-contained. Run [`scripts/sync.sh`](scripts/sync.sh) after editing the canonical `dss.py` to refresh the copies.
32
+
33
+ ## Configure
34
+
35
+ All three read the same environment variables:
36
+
37
+ ```bash
38
+ export DSS_BASE_URL=https://dss.semtech.lv # default
39
+ export DSS_TIMEOUT=30 # optional, seconds
40
+ ```
41
+
42
+ The CLI and MCP tools also accept a per-call override (`--base-url` / `base_url`).
43
+
44
+ ## CLI
45
+
46
+ ```bash
47
+ python3 dss.py --help
48
+ ```
49
+
50
+ Install on your PATH (optional):
51
+
52
+ ```bash
53
+ pipx install . # provides the `dss` command (see pyproject.toml)
54
+ # or, no packaging:
55
+ ln -s "$(pwd)/dss.py" ~/.local/bin/dss && chmod +x dss.py
56
+ ```
57
+
58
+ ### Commands
59
+
60
+ | Command | DSS endpoint |
61
+ | --- | --- |
62
+ | `ontologies [--variant ...] [--tag TAG]` | `GET /api/info` (variants `2`–`5`, `tags`; `--tag` with variant `3`) |
63
+ | `schema-tags` | `GET /api/schema_tags` |
64
+ | `public-ns` | `GET /api/public_ns` |
65
+ | `namespaces <ont>` | `GET /api/ontologies/<ont>/ns` |
66
+ | `classes <ont> [--limit N] [--filter STR]` | `POST .../getClasses` |
67
+ | `properties <ont> [--limit N] [--filter REGEX] [--kind ...]` | `POST .../getProperties` |
68
+ | `resolve-class <ont> <name>` | `POST .../resolveClassByName` |
69
+ | `resolve-property <ont> <name>` | `POST .../resolvePropertyByName` |
70
+ | `class-out-properties <ont> <class_id> [--limit N]` | `POST .../xx_getClassOutProperties` (by `c_id`) |
71
+ | `class-in-properties <ont> <class_id> [--limit N]` | `POST .../xx_getClassInProperties` (by `c_id`) |
72
+ | `class-pairs <ont> <p_list>` | `POST .../xx_getCPCInfoNew` — (source, target) class pairs for a property |
73
+ | `call <ont> <fn> [--body JSON\|-] [--param k=v ...]` | `POST .../<fn>` (escape hatch) |
74
+
75
+ The `class-*` commands key on numeric ids: get a class id from `resolve-class` and a property id from `resolve-property`.
76
+
77
+ Output is indented JSON by default; pass `--compact` for single-line (pipe-friendly).
78
+
79
+ ```bash
80
+ dss ontologies | jq '.[].db_schema_name'
81
+ dss classes dbpedia --filter Person --limit 20
82
+ dss resolve-property dbpedia dbo:birthPlace
83
+ dss class-pairs war_sampo 116
84
+ ```
85
+
86
+ ## Claude skill
87
+
88
+ `skill/` is a self-contained Claude Code skill. Install it user-level:
89
+
90
+ ```bash
91
+ mkdir -p ~/.claude/skills
92
+ cp -R skill ~/.claude/skills/dss
93
+ ```
94
+
95
+ See [`docs/USAGE.md`](docs/USAGE.md) for setup, pointing it at a server, and example prompts.
96
+
97
+ ## MCP server
98
+
99
+ See [`mcp-server/README.md`](mcp-server/README.md). In short:
100
+
101
+ ```bash
102
+ cd mcp-server
103
+ python3 -m venv .venv && source .venv/bin/activate
104
+ pip install -r requirements.txt
105
+ DSS_BASE_URL=https://dss.semtech.lv python3 dss_mcp.py
106
+ ```
107
+
108
+ ## Exit codes (CLI)
109
+
110
+ - `0` — success, JSON on stdout
111
+ - `2` — HTTP / transport / argument error, message on stderr
112
+ - `130` — interrupted (Ctrl-C)
113
+
114
+ ## License
115
+
116
+ MIT
@@ -0,0 +1,96 @@
1
+ # dss-ai-tools
2
+
3
+ Tools for exploring a [Data Shape Server (DSS)](https://github.com/LUMII-Syslab/data-shape-server) knowledge-graph schema — classes, properties, their relations, and namespaces — over the DSS HTTP API. Three ways to use it, all sharing one small client:
4
+
5
+ | Component | What it is | Where |
6
+ | --- | --- | --- |
7
+ | **CLI** | A single-file Python client (`dss`), standard library only, Python ≥ 3.9. | [`dss.py`](dss.py) |
8
+ | **Claude skill** | A self-contained Claude Code skill that drives the CLI. | [`skill/`](skill/) |
9
+ | **MCP server** | An [MCP](https://modelcontextprotocol.io) server exposing the same endpoints as tools. | [`mcp-server/`](mcp-server/) |
10
+
11
+ The CLI is the source of truth; the skill and MCP server bundle a copy of `dss.py` so each is self-contained. Run [`scripts/sync.sh`](scripts/sync.sh) after editing the canonical `dss.py` to refresh the copies.
12
+
13
+ ## Configure
14
+
15
+ All three read the same environment variables:
16
+
17
+ ```bash
18
+ export DSS_BASE_URL=https://dss.semtech.lv # default
19
+ export DSS_TIMEOUT=30 # optional, seconds
20
+ ```
21
+
22
+ The CLI and MCP tools also accept a per-call override (`--base-url` / `base_url`).
23
+
24
+ ## CLI
25
+
26
+ ```bash
27
+ python3 dss.py --help
28
+ ```
29
+
30
+ Install on your PATH (optional):
31
+
32
+ ```bash
33
+ pipx install . # provides the `dss` command (see pyproject.toml)
34
+ # or, no packaging:
35
+ ln -s "$(pwd)/dss.py" ~/.local/bin/dss && chmod +x dss.py
36
+ ```
37
+
38
+ ### Commands
39
+
40
+ | Command | DSS endpoint |
41
+ | --- | --- |
42
+ | `ontologies [--variant ...] [--tag TAG]` | `GET /api/info` (variants `2`–`5`, `tags`; `--tag` with variant `3`) |
43
+ | `schema-tags` | `GET /api/schema_tags` |
44
+ | `public-ns` | `GET /api/public_ns` |
45
+ | `namespaces <ont>` | `GET /api/ontologies/<ont>/ns` |
46
+ | `classes <ont> [--limit N] [--filter STR]` | `POST .../getClasses` |
47
+ | `properties <ont> [--limit N] [--filter REGEX] [--kind ...]` | `POST .../getProperties` |
48
+ | `resolve-class <ont> <name>` | `POST .../resolveClassByName` |
49
+ | `resolve-property <ont> <name>` | `POST .../resolvePropertyByName` |
50
+ | `class-out-properties <ont> <class_id> [--limit N]` | `POST .../xx_getClassOutProperties` (by `c_id`) |
51
+ | `class-in-properties <ont> <class_id> [--limit N]` | `POST .../xx_getClassInProperties` (by `c_id`) |
52
+ | `class-pairs <ont> <p_list>` | `POST .../xx_getCPCInfoNew` — (source, target) class pairs for a property |
53
+ | `call <ont> <fn> [--body JSON\|-] [--param k=v ...]` | `POST .../<fn>` (escape hatch) |
54
+
55
+ The `class-*` commands key on numeric ids: get a class id from `resolve-class` and a property id from `resolve-property`.
56
+
57
+ Output is indented JSON by default; pass `--compact` for single-line (pipe-friendly).
58
+
59
+ ```bash
60
+ dss ontologies | jq '.[].db_schema_name'
61
+ dss classes dbpedia --filter Person --limit 20
62
+ dss resolve-property dbpedia dbo:birthPlace
63
+ dss class-pairs war_sampo 116
64
+ ```
65
+
66
+ ## Claude skill
67
+
68
+ `skill/` is a self-contained Claude Code skill. Install it user-level:
69
+
70
+ ```bash
71
+ mkdir -p ~/.claude/skills
72
+ cp -R skill ~/.claude/skills/dss
73
+ ```
74
+
75
+ See [`docs/USAGE.md`](docs/USAGE.md) for setup, pointing it at a server, and example prompts.
76
+
77
+ ## MCP server
78
+
79
+ See [`mcp-server/README.md`](mcp-server/README.md). In short:
80
+
81
+ ```bash
82
+ cd mcp-server
83
+ python3 -m venv .venv && source .venv/bin/activate
84
+ pip install -r requirements.txt
85
+ DSS_BASE_URL=https://dss.semtech.lv python3 dss_mcp.py
86
+ ```
87
+
88
+ ## Exit codes (CLI)
89
+
90
+ - `0` — success, JSON on stdout
91
+ - `2` — HTTP / transport / argument error, message on stderr
92
+ - `130` — interrupted (Ctrl-C)
93
+
94
+ ## License
95
+
96
+ MIT
@@ -0,0 +1,94 @@
1
+ # Using the `dss` skill in Claude Code
2
+
3
+ The `skill/` folder is a self-contained Claude Code skill. Once installed, Claude can use it to explore a Data Shape Server schema on your behalf. Run the commands below from the repository root.
4
+
5
+ ## 1. Install the skill
6
+
7
+ Pick one of these.
8
+
9
+ **User-level** — available in every project:
10
+
11
+ ```bash
12
+ mkdir -p ~/.claude/skills
13
+ cp -R skill ~/.claude/skills/dss
14
+ ```
15
+
16
+ **Project-level** — only inside this repo:
17
+
18
+ ```bash
19
+ mkdir -p .claude/skills
20
+ ln -s "$(pwd)/skill" .claude/skills/dss
21
+ ```
22
+
23
+ A symlink lets edits to `skill/` take effect immediately, without recopying.
24
+
25
+ ## 2. Point it at a DSS server
26
+
27
+ The CLI reads `DSS_BASE_URL` from its environment. For the live instance:
28
+
29
+ **Shell rc (easiest):** add to `~/.zshrc`, then open a new terminal.
30
+
31
+ ```bash
32
+ export DSS_BASE_URL=http://viziquer.app:9005
33
+ ```
34
+
35
+ **Project-scoped** — in `.claude/settings.json`:
36
+
37
+ ```json
38
+ { "env": { "DSS_BASE_URL": "http://viziquer.app:9005" } }
39
+ ```
40
+
41
+ **One-off** — agent can prefix the command:
42
+
43
+ ```bash
44
+ DSS_BASE_URL=http://viziquer.app:9005 python3 ~/.claude/skills/dss/dss.py ontologies
45
+ ```
46
+
47
+ ## 3. Sanity check
48
+
49
+ ```bash
50
+ DSS_BASE_URL=http://viziquer.app:9005 \
51
+ python3 ~/.claude/skills/dss/dss.py ontologies | head
52
+ ```
53
+
54
+ You should see a JSON array of schemas (DBpedia, Wikidata, Europeana, ...). If you instead see `Cannot reach …`, the URL or network is wrong; if you see `HTTP 404`, the path prefix is wrong (the server expects `/api/...`).
55
+
56
+ ## 4. Drive it from Claude Code
57
+
58
+ Restart Claude Code so it re-scans skills, then ask things like:
59
+
60
+ - "What ontologies are loaded in DSS?"
61
+ - "List 20 classes in `dbpedia` whose name contains `Person`."
62
+ - "Resolve `dbo:birthPlace` in the `dbpedia` schema."
63
+ - "What namespaces does `wikidata` use?"
64
+ - "Get object properties in `europeana` matching `creator`."
65
+
66
+ Claude will pick up the skill from `SKILL.md` and run `python3 dss.py …` for you. Output is JSON, which Claude can then read and summarize.
67
+
68
+ ## 5. Calling the CLI directly
69
+
70
+ You can also use it as a plain command-line tool. See `README.md` for the full command reference. The most useful ones:
71
+
72
+ ```bash
73
+ dss ontologies # list schemas
74
+ dss namespaces dbpedia # prefixes
75
+ dss classes dbpedia --filter Person --limit 20
76
+ dss properties dbpedia --kind Object --filter birth
77
+ dss resolve-class dbpedia dbo:Person
78
+ dss resolve-property dbpedia dbo:birthPlace
79
+ dss call dbpedia getTreeClasses --param limit=200 --param treeMode=Top # escape hatch
80
+ ```
81
+
82
+ To get a short `dss` command on your PATH:
83
+
84
+ ```bash
85
+ ln -s ~/.claude/skills/dss/dss.py ~/.local/bin/dss
86
+ chmod +x ~/.claude/skills/dss/dss.py
87
+ ```
88
+
89
+ ## Troubleshooting
90
+
91
+ - **`Cannot reach …`** — server unreachable or DNS fails. Check `DSS_BASE_URL` and that the host is online.
92
+ - **`HTTP 400 bad ontology name`** — ontology name has characters outside `[a-zA-Z0-9_-]`.
93
+ - **`HTTP 404 unknown ontology`** — name doesn't match any `db_schema_name` from `dss ontologies`.
94
+ - **Claude doesn't seem to know the skill exists** — make sure the folder is at `~/.claude/skills/dss/` (or `.claude/skills/dss/` in the project), contains `SKILL.md`, and that you restarted Claude Code after installing.