CogniFlow Web
cf_web is the web application package for CogniFlow. It provides:
- a FastAPI backend (
src/cf_web) exposing ontology/pipeline APIs - a React + TypeScript frontend (
frontend) for ontology exploration and pipeline editing - a CLI entrypoint (
cogniflow-web) to launch the app
Published distribution name:
pip install cf-web
Installed launcher surface:
cogniflow-web
The backend reads semantics through cf-semantics-runtime over the semantics-store contract boundary.
The active explorer and validation path is dataset-first: persisted quads -> RDFLib Dataset/Graph views -> API payloads, with raw RDF transport exposed as N-Quads.
Architecture
- Backend framework: FastAPI + Uvicorn
- Frontend framework: React + Vite
- Semantics source:
cf_semantics_runtimeprovider contract (quads-backed) - Service split:
ontology_explorer_service.pyfor ontology explorer payloadspipeline_creator_service.pyfor step DTOs used by the editorpipeline_service.pyfor pipeline list/load/save/validate operations- Explorer dashboard and backend SHACL validation read dataset/graph views directly; maintained raw RDF payloads are N-Quads.
Install
From repository root (recommended in a virtual environment):
python -m pip install -e "sandcastle/cf_web[test]"
Install with pipeline runtime support:
python -m pip install -e "sandcastle/cf_web[test,pipeline]"
If you want frontend production assets served by FastAPI, build the frontend first:
.\scripts\build_cf_web_frontend.ps1
Run
Option 1: direct app launcher
cogniflow-web
Disable browser auto-open:
cogniflow-web --no-browser
Option 2: unified CLI
cf web start
or
cf web start --no-browser
Backend API
Key routes:
GET /api/healthGET /api/ontology/graphGET /api/ontology/datasetGET /api/ontology/dashboardGET /api/semantics/stepsGET /api/semantics/steps/{step_id}GET /api/pipelines/GET /api/pipelines/{pipeline_id}?rev={n}POST /api/pipelines/savePOST /api/pipelines/validate
Pipeline transport is N-Quads-first:
GET /api/pipelines/{pipeline_id}returns{ pipeline_id, rev, pipeline_nquads }POST /api/pipelines/saveaccepts{ pipeline_id, pipeline_nquads, ... }POST /api/pipelines/validateaccepts{ pipeline_nquads }
Raw ontology exports return { nquads }. GET /api/ontology/graph and GET /api/ontology/dataset intentionally expose the same maintained N-Quads export because the web surface no longer depends on a synthetic JSON-LD graph-vs-dataset distinction.
Step and ontology-explorer payloads consume standardized metadata contracts from the registered semantics/runtime providers. The canonical documentation fields are:
skos:prefLabelskos:definitionskos:scopeNoteskos:example
When present, the UI also preserves a bounded adaptive SKOS surface for search and detail display:
skos:altLabelskos:notationskos:inSchemeskos:broaderskos:narrowerskos:related
Frontend code should consume this normalized service-layer contract and must not parse raw RDF in the browser.
Configuration
cf_web reads these environment variables:
CF_WEB_HOST(default:127.0.0.1)CF_WEB_PORT(default:8000)CF_WEB_RELOAD(1enables reload, default:0)CF_WEB_DEBUG(1enables debug flag, default:0)- Workspace root:
~/.cogniflow/workspace - Semantics root:
~/.cogniflow/workspace/semantics
By default the launcher sets:
CF_ENABLE_STEP_PACKAGES=1
so installed step packages are ingested/discovered for UI usage.
Development Notes
- Frontend source of truth is under
frontend/src. - Built frontend files are emitted to
src/cf_web/staticby Vite. - The publish workflow packages the checked-in
src/cf_web/staticbundle and does not run a frontend build step. - Backend services use a shared
OntologyManagerprovider (manager_provider.py) to avoid repeated manager instantiation. - The pipeline editor keeps live backend validation enabled with a 450 ms debounce in
PipelineEditorPage.tsx. - Local
.nqimport/export happens in the browser viafrontend/src/utils/nquads.tsandn3.
Publishing
cf_web is published with the dedicated Windows workflow:
- Workflow:
.github/workflows/cf_web_windows_publish.yml - Package directory:
sandcastle/cf_web - Published distribution:
cf-web - PyPI tag:
cf-web-v<version> - TestPyPI tag:
cf-web-v<version>-test
Local preflight:
powershell -ExecutionPolicy Bypass -File scripts/mimic_windows_python_publish_workflow.ps1 `
-WorkflowFile .github/workflows/cf_web_windows_publish.yml `
-PackageDir sandcastle/cf_web `
-PythonExe py `
-PythonVersion 3.14
Queue a dry-run dispatch:
powershell -ExecutionPolicy Bypass -File scripts/queue_windows_python_publish_workflow.ps1 `
-WorkflowFile .github/workflows/cf_web_windows_publish.yml `
-PackageDir sandcastle/cf_web `
-PublishTarget testpypi `
-Ref main `
-RequireLocalPass `
-DryRun
Troubleshooting
GET /favicon.ico 404: ensure favicon exists insrc/cf_web/static/favicon.icoand frontend was rebuilt.- App opens but says frontend build missing: run
.\scripts\build_cf_web_frontend.ps1. - No steps visible in UI: ensure step packages are installed and
CF_ENABLE_STEP_PACKAGES=1(default via launcher).
Metadata
Release files for cf-web 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cf_web-0.2.6.tar.gz | 264.2 kB | Without provenance | Details for cf_web-0.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cf_web-0.2.6-py3-none-any.whl | Python 3 | none | any | Details for cf_web-0.2.6-py3-none-any.whl |
Total release size: 519.9 kB
Release files / cf_web-0.2.6.tar.gz
| Download URL | cf_web-0.2.6.tar.gz |
|---|---|
| Size | 264.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4bfc5713cffaef44ea275269cded28000100b6ced1867d4b19ade274f049fc3
|
|
BLAKE2b-256 checksum How to use checksums |
cbdeb1910bed75e0cdfe074659abc3c2f1d5513e900cef3d726cfbaf2b59fb24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / cf_web-0.2.6-py3-none-any.whl
| Download URL | cf_web-0.2.6-py3-none-any.whl |
|---|---|
| Size | 255.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df993f07add83df15c160a396163cef882194fd08bec8570b828012947996379
|
|
BLAKE2b-256 checksum How to use checksums |
abd4d4c35c21b4d74178242a5a5dcda1e4c9f42eeed93dd8d75fb01939023034
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for cf-web 0.2.6
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.