protege-mcp v0.3.2
SPARQL support for the active ontology — author, validate, and run queries. 47 → 50 tools.
New tools
sparql_query— run a SPARQL 1.1 query (SELECT/ASK/CONSTRUCT/DESCRIBE) over the active ontology and its imports closure, using an embedded Apache Jena ARQ engine. Read-only:UPDATEandSERVICEare rejected, so a query never edits the model or reaches the network. The ontology's prefixes (plus rdf/rdfs/owl/xsd) are auto-prepended, andlimitcaps the rows/triples returned. By default it sees the asserted triples (like Protégé's SPARQL Query tab); setinclude_inferred=trueto first materialise the active reasoner's inferences (runrun_reasonerfirst).sparql_schema— discover the queryable vocabulary for writing a query: the prefix map (plus a ready-to-pastePREFIXblock), classes, object/data properties (with their domains and ranges), individuals and datatypes — each with a CURIE and full IRI — plus example queries built from the ontology's own terms. Usekeywordto focus on a sub-topic.sparql_validate— check a draft query before running it (parse-only, ordry_runfor a small sample). Reports whether it parses, the query form and variables, whethersparql_querywould accept it, andunknown_terms— IRIs used in the query (graph patterns, property paths,VALUES, theCONSTRUCTtemplate,DESCRIBEtargets) that are not declared in the ontology, i.e. likely typos or terms from another vocabulary.
New prompt
author_sparql_query— guided workflow that chains the above: discover the vocabulary → draft → validate → run → iterate.
Notes
- Apache Jena ARQ is inlined into the bundle;
sparql_query/sparql_validatesnapshot the imports closure into a private throwaway ontology (never mutating the live model) and run off the EDT, so a query can neither edit the ontology nor reach the network. - Requires a Java 17+ JVM (unchanged).
Install: download protege-mcp-0.3.2.jar below, or use Protégé ▸ File ▸ Check for plugins.