Query Local Ontology
query_local_ontologyRun SPARQL SELECT queries directly on ontology files stored locally or uploaded to the server, enabling precise data extraction from RDF vocabularies and models.
Instructions
Execute a SPARQL SELECT query against an ontology available on the server filesystem or through HTTP upload.
Quale modalita di input usare:
stdio / stessa macchina →
file_pathserver remoto, file grande →
get_upload_instructions+upload_idserver remoto, file piccolo (<1 MB) → usa
inspect_local_ontologyconcontent + formatper l'analisi; per query ripetute preferisci upload +upload_id
Args (provide exactly one of file_path or upload_id):
file_path: Absolute path on the MCP server filesystem. Use only if the server can really read that path.
upload_id: UUID returned by POST /upload. Use this in HTTP/remote mode when the file is local to the client, not the server.
query: SPARQL SELECT query
inject_prefixes: Inject standard prefixes (rdf, rdfs, owl, skos, dct…) — default true
Important for remote MCP servers:
If a direct file path is not accessible from the server, do not keep retrying with alternative local paths.
Call
get_upload_instructionswith the file path, execute the returned curl command via Bash tool (do NOT read the file first), then use the upload_id here.Never relay the file content through the conversation — this wastes tokens. curl sends bytes directly from disk to server.
Returns:
Compressed SPARQL results (tabular for >5 rows, compact for ≤5 rows)
When to use this vs X:
vs
query_sparql: use this for a local/uploaded ontology; usequery_sparqlfor the default remote catalogvs
query_uploaded_store: prefer this tool when you already have anupload_id;query_uploaded_storeis only a thinner upload-specific path
Do not use this if:
you need a standard profile of a concept or property → use
inspect_local_conceptorinspect_local_propertyyou just need a summary of the ontology → use
inspect_local_ontology
Supported formats: .ttl (Turtle), .owl / .rdf (RDF/XML), .nt (N-Triples), .jsonld (JSON-LD), .graphol (Graphol XML) Efficiency: File is cached after first load; repeated queries on the same unchanged file skip re-parsing. Note: Standard prefixes (rdf, rdfs, owl, skos…) are injected automatically unless inject_prefixes=false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | SPARQL SELECT query to execute | |
| file_path | No | Absolute path to the local ontology file (local/Docker) | |
| upload_id | No | Upload UUID returned by POST /upload (HTTP mode) | |
| inject_prefixes | No | Inject standard prefixes (default: true) |