Skip to main content

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 HTML report subcommands 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 ConfidenceLevel enum is gone. The extractor now carries an ExtractionQuality value (separate concept; see kg-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.

Metadata

Release files for ski-kg-validator 3.1.0

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

Source distribution (sdist)

Source distribution for ski-kg-validator 3.1.0
File Size Uploaded Provenance Actions
ski_kg_validator-3.1.0.tar.gz 15.0 kB With provenance Details for ski_kg_validator-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ski-kg-validator 3.1.0
File Interpreter ABI Platform Actions
ski_kg_validator-3.1.0-py3-none-any.whl Python 3 none any Details for ski_kg_validator-3.1.0-py3-none-any.whl

Total release size: 27.5 kB

Release files / ski_kg_validator-3.1.0.tar.gz

Download URL ski_kg_validator-3.1.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b860136e92e7d6dc510ec625376963a4ee40b060f17c3e79e0c10a218ccc11ea
BLAKE2b-256 checksum
How to use checksums
5658c278131dcf2a354397ce81badbe175e480ac8490414fe912061eb73e2bb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release files / ski_kg_validator-3.1.0-py3-none-any.whl

Download URL ski_kg_validator-3.1.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6779bc5903eaff1a249f008ab45512bb7a027996ef0012c84e0a06112f56b059
BLAKE2b-256 checksum
How to use checksums
26f7e0f1fc14568d26f7fcbea51ea15ef85148b7e0977f0dd15f75958bd5e45e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Security for ski-kg-validator 3.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ski_kg_validator-3.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

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