Skip to content

Codex

Install the Codex plugin from the iolanta-tech/sparqld GitHub marketplace:

codex plugin marketplace add iolanta-tech/sparqld --ref main
codex plugin add sparqld@sparqld-development

Start a new Codex thread and invoke @sparqld. Give it the absolute path to your knowledge base. When it asks, approve the local MCP configuration. Codex gives each knowledge base a separate server name, such as sparqld-iolanta.

Open another new thread after registration. Use the query tool from that server to run read-only SPARQL; edit source files to change data.

With the example dataset configured through the installed plugin, this Codex session used its query tool to find the recorded planets and moons:

Youuser.prompt

Use the installed sparqld plugin and configured sparqld MCP server. Using only its query tool for knowledge-base facts, answer: Which planets does Alpha Centauri have, and which of their moons are habitable? Do not inspect source documents, skills, or memory. Do not modify files. In your final response, give a concise answer and the SPARQL queries used.

Codexcodex.response

Alpha Centauri’s recorded planets are Proxima Centauri b and Proxima Centauri d. The knowledge base records no moons for either, so none are identified as habitable. It describes Proxima Centauri b itself as orbiting in the habitable zone.

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX schema: <https://schema.org/>

SELECT DISTINCT ?planetName ?description WHERE {
  <http://dbpedia.org/resource/Alpha_Centauri> schema:hasPart ?binary .
  ?star dbp:star ?binary .
  ?planet a dbo:Planet ; dbp:star ?star ; schema:name ?planetName .
  OPTIONAL { ?planet schema:description ?description }
}
ORDER BY ?planetName
SELECT DISTINCT ?s ?p ?o WHERE {
  ?s ?p ?o .
  FILTER(
    CONTAINS(LCASE(STR(?s)), "moon") ||
    CONTAINS(LCASE(STR(?p)), "moon") ||
    CONTAINS(LCASE(STR(?o)), "moon") ||
    CONTAINS(LCASE(STR(?o)), "habitable")
  )
}
ORDER BY ?s ?p ?o