Metadata-Version: 2.4
Name: cf-iri-site
Version: 0.1.1
Summary: Ontology-derived IRI website generator primitives for Cogniflow
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: cf-service-contracts>=0.1.0
Requires-Dist: rdflib<8.0,>=7.4
Provides-Extra: test
Requires-Dist: pytest<9.0,>=8.0; extra == "test"

# cf_iri_site

`cf_iri_site` is the dedicated build-time package for the Cogniflow ontology-derived
IRI website generator.

Current slice:

- build a normalized entity model from the installed ontology-read provider
- derive deterministic internal routes from canonical hash IRIs
- derive relation groups and incoming references from RDF predicates
- derive deterministic primary breadcrumb metadata
- render static HTML entity pages and ontology-derived index pages
- export machine-readable JSON artifacts alongside rendered output when requested

Implementation notes for this slice:

- importing `cf_iri_site` stays lightweight; `build_entity_model` is exported lazily so isolated helpers do not pull ontology provider implementations transitively on package import
- renderer display choices such as relation section labels and chip tones are centralized as UI policy; ontology content still comes from the normalized entity model
- primary breadcrumb selection is governed by an explicit ordered policy: package membership for CF entities, then property domains, class superclasses, concept broader/scheme, then defined fallbacks

Out of scope in this slice:

- release-repo transfer into `cogniflow/cf/`
- `cf_web` frontend integration

Open points retained intentionally:

- final rendering stack
- release workflow details for cross-repo publish
- final index-page set beyond the machine-readable export surface

CLI example:

```powershell
cf-iri-site export --output entities.json --routes-output routes.json
cf-iri-site render --output-dir site --json-output site-json
cf-iri-site sync-release --site-dir site --target-repo ../cogniflow-public --target-subdir cf --dry-run
```

Planned publish workflow contract:

- the public target repository identifier is supplied by workflow input or repository variable
- the SSH deploy key is provided through a GitHub Actions secret
- the generated site is mirrored into the target repo subdirectory `cf/`

## Publishing

`cf-iri-site` now has two separate release workflows:

- PyPI package workflow: `.github/workflows/cf_iri_site_windows_publish.yml`
- Site-sync workflow: `.github/workflows/cf_iri_site_publish_to_cogniflow.yml`

PyPI package release metadata:

- Package directory: `sandcastle/cf_iri_site`
- PyPI tag: `cf-iri-site-v<version>`
- TestPyPI tag: `cf-iri-site-v<version>-test`

Local PyPI preflight:

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

Queue a dry-run PyPI dispatch:

```powershell
powershell -ExecutionPolicy Bypass -File scripts/queue_windows_python_publish_workflow.ps1 `
  -WorkflowFile .github/workflows/cf_iri_site_windows_publish.yml `
  -PackageDir sandcastle/cf_iri_site `
  -PublishTarget none `
  -Ref main `
  -RequireLocalPass `
  -DryRun `
  -ReleaseTag cf-iri-site-v0.1.1
```
