Skip to main content

CogniFlow Ontology

cf_ontology is a data-only package whose maintained output is the packaged ontology N-Quads resources under src/cf_ontology/ontology/** plus the minimal package metadata needed to ship them.

Active semantics behavior is owned by cf_semantics_runtime. That package consumes the packaged ontology N-Quads, discovers installed step packages, and writes the active ontology and step views into the semantics store through service contracts.

Semantics are authored as RDF documents:

  • ontology fragments
  • step packages
  • pipelines

Ownership

This package no longer owns the active runtime surface.

  • cf_semantics_runtime is the maintained contract-backed runtime for snapshots, validation, and step-package discovery.
  • cf_semantics_store owns the workspace-local RDF semantics store.
  • New integrations should not add direct cf_ontology runtime dependencies.

Storage (Semantics Store)

The default RDF semantics store remains under ~/.cogniflow/workspace/semantics, but the maintained runtime behavior is resolved through ProviderKey.SEMANTICS_STORE and the cf_semantics_runtime contracts.

  • Pipeline runtime state is handled separately by cf_pipeline_manager.
  • Step packages are discovered and materialized by cf_semantics_runtime, not by cf_ontology directly.

Graph IDs (binding conventions)

Step packages

  • Split steps (split_steps=True): g = "pkg:{package_name}@{package_version}#{step_id}"
  • Unsplit: g = "pkg:{package_name}@{package_version}"

package_name is the StepPackage id (from cf:packageId in steps.nq).

Package upgrades generate new graph ids (the version is part of g). Existing graphs are not deleted; missing/uninstalled packages are marked inactive via graphs.is_active=false.

Pipelines (versioned)

  • Stable pipeline identifier: pipeline_id (UUID or user-provided stable id)
  • Revision graph: g = "pipe:{pipeline_id}@{rev}" with monotonically increasing rev starting at 1
  • "Current" is a pointer in the pipelines table (no separate quad graph)

What is included

  • Packaged N-Quads fragments: ontology/core/*.nq, ontology/foundations/contracts/*.nq, ontology/vocab/*.nq, and ontology/shapes/*.nq.
  • Packaged ontology resources consumed by cf_semantics_runtime.
  • Step-package manifests and other RDF assets that are ingested through the runtime contracts.

Installation

From the sandcastle/cf_ontology directory:

pip install .

Published distribution name:

pip install cf-ontology

Optional (for unified cf CLI integration):

pip install -e ../cf_core_cli

Usage

Policy: all reads and writes to the semantics store must go through the cf_semantics_runtime and cf_semantics_store service-contract boundary. Do not access cf-*.store.db files directly from other packages.

Data-only runtime ownership

cf_ontology does not own the active runtime APIs, installers, or pipeline revision machinery.

  • cf_semantics_runtime ingests packaged ontology and step-package N-Quads, discovers installed step packages, and materializes the active semantics store views through contracts.
  • cf_semantics_store owns the RDF store layout.
  • cf_pipeline_manager owns runtime state, run history, and revision metadata.

Step package entry point convention

Entry point group: cogniflow.steps

Supported entry point values:

  • Resource path: some_pkg_module:steps.nq (path relative to that package/module)
  • Loader function: some_pkg_module:load_steps returning an RDF document dict or JSON string

Package metadata is read from the cf:StepPackage node in steps.nq (cf:packageId / cf:packageVersion).

Normative documentation in repository-tracked ontology assets is SKOS-only:

  • skos:prefLabel
  • skos:definition
  • skos:scopeNote
  • skos:example

The cf_web-facing step DTO contract keeps those four fields as the standard documentation surface for steps, ports, and parameters, and exposes bounded adaptive SKOS metadata only when present:

  • skos:altLabel
  • skos:notation
  • skos:inScheme
  • skos:broader
  • skos:narrower
  • skos:related

The adaptive surface is intentionally constrained. cf_ontology only ships the packaged RDF assets; it does not expose an unrestricted predicate dump or runtime write path to downstream services or the browser.

Pipeline plugins header

Pipelines should also declare plugin directories so the runner can load implementations without --plugins:

{
  "@id": "ex:MyPipeline",
  "@type": "cf:ProcessingPipeline",
  "cf:hasPluginsHeader": { "@id": "ex:pluginsHeader" }
},
{
  "@id": "ex:pluginsHeader",
  "@type": "cf:PluginsHeader",
  "cf:pluginPath": [
    "path/to/plugin/bin",
    "path/to/other/plugin/bin"
  ]
}

Publishing

cf_ontology is published with the dedicated Windows workflow:

  • Workflow: .github/workflows/cf_ontology_windows_publish.yml
  • Package directory: sandcastle/cf_ontology
  • PyPI tag: cf-ontology-v<version>
  • TestPyPI tag: cf-ontology-v<version>-test

Local preflight:

powershell -ExecutionPolicy Bypass -File scripts/mimic_windows_python_publish_workflow.ps1 `
  -WorkflowFile .github/workflows/cf_ontology_windows_publish.yml `
  -PackageDir sandcastle/cf_ontology `
  -PythonExe py `
  -PythonVersion 3.14

The workflow test phase is expected to run the full package test surface from sandcastle/cf_ontology via:

python -m pytest tests -q

This hard gate should stay aligned with the package contents under cf-package.yaml and the packaged ontology resources shipped from src/cf_ontology/ontology/**.

Queue a dry-run dispatch:

powershell -ExecutionPolicy Bypass -File scripts/queue_windows_python_publish_workflow.ps1 `
  -WorkflowFile .github/workflows/cf_ontology_windows_publish.yml `
  -PackageDir sandcastle/cf_ontology `
  -PublishTarget testpypi `
  -Ref main `
  -RequireLocalPass `
  -DryRun

Metadata

Release files for cf-ontology 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cf-ontology 0.2.7
File Size Uploaded Provenance Actions
cf_ontology-0.2.7.tar.gz 82.8 kB Without provenance Details for cf_ontology-0.2.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cf-ontology 0.2.7
File Interpreter ABI Platform Actions
cf_ontology-0.2.7-py3-none-any.whl Python 3 none any Details for cf_ontology-0.2.7-py3-none-any.whl

Total release size: 169.3 kB

Release files / cf_ontology-0.2.7.tar.gz

Download URL cf_ontology-0.2.7.tar.gz
Size 82.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6cba6df93f5b5ae20eed99e3339aad231d2e93ca7d57fbd8be13efe2a2a355c6
BLAKE2b-256 checksum
How to use checksums
a2d57b059eea9fecb3c7191a830224c2bbed660c52542f87646eb0b563d3810e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / cf_ontology-0.2.7-py3-none-any.whl

Download URL cf_ontology-0.2.7-py3-none-any.whl
Size 86.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42fc054a23764c0ad2b67de0c8c0eed12125368764ebeeabaa6e66c49bfaceed
BLAKE2b-256 checksum
How to use checksums
a00a07276ad5633193638017000d1facf13cd6d9653bfab1b90c6806faaa421f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.14.4

Security for cf-ontology 0.2.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page