StackMap
Subscribe
Explore / ontocast
growgraph

ontocast

Agentic ontology-assisted RDF extraction: co-evolves domain ontologies and fact graphs in a map/reduce pipeline with RDF 1.2 provenance, entity disambiguation and SHACL autofix.

228 27 Python Apache-2.0updated 14 days ago
View on GitHubDispute this mapping →
Curator's take

The extractor to pick when ontology drift is the thing that has burned you: schema and instances evolve in one loop, GraphUpdate insert/delete patches replace whole-graph regeneration, and SHACL validation repairs machine-fixable violations without another LLM pass. Runs as a REST service, a batch CLI, or a LangGraph node, with pyoxigraph in memory by default and Fuseki when you need persistence. Realities: it's research-grade (Zenodo DOI, 228 stars) with a configuration surface to match — 202 environment variables, and the docs sensibly ship a 47-variable minimal file plus playbooks. The LLM critic is off at the default `MAX_VISITS_PER_NODE=1`, so quality out of the box is one render pass.

Mapped by ShipWithAI editors · links verified
README.md

OntoCast OntoCast logo

Agentic ontology-assisted extraction of RDF knowledge graphs from documents.

Python PyPI version PyPI Downloads Docs License pre-commit DOI

OntoCast turns unstructured text into queryable RDF: it co-evolves domain ontologies and fact graphs in a parallel map/reduce pipeline, with RDF 1.2 provenance, entity disambiguation across chunks, and optional vector-backed ontology retrieval. Run it as a REST service, a batch CLI, or embed the pipeline in your own LangChain / LangGraph agent.

Documentation: growgraph.github.io/ontocast


Why OntoCast

Most extractors dump triples and leave ontology drift to you. OntoCast treats schema and instance data as one loop: per-chunk render → critic → merge, with GraphUpdate patches (insert/delete) instead of regenerating whole graphs, SHACL validation with LLM-free autofix, and a light install so you can embed the core without pulling Docling, gRPC, or ONNX.


Features

  • Parallel ontology + facts loops — concurrent per-unit render/critic with configurable workers
  • GraphUpdate patches — token-efficient insert/delete ops, not full-graph regeneration
  • Entity disambiguation — embedding + symbolic alignment across chunks
  • RDF 1.2 provenance — quoted triples / provenance artifacts; optional strip_provenance
  • Ontology context — catalog selection, vector retrieval (LanceDB or Qdrant), or a fixed ontology
  • Facts validation — invariants, SHACL, and machine repairs without an extra LLM pass
  • Stores — in-memory pyoxigraph by default; Fuseki for persistence; tenancy by tenant/project
  • LLM caching — disk cache, in-flight limits, optional read-only / batch pre-warm
  • Embeddableontocast_tools, run_unit_pipeline, or a LangGraph node

Install

Pick at least one LLM provider extra. Add server for the CLI and HTTP API:

uv add "ontocast[server,openai]"
# or: pip install "ontocast[server,openai]"

Common add-ons: doc-processing (PDF/DOCX), lancedb or qdrant (ontology retrieval), shacl (shape validation).

uv add "ontocast[server,openai,doc-processing,lancedb,shacl]"

Full extras table: Installation.


Quick start

cp .env.example .env
# Set LLM_API_KEY (and LLM_PROVIDER / LLM_MODEL_NAME as needed)

ontocast serve
curl -X POST http://localhost:8999/process -F "file=@document.pdf"

Batch without a server:

ontocast process --input-path ./document.pdf --head-chunks 5 --output-dir ./out

Omit FUSEKI_URI for in-memory pyoxigraph. Details: Quick Start.

Supplying Your Ontologies

OntoCast uses seed ontologies (in Turtle .ttl format) to guide extraction. Provide yours in two ways:

  1. Directory Seed: Set ONTOCAST_ONTOLOGY_DIRECTORY=/path/to/your/ontologies in your .env. All .ttl files in that folder sync automatically on startup.
  2. API Upload: Register schemas dynamically with the running server:
    curl -X POST
    

Continue your stack

What teams reach for next — and why each earns a place beside ontocast. Ranked by curator confidence.