KGCS SHACL Shapes
This folder contains SHACL shape files that validate the KGCS OWL ontology (schema-level TBox consistency) and enforce core causal-chain invariants. Each file uses real KGCS namespace prefixes — no placeholder namespaces.
Shape Files
| File | Validates |
|---|---|
core.shacl.ttl |
Causal-chain invariants (SH-CORE-01 through SH-CORE-07): AFFECTS target, no shortcut edges, relationship directions |
cpe.shacl.ttl |
Platform (cpeUri, cpeNameId), PlatformConfiguration (matchCriteriaId, criteria) |
cve.shacl.ttl |
Vulnerability (cveId pattern, published, source), Reference (referenceUrl) |
cvss.shacl.ttl |
Score (scoreId, version enum, baseScore range 0.0–10.0) |
cwe.shacl.ttl |
Weakness (cweId pattern, abstraction enum) |
capec.shacl.ttl |
AttackPattern (capecId pattern, name) |
attck.shacl.ttl |
Technique (attackId T####, PARTOF minCount), SubTechnique (T####.###, SUBTECHNIQUEOF cardinality), Tactic (TA####, phaseName) |
d3fend.shacl.ttl |
DefensiveTechnique (d3fendId, name) |
car.shacl.ttl |
DetectionAnalytic (analyticId pattern CAR-####-##-###, title) |
shield.shacl.ttl |
DeceptionTechnique (techniqueId DTE####, name) |
engage.shacl.ttl |
EngagementConcept (at least one of: activityId, approachId, goalId) |
Key Invariants (core.shacl.ttl)
SH-CORE-01:AFFECTSmust targetPlatformConfiguration, neverPlatformdirectly.SH-CORE-02: No directVulnerability → Techniqueshortcut (must go through CWE → CAPEC).SH-CORE-03:CAUSED_BYmust targetWeakness.SH-CORE-04:DEMONSTRATED_BYsource must beWeakness.SH-CORE-05:IMPLEMENTSsource must beAttackPattern.SH-CORE-06: EveryTechniquehas at least onePART_OFedge to aTactic.SH-CORE-07: EverySubTechniquehas exactly oneSUBTECHNIQUE_OFparent.
Running Validation
# Validate all shapes against OWL ontology files
python scripts/validation/validate_all_standards.py
# Validate a single standard
python scripts/validation/validate_all_standards.py --standard attck
# Run post-load Cypher integrity checks (requires Neo4j)
python scripts/validation/validate_all_standards.py --post-load
See docs/pipeline/pipeline-execution-guide.md for full parameters.
See docs/pipeline/rag-to-shacl.md for how RAG templates map to shape groups.