Skip to content

Framework configuration

KGpipe has three configuration layers: the framework, a pipeline specification, and the parameter values bound onto tasks.

Framework

The framework configuration is a YAML file, usually config.yaml. It selects the Meta KG connection and the namespaces used for constructed resources:

SYS_KG_URL: "memory://"
SYS_KG_USR: ""
SYS_KG_PSW: ""

SOURCE_NAMESPACE: "http://kg.org/rdf/"
TARGET_RESOURCE_NAMESPACE: "http://kg.org/resource/"
TARGET_ONTOLOGY_NAMESPACE: "http://kg.org/ontology/"

SYS_KG_URL is memory://, a SQLite path, or a SPARQL endpoint. It is loaded when the framework starts:

from kgpipe.common.config import load_config

config = load_config()
print(config.SYS_KG_URL)

Pipeline specification

A catalog is kgpipe.pipeline/v1 YAML. See Pipelines for the schema, relative paths, ${VAR} interpolation, backend options, and how build() connects ports. Pipeline.from_yaml() plans and runs an entry; Pipeline.validate() stops after the plan. The same typed configuration can be built in Python. See Python API.

rdf_base:
    description: "Align source RDF with target KG"
    parameters:
        entity_matching_threshold: 0.99
        relation_matching_threshold: 0.5
    tasks:
        - paris_entity_matching
        - fusion_first_value

parameters applies to every task whose config_spec has that parameter. A step can override it:

tasks:
    - name: paris_entity_matching
      parameters:
          entity_matching_threshold: 0.8

Building a pipeline binds these values into a ConfigurationProfile and stores them on the resolved plan. run() passes that profile to the task when the task function accepts config. Values are checked against the declared type, allowed values, and range before execution.

A pipeline parameter that matches no task config_spec is an error. A step parameter on a task that does not declare config_spec is an error.

Legacy config map

MovieKG reference entries store match thresholds in parameters. rdf_alt keeps the historical cutoffs entity_matching_threshold: 0.5 and relation_matching_threshold: 0.1. The LLM entries still carry the model name in config, because those tasks read DEFAULT_LLM_MODEL_NAME from the environment. The historical pytest runner copies LLM_MODEL into that variable. A CLI run sets it directly:

DEFAULT_LLM_MODEL_NAME=gpt-5-mini kgpipe exec experiments/moviekg/pipeline.conf text_llm --package kgpipe_tasks --package kgpipe_llm.tasks
config:
    LLM_MODEL: "gpt-5-mini"

build_from_conf still binds a legacy string map onto each task that declares those keys. fusion_first_value reads entity_matching_threshold and relation_matching_threshold from that profile.

When a task does declare config_spec, the same keys are also bound as parameters:

Legacy key Parameter
ENTITY_MATCHING_THRESHOLD entity_matching_threshold
RELATION_MATCHING_THRESHOLD relation_matching_threshold
LLM_MODEL llm_model

Names match after lowercasing and turning spaces or hyphens into underscores, so a parameter declared as entity matching threshold receives entity_matching_threshold. native_keys on Parameter is the other alias. Unrecognized legacy keys are left for the caller; they do not fail the catalog load.

Binding order is: the parameter default, legacy config, pipeline parameters, then the step's parameters. The newer fields override the legacy map.

Ontology

fusion_first_value and type_inference_ontology_simple still read ONTOLOGY_PATH. The CLI stores --ontology on the pipeline object. It is not yet a $ontology port in build().