Validate and review extracted compliance rules with mandatory human expert oversight.
Project description
kg-validator
Install from PyPI:
pip install ski-kg-validator(publishing starts with the first release after June 2026).
Status: v3.0 — first production-target release.
Validate v3 Knowledge Graphs against SKI Framework specification v3.0 §3 (schema) and §3.6 (cross-cutting validation passes). Phase 1 (compilation) tool.
What it does
- Schema validation. Parses a v3 KG JSON file into the typed-node Pydantic models. Unknown obligation types, unknown edge types, unknown risk tiers, missing required fields, and extra unknown keys are all rejected at load time.
- Cross-cutting validation (§3.6). Detects duplicate node IDs, dangling edges, edges pointing at the wrong target node type, rules without any obligation, and orphan obligations.
What it no longer does (v2 retired in PR 10e)
- The v2 flat-rule-list format is gone. v3 typed obligations are the only currency.
- Interactive
review,detect-conflicts,detect-duplicates, and HTMLreportsubcommands were retired with the v2 path — they worked on the flat-rule shape and have no v3 equivalent. v3 conflict and duplicate detection happen at the typed-obligation level inside the validation passes and surface as issues in the output JSON. - The
ConfidenceLevelenum is gone. The extractor now carries anExtractionQualityvalue (separate concept; seekg-extractor).
Installation
pip install -e tools/kg-validator
Quick start
# Validate a v3 KG and print the issue summary:
kg-validator validate --input examples/energy/knowledge-graphs/kg-energy-v3-demo.json
# Validate and persist the full issue report:
kg-validator validate \
--input kg-energy-v3.json \
--output validation-report.json
# Show usage examples:
kg-validator examples
# Show version:
kg-validator version
The validate command exits with code 0 on a clean KG, code 2 on a
schema-level Pydantic validation failure, and code 3 on any CRITICAL
or HIGH severity §3.6 issue.
Architecture
kg_validator/
├── __init__.py public API: KnowledgeGraphV3, V3Validator, load_v3_kg, models
├── loader.py KnowledgeGraphV3 container + load_v3_kg(path) entry point
├── models.py typed Pydantic models per spec v3.0 §3 (nodes, edges, enums)
├── validator.py V3Validator runs the §3.6 cross-cutting passes
└── cli.py click-based CLI (`validate`, `examples`, `version`)
Conformance
The examples/energy/knowledge-graphs/kg-energy-v3-demo.json sample
KG must load cleanly and produce zero validation issues. This is
exercised by tests/test_v3_validator.py and by the CI durability
suite.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ski_kg_validator-3.0.3.tar.gz.
File metadata
- Download URL: ski_kg_validator-3.0.3.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
483512475ab00a87dbc67806d860a0dd0a742ec851023433ce6c885913469e55
|
|
| MD5 |
e81c4e52d9512a4eb5cc357abdf0b37a
|
|
| BLAKE2b-256 |
402453c917c0ee9b89c20a442a41c96c2791f44952f65035e05054d4ba400495
|
Provenance
The following attestation bundles were made for ski_kg_validator-3.0.3.tar.gz:
Publisher:
release.yml on kpifinity/ski-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ski_kg_validator-3.0.3.tar.gz -
Subject digest:
483512475ab00a87dbc67806d860a0dd0a742ec851023433ce6c885913469e55 - Sigstore transparency entry: 1783512549
- Sigstore integration time:
-
Permalink:
kpifinity/ski-framework@36cdaafd0ff3fc0b5e92f58356aeba4bea794db6 -
Branch / Tag:
refs/tags/v3.1.0-alpha.1 - Owner: https://github.com/kpifinity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@36cdaafd0ff3fc0b5e92f58356aeba4bea794db6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ski_kg_validator-3.0.3-py3-none-any.whl.
File metadata
- Download URL: ski_kg_validator-3.0.3-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29a57af7d2ca239120b27bb0df4b006ec3054a810326e85d238c0f07f96fa162
|
|
| MD5 |
8f6c89d7754a8cb175fbaf74e15aa218
|
|
| BLAKE2b-256 |
d4bf365c447817293643271dcedacc947db9409b4a41254f1506a25a3665a87f
|
Provenance
The following attestation bundles were made for ski_kg_validator-3.0.3-py3-none-any.whl:
Publisher:
release.yml on kpifinity/ski-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ski_kg_validator-3.0.3-py3-none-any.whl -
Subject digest:
29a57af7d2ca239120b27bb0df4b006ec3054a810326e85d238c0f07f96fa162 - Sigstore transparency entry: 1783513407
- Sigstore integration time:
-
Permalink:
kpifinity/ski-framework@36cdaafd0ff3fc0b5e92f58356aeba4bea794db6 -
Branch / Tag:
refs/tags/v3.1.0-alpha.1 - Owner: https://github.com/kpifinity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@36cdaafd0ff3fc0b5e92f58356aeba4bea794db6 -
Trigger Event:
push
-
Statement type: