Skip to content

statnett/KGVerifyPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KGValidatePy – Knowledge Graph Validation for Python

Overview

KGValidatePy is a Python library for validating knowledge graphs on top of pySHACL.

It provides DataOps-oriented approched that can support both ModelOps and SchemaOps workflows.

KGValidatePy extends the capabilities of pySHACL and integrates tightly with KGraphPy, providing structured validation pipelines for standards-based knowledge graph data, including Common Information Model (CIM) / Common Grid Model Exchange Standard (CGMES) confomred datasets.

The library is designed to support:

  • Constraint validation

  • Schema validation

  • Reasoning-assisted validation

  • Structured validation reporting

  • Integration with editing and verification workflows

KGValidatePy builds on top of KGraphPy-based (RDFLib) and pySHACL graph handling while remaining implementation-neutral at the interface level.

Scope and Focus

KGValidatePy focuses on validation of RDF-based knowledge graphs where:

  • RDF is the canonical representation

  • Constraints are expressed via SHACL or related mechanisms

  • Data quality must be enforced in automated pipelines

  • Validation results must be actionable in editing or verification workflows

While CIM / CGMES is the primary initial focus, KGValidatePy is reusable across other standards and profiles, including IEC 61850, BIM/IFC, GeoSPARQL datasets, EU SEMIC profiles, and Industrial Data Ontology (IDO).

Core Capabilities

KGValidatePy provides:

  • SHACL-based constraint validation (via pySHACL)

  • Optional reasoning support (RDFS / OWL profiles where applicable)

  • Validation of named graphs and dataset-level metadata

  • Structured validation reports suitable for:

  • Machine processing

  • Human-readable summaries

  • UI integration (e.g., KGEditPy)

Extended Validation Support

In addition to SHACL validation, KGValidatePy may support:

  • Schema-level validation where RDF is the canonical content:

  • XML Schema (XSD) for interchange constraints

  • JSON Schema for derived artefacts

  • Avro schema validation for event or stream representations

  • Validation of packaging conventions (e.g., header consistency)

  • DifferenceSet validation in change-oriented workflows

These extensions are designed to complement, not replace, SHACL-based validation.

Relationship to Other Libraries

KGValidatePy is intentionally composable:

  • KGraphPy provides graph handling and packaging support

  • pySHACL provides the SHACL validation engine

  • LinkML may provide schema definitions and generated artefacts

  • KGVerifyPy may use validation results as part of executable verification workflows

  • KGEditPy may present validation findings for human correction

KGValidatePy does not reimplement SHACL validation logic; it orchestrates and extends it for DataOps (including SchemaOps and ModelOps) use cases.

Licensing

KGValidatePy is released under the Apache License, Version 2.0.

This permits open use, modification, and redistribution in research, public sector, and commercial contexts under the terms of the license.

Accreditation

KGValidatePy builds upon the excellent work of the pySHACL project and its contributors.

We explicitly acknowledge the RDFLib and pySHACL communities for providing the foundational SHACL validation capabilities that make this library possible.

KGValidatePy extends these capabilities for standards-based DataOps workflows but remains an independent open-source project.

About

Knowledge Graph Validation for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages