Skip to content

ontocast.api.schemas

Pydantic models for the OntoCast HTTP API.

Attributes

Classes

FlushOkResponse

Bases: BaseModel

Source code in ontocast/api/schemas.py
class FlushOkResponse(BaseModel):
    status: str = "success"
    message: str

Attributes

message instance-attribute
status = 'success' class-attribute instance-attribute

HealthErrorResponse

Bases: BaseModel

Source code in ontocast/api/schemas.py
class HealthErrorResponse(BaseModel):
    status: str = "unhealthy"
    error: str

Attributes

error instance-attribute
status = 'unhealthy' class-attribute instance-attribute

HealthOkResponse

Bases: BaseModel

Source code in ontocast/api/schemas.py
class HealthOkResponse(BaseModel):
    status: str = "healthy"
    version: str = __version__
    llm_provider: str | None = None

Attributes

llm_provider = None class-attribute instance-attribute
status = 'healthy' class-attribute instance-attribute
version = __version__ class-attribute instance-attribute

InfoResponse

Bases: BaseModel

Source code in ontocast/api/schemas.py
class InfoResponse(BaseModel):
    name: str = "ontocast"
    version: str = __version__
    description: str = (
        "Agentic ontology assisted framework for semantic triple extraction"
    )
    capabilities: list[str] = Field(
        default_factory=lambda: ["text-to-triples", "ontology-extraction"]
    )
    input_types: list[str] = Field(
        default_factory=lambda: ["txt", "json", "pdf", "pptx"]
    )
    output_types: list[str] = Field(default_factory=lambda: ["turtle", "json"])
    llm_cache: dict | None = Field(
        default=None,
        description="In-memory and on-disk LLM cache statistics when available.",
    )
    max_concurrent_processes: int | None = Field(
        default=None,
        description="Configured cap on concurrent /process handlers, if any.",
    )

Attributes

capabilities = Field(default_factory=lambda: ['text-to-triples', 'ontology-extraction']) class-attribute instance-attribute
description = 'Agentic ontology assisted framework for semantic triple extraction' class-attribute instance-attribute
input_types = Field(default_factory=lambda: ['txt', 'json', 'pdf', 'pptx']) class-attribute instance-attribute
llm_cache = Field(default=None, description='In-memory and on-disk LLM cache statistics when available.') class-attribute instance-attribute
max_concurrent_processes = Field(default=None, description='Configured cap on concurrent /process handlers, if any.') class-attribute instance-attribute
name = 'ontocast' class-attribute instance-attribute
output_types = Field(default_factory=lambda: ['turtle', 'json']) class-attribute instance-attribute
version = __version__ class-attribute instance-attribute

OntologyDeleteResponse

Bases: BaseModel

Source code in ontocast/api/schemas.py
class OntologyDeleteResponse(BaseModel):
    status: str = "success"
    iri: str

Attributes

iri instance-attribute
status = 'success' class-attribute instance-attribute

OntologyListResponse

Bases: BaseModel

Current version of every ontology in the partition's catalog.

Source code in ontocast/api/schemas.py
class OntologyListResponse(BaseModel):
    """Current version of every ontology in the partition's catalog."""

    status: str = "success"
    ontologies: list[OntologySummary]

Attributes

ontologies instance-attribute
status = 'success' class-attribute instance-attribute

OntologyMutationResponse

Bases: BaseModel

Source code in ontocast/api/schemas.py
class OntologyMutationResponse(BaseModel):
    status: str = "success"
    iri: str
    ontology_id: str | None = None
    version: str | None = None
    hash: str | None = None

Attributes

hash = None class-attribute instance-attribute
iri instance-attribute
ontology_id = None class-attribute instance-attribute
status = 'success' class-attribute instance-attribute
version = None class-attribute instance-attribute

OntologySummary

Bases: BaseModel

Header of the current version of one catalog ontology.

Source code in ontocast/api/schemas.py
class OntologySummary(BaseModel):
    """Header of the current version of one catalog ontology."""

    iri: str
    ontology_id: str | None = None
    title: str | None = None
    description: str | None = None
    version: str | None = None
    hash: str | None = None

Attributes

description = None class-attribute instance-attribute
hash = None class-attribute instance-attribute
iri instance-attribute
ontology_id = None class-attribute instance-attribute
title = None class-attribute instance-attribute
version = None class-attribute instance-attribute

ProcessErrorResponse

Bases: BaseModel

Source code in ontocast/api/schemas.py
class ProcessErrorResponse(BaseModel):
    status: str = "error"
    error: str
    error_type: str | None = None
    error_code: str | None = None
    error_details: dict | None = None

Attributes

error instance-attribute
error_code = None class-attribute instance-attribute
error_details = None class-attribute instance-attribute
error_type = None class-attribute instance-attribute
status = 'error' class-attribute instance-attribute

ProcessOkResponse

Bases: BaseModel

Source code in ontocast/api/schemas.py
class ProcessOkResponse(BaseModel):
    status: str = "success"
    data: ProcessResultData
    metadata: ProcessResultMetadata

Attributes

data instance-attribute
metadata instance-attribute
status = 'success' class-attribute instance-attribute

ProcessResultData

Bases: BaseModel

Source code in ontocast/api/schemas.py
class ProcessResultData(BaseModel):
    facts: str
    ontology: str | None = Field(
        default=None,
        deprecated=True,
        description=(
            "Deprecated singular ontology payload; always null. Use ontology_artifacts."
        ),
    )
    ontology_artifacts: list[dict] = Field(default_factory=list)

Attributes

facts instance-attribute
ontology = Field(default=None, deprecated=True, description='Deprecated singular ontology payload; always null. Use ontology_artifacts.') class-attribute instance-attribute
ontology_artifacts = Field(default_factory=list) class-attribute instance-attribute

ProcessResultMetadata

Bases: BaseModel

Source code in ontocast/api/schemas.py
class ProcessResultMetadata(BaseModel):
    status: str | None = None
    chunks_processed: int
    chunks_remaining: int
    budget: dict
    retrieval_metrics: dict = Field(default_factory=dict)
    facts_repairs: dict[int, list[dict]] = Field(
        default_factory=dict,
        description=(
            "Deterministic machine repairs applied per content unit, keyed by "
            "unit index. Lets a consumer tell machine-altered triples from what "
            "the model asserted."
        ),
    )
    failed_units: list[dict] = Field(
        default_factory=list,
        description=(
            "Content units that produced no output, with the stage and reason. "
            "Empty on a fully successful run."
        ),
    )
    improvement_suggestions: list[str] = Field(
        default_factory=list,
        description=(
            "Advisory notes from the structural check and consistency critic "
            "(orphan terms, potential cross-ontology conflicts). Advisory only: "
            "nothing in the pipeline acts on them."
        ),
    )
    facts_conformance: dict = Field(
        default_factory=dict,
        description=(
            "Validation summary for the returned facts graph: whether SHACL "
            "ran and the graph conforms, counts by finding kind and by SHACL "
            "constraint component, and the LLM-free repairs applied. Set by "
            "/process and /process_unit alike; empty when the gate did not run."
        ),
    )
    facts_validation_findings: list[dict] = Field(
        default_factory=list,
        description=(
            "Residual findings behind the summary, after every repair stage. "
            "A consumer that needs to know *which* nodes are non-conformant "
            "reads these."
        ),
    )
    facts_gate_repairs: list[dict] = Field(
        default_factory=list,
        description=(
            "LLM-free repairs applied to the merged graph by the gate "
            "(shape-driven retyping, code resolution, placeholder pruning). "
            "Per-unit repairs are in facts_repairs."
        ),
    )

Attributes

budget instance-attribute
chunks_processed instance-attribute
chunks_remaining instance-attribute
facts_conformance = Field(default_factory=dict, description='Validation summary for the returned facts graph: whether SHACL ran and the graph conforms, counts by finding kind and by SHACL constraint component, and the LLM-free repairs applied. Set by /process and /process_unit alike; empty when the gate did not run.') class-attribute instance-attribute
facts_gate_repairs = Field(default_factory=list, description='LLM-free repairs applied to the merged graph by the gate (shape-driven retyping, code resolution, placeholder pruning). Per-unit repairs are in facts_repairs.') class-attribute instance-attribute
facts_repairs = Field(default_factory=dict, description='Deterministic machine repairs applied per content unit, keyed by unit index. Lets a consumer tell machine-altered triples from what the model asserted.') class-attribute instance-attribute
facts_validation_findings = Field(default_factory=list, description='Residual findings behind the summary, after every repair stage. A consumer that needs to know *which* nodes are non-conformant reads these.') class-attribute instance-attribute
failed_units = Field(default_factory=list, description='Content units that produced no output, with the stage and reason. Empty on a fully successful run.') class-attribute instance-attribute
improvement_suggestions = Field(default_factory=list, description='Advisory notes from the structural check and consistency critic (orphan terms, potential cross-ontology conflicts). Advisory only: nothing in the pipeline acts on them.') class-attribute instance-attribute
retrieval_metrics = Field(default_factory=dict) class-attribute instance-attribute
status = None class-attribute instance-attribute

ShapesDeleteResponse

Bases: BaseModel

Source code in ontocast/api/schemas.py
class ShapesDeleteResponse(BaseModel):
    status: str = "success"
    graph_uri: str

Attributes

graph_uri instance-attribute
status = 'success' class-attribute instance-attribute

ShapesListResponse

Bases: BaseModel

Named graphs held in the shapes partition, and their merged size.

Source code in ontocast/api/schemas.py
class ShapesListResponse(BaseModel):
    """Named graphs held in the shapes partition, and their merged size."""

    status: str = "success"
    graph_uris: list[str]
    triples: int

Attributes

graph_uris instance-attribute
status = 'success' class-attribute instance-attribute
triples instance-attribute

ShapesMutationResponse

Bases: BaseModel

One SHACL shapes document stored in the tenant's shapes partition.

Source code in ontocast/api/schemas.py
class ShapesMutationResponse(BaseModel):
    """One SHACL shapes document stored in the tenant's shapes partition."""

    status: str = "success"
    graph_uri: str
    triples: int

Attributes

graph_uri instance-attribute
status = 'success' class-attribute instance-attribute
triples instance-attribute

StatusErrorBody

Bases: BaseModel

Source code in ontocast/api/schemas.py
class StatusErrorBody(BaseModel):
    status: str = "error"
    error: str
    error_type: str | None = None
    error_code: str | None = None

Attributes

error instance-attribute
error_code = None class-attribute instance-attribute
error_type = None class-attribute instance-attribute
status = 'error' class-attribute instance-attribute