Skip to content

Composition model

Composition is based on generic I/O types (contracts.io_types), not proprietary ontology chains.

Examples: material_rows, embeddings, vector_rows, cluster_labels, cluster_rows, graph_edges, metric_scalar, dataset_rows.

Aliases (symmetric):

  • embeddingsvector_rows
  • cluster_labelscluster_rows
  • material_rowsdataset_rows
from drtoller.framework.capability import (
get_contract,
can_compose,
compatible_consumers,
assert_compatible,
build_catalog,
)
embed = get_contract("sgns_v1", kind="algorithm")
cluster = get_contract("minibatch_kmeans_v1", kind="algorithm")
assert can_compose(embed, cluster)
consumers = compatible_consumers(embed, build_catalog().primitives)
assert_compatible(embed, cluster) # raises INCOMPATIBLE_INPUT if not
  • Do not hard-code domain pipelines (lemma → descriptor → …) in Framework.
  • Proprietary ontology steps stay outside OSS Framework catalogs.
  • Invalid chains fail with structured INCOMPATIBLE_INPUT errors.
  • Evaluation patterns validate metric method ↔ artifact_kind compatibility the same way.