API
Overview
KROMA matches concepts across two ontologies. These pages are the Python API: what you call, and what it returns.
A run loads an alignment, retrieves local context for each concept, asks a language model whether the pair matches, and refines the joined graph. The command line is the usual entry. The same steps are available as functions.
The pieces
CLI
kroma run and the flags that select a config, a model, and a mode.
Matching runMatchingRun prepares the task, scores pairs, and writes metrics.
LoadersCSV alignments and an OWL class hierarchy.
QueryParents, children, synonyms, and labels from a named source.
ModelsOpenAI and Together chat models, and embedding backends.
RetrievalCosine search over concatenated text and Node2Vec vectors.
RefinementOnline updates while scoring, and a final offline collapse.
MetricsPrecision, recall, and F1 for a binary alignment.
One run
kroma runparses flags and callsMatchingRun.execute.preparereads the method JSONL and the dataset JSON, then builds vector stores.score_pairsretrieves context, callsinfer, and records the prediction.finishrunsoffline_refineand writes a metrics JSON file.
Install
git clone https://github.com/lamng3/kroma.git
cd kroma
./setup.sh
source .venv/bin/activate
uv pip install ".[models]"
Copy .env.example to .env and set TOGETHERAI_API_KEY or OPENAI_API_KEY. The paper is ISWC 2025.