Skip to main content

Ontology Concept Modeling

The Ontology workspace lets you design concept models -- the essential entities, relationships, and properties of a domain -- as RDF knowledge graphs of Subject-Predicate-Object triples. Each ontology is a standard, self-contained Turtle file you can version, share, and open in any RDF tool.

The feature is opt-in and off by default. Turn it on with ONTOLOGY_ENABLED=true.

Enabling it

ONTOLOGY_ENABLED=true
# optional: where the ontology files live (created on demand)
ONTOLOGY_DIR=.ontologies

When enabled, a network icon appears in the sidebar footer (next to the Declarative Agents icon). It opens a full-screen workspace with three freely resizable panes.

The workspace

  • Left -- catalog. Your ontologies, each with a name and a description (write a good description: it is how the assistant picks the right ontology). Create a new one, rename it (name and description, in place -- the ontology and its graph are preserved), import an RDF file (Turtle .ttl or RDF/XML .rdf/.owl), export as Turtle, or delete (with a confirmation, a progress indicator, and a backup kept on disk).
  • Center -- design canvas. Entities are two-ring circles: drag the inner circle to move the node, and start or end a relationship anywhere on the outer ring -- a full 360°, so connections attach from any direction and follow the nodes as you move them. Edges are directional with a cardinality -- 1:1, 1:N, N:1, or N:M. When two or more relationships connect the same pair of entities they fan out along separate curves (each individually selectable, with its own label); a relationship from an entity to itself draws as a loop. Clicking an entity also lights up its incoming / outgoing relationships and the connected entities (clicking a relationship lights up its endpoints and their edges); click an empty area to clear. Drag from one node to another to create a relationship. Pan and zoom, fit to view, one-click auto-layout, and download the graph as a PNG.
  • Right -- Detail / Search. Detail edits the selected entity or relationship; each entity property can be marked as a key attribute (a key badge appears on the node). Search runs SPARQL (syntax-highlighted editor, with a Reset button that restores the default query) or a natural-language question -- the send button converts it to SPARQL via the model and puts the generated query in the editor so you can refine it. Table results highlight the matching entities on the canvas in strong color while everything else dims, with connected relationships re-colored.

Saving writes a timestamped backup before atomically replacing the file, and closing with unsaved changes asks for confirmation first.

Ask the assistant

In any chat, the assistant can use the query_ontology tool: it lists your catalog, picks the right ontology from your descriptions, converts your question into a read-only SPARQL query, and answers with the matching RDF in a fenced Turtle block -- capped in size so a large ontology never floods the conversation.

Everything on the query side is read-only by construction: searches and assistant queries can never modify your ontologies.

Settings

SettingDefaultMeaning
ONTOLOGY_ENABLEDfalseMaster gate for the whole feature
ONTOLOGY_DIR.ontologiesFolder holding the catalog + Turtle files
ONTOLOGY_MAX_FILE_BYTES10485760Import/save size cap (10 MiB)
ONTOLOGY_TOOL_MAX_TRIPLES200Cap on triples in an assistant answer

The natural-language-to-SPARQL model is assigned in the Model Offering Catalog under Model Settings -> Task model assignments (roles.ontology_nl, or chatwalaau models role set ontology_nl <offering-id>); leave it unset to use the default model. The dedicated ONTOLOGY_NL_MODEL variable was removed in v0.109.0.