Skip to main content

List Ontologies

Returns all ontologies for a project.
curl -X GET "http://localhost:8080/api/ontologies?project_id=proj-123"

Query Parameters

project_id
string
required
Filter by project ID

Response

ontologies
array
Array of ontology objects

Create Ontology

Creates a new OWL/Turtle ontology for a project.
curl -X POST http://localhost:8080/api/ontologies \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj-123",
    "name": "Manufacturing Ontology",
    "description": "Ontology for IoT sensor data",
    "version": "1.0",
    "content": "@prefix : <http://example.org/manufacturing#> .\n:Sensor a owl:Class .",
    "status": "draft"
  }'

Request Body

project_id
string
required
Project ID to associate with
name
string
required
Ontology name
description
string
Ontology description
version
string
Ontology version (defaults to “1.0”)
content
string
required
Turtle (.ttl) format content following OWL 2 specifications
status
string
Status: draft, active, or archived (defaults to draft)
is_generated
boolean
True if auto-generated (defaults to false)

Response

Returns the created ontology object.

Get Ontology

Returns a single ontology by ID.
curl -X GET http://localhost:8080/api/ontologies/onto-123

Path Parameters

id
string
required
Ontology ID

Response

Returns the ontology object (see List Ontologies for schema).

Update Ontology

Updates an ontology’s content, status, or metadata.
curl -X PUT http://localhost:8080/api/ontologies/onto-123 \
  -H "Content-Type: application/json" \
  -d '{
    "status": "active",
    "version": "1.1"
  }'

Path Parameters

id
string
required
Ontology ID

Request Body

All fields are optional. Only provided fields will be updated.
name
string
New name
description
string
New description
version
string
New version
content
string
New Turtle (.ttl) content
status
string
New status: draft, active, or archived

Response

Returns the updated ontology object.

Delete Ontology

Deletes an ontology.
curl -X DELETE http://localhost:8080/api/ontologies/onto-123

Path Parameters

id
string
required
Ontology ID

Response

Returns 204 No Content on success.

Extract Ontology from Data

Runs the schema-inductive extraction algorithm over the specified storage backends, generates an OWL/Turtle ontology, and diffs it against existing active ontologies. If changes are detected the new ontology is flagged as needs_review and the diff is returned.
curl -X POST http://localhost:8080/api/extraction/generate-ontology \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj-123",
    "storage_ids": ["storage-456", "storage-789"],
    "ontology_name": "Auto-extracted Manufacturing Schema",
    "include_structured": true,
    "include_unstructured": false
  }'

Request Body

project_id
string
required
Project ID
storage_ids
array
required
Array of storage config IDs to extract from
ontology_name
string
required
Name for the generated ontology
include_structured
boolean
Extract from structured data (defaults to true)
include_unstructured
boolean
Extract from unstructured data (defaults to false)

Response

ontology
object
The generated ontology object
extraction_summary
object
Entity and relationship counts from the extraction process
ontology_diff
object
Diff against the existing active ontology, if any

Build docs developers (and LLMs) love