You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,7 @@ Nota: questi tool restano utili, ma su `schema.gov.it` sono spesso secondari. Il
66
66
67
67
### 10. Ontologia Locale
68
68
*`inspect_local_ontology`: Carica e riassume un'ontologia RDF/OWL disponibile al server via `file_path`, contenuto inline o `upload_id`. Attenzione: `file_path` indica sempre un path leggibile dal server MCP, non dal laptop dell'utente.
69
+
*`inspect_local_concept`: **Deep dive con ereditarietà** su una classe o concetto in un'ontologia locale o caricata. Restituisce definizione, gerarchia, proprietà dirette (`own_properties`) e proprietà ereditate dagli antenati (`inherited_properties`, con indicazione dell'antenato di provenienza). oxigraph non fa inferenza RDFS automatica: questo tool traversa esplicitamente la catena `rdfs:subClassOf+` / `skos:broader+` per restituire il profilo completo.
69
70
*`query_local_ontology`: Esegue una query SPARQL SELECT su un'ontologia accessibile dal server o caricata prima via `POST /upload`. Prefissi standard iniettati automaticamente. Risultati compressi come gli altri tool.
70
71
*`compare_local_with_remote`: Confronta le classi/proprietà definite in un'ontologia accessibile dal server o via `upload_id` con quelle presenti in schema.gov.it — utile per scoprire cosa riusare o allineare.
71
72
@@ -291,6 +292,36 @@ Una volta configurato, puoi chiedere all'agente cose come:
291
292
**"Quali tool open source posso usare per lavorare con SKOS e OWL?"* (Userà `find_semantic_software`)
292
293
**"Cosa manca a schema.gov.it rispetto agli standard semantici internazionali del settore pubblico?"* (Userà `compare_coverage_with_okg`)
293
294
295
+
## Variabili d'Ambiente
296
+
297
+
| Variabile | Default | Descrizione |
298
+
|---|---|---|
299
+
|`MCP_TRANSPORT`|`stdio`| Modalità di trasporto. Usa `http` o `sse` per avviare il server HTTP (obbligatorio per l'upload e per l'uso remoto). |
300
+
|`PORT`|`3000`| Porta su cui il server HTTP si mette in ascolto (solo in modalità `http`/`sse`). |
301
+
|`HOST`|`0.0.0.0`| Indirizzo di bind del server HTTP. Usa `127.0.0.1` per limitare l'accesso al solo localhost. |
302
+
|`MCP_PUBLIC_URL`|_(non impostato)_| URL esterno del server, usato dal tool `get_upload_instructions` per restituire l'endpoint di upload raggiungibile dal client. Necessario quando la porta interna differisce da quella esposta (Docker, reverse proxy). Esempio: `http://localhost:8080`. |
303
+
304
+
**Esempi:**
305
+
306
+
```bash
307
+
# Avvio locale su porta 3000 con upload abilitato
308
+
MCP_TRANSPORT=http node dist/index.js
309
+
310
+
# Porta personalizzata
311
+
MCP_TRANSPORT=http PORT=8080 node dist/index.js
312
+
313
+
# Docker con port mapping 8080→3000 (porta interna 3000, esposta 8080)
314
+
docker run -d \
315
+
-e MCP_TRANSPORT=http \
316
+
-e MCP_PUBLIC_URL=http://localhost:8080 \
317
+
-p 8080:3000 \
318
+
ghcr.io/italia/dati-semantic-mcp:latest
319
+
```
320
+
321
+
> **Nota upload:** La porta HTTP (e di conseguenza `/upload`) è disponibile **solo** in modalità `http` o `sse`. In modalità `stdio` il server non espone nessuna porta; per passare file RDF usa il parametro `content` di `inspect_local_ontology` per file piccoli, oppure attiva la modalità HTTP.
322
+
323
+
---
324
+
294
325
## Note Tecniche
295
326
296
327
***Endpoint Esterni**: Usa `recommend_external_endpoints` per una lista curata (es. `lod.dati.gov.it` come possibile server SPARQL per `dati.gov.it`, `dati.cultura.gov.it`, endpoint istituzionali italiani, endpoint europei e knowledge graph pubblici) e `list_linked_endpoints` per scoprire quelli pubblicati nel catalogo via metadata DCAT.
Copy file name to clipboardExpand all lines: src/tools/group-k.ts
+113Lines changed: 113 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -144,6 +144,119 @@ server.registerTool(
144
144
}
145
145
);
146
146
147
+
server.registerTool(
148
+
"inspect_local_concept",
149
+
{
150
+
title: "Inspect Concept in Local / Uploaded Ontology",
151
+
description: `Get a full profile of a class or concept from a local or uploaded ontology, including the complete inherited property chain.
152
+
153
+
**Args (provide exactly one of file_path or upload_id):**
154
+
- uri: URI of the class/concept to inspect
155
+
- file_path: Absolute path on the MCP server filesystem
156
+
- upload_id: UUID returned by POST /upload (HTTP/remote mode)
157
+
158
+
**Returns:**
159
+
- definition: Literal annotations of the concept (rdfs:label, rdfs:comment, skos:definition…)
160
+
- hierarchy: Direct type, parent classes (rdfs:subClassOf / skos:broader), and child classes
161
+
- usage: Count of instances typed as this class in the store
162
+
- own_properties: Properties whose rdfs:domain is exactly this class
163
+
- inherited_properties: Properties inherited from ancestor classes via rdfs:subClassOf+ / skos:broader+, each annotated with the ancestor it comes from — gives the complete effective property set
164
+
- incoming: Properties whose values are instances of this type (data-level)
165
+
- outgoing: Properties used by instances of this type (data-level)
166
+
167
+
**Why this matters:** oxigraph (the local SPARQL engine) does not perform automatic RDFS inference. A plain \`?prop rdfs:domain <class>\` query will miss properties declared on parent classes. This tool traverses the ancestry explicitly using SPARQL property paths (rdfs:subClassOf+) so the result reflects the full OWL/RDFS semantics.
168
+
169
+
**Use when:** You uploaded an ontology and want to understand what a specific class really models, including everything it inherits.`,
170
+
inputSchema: {
171
+
uri: z.string().describe("URI of the class or concept to inspect"),
172
+
file_path: z.string().optional().describe("Absolute path to the ontology file on the server filesystem"),
173
+
upload_id: z.string().optional().describe("Upload UUID returned by POST /upload (HTTP mode)"),
0 commit comments