validate_knowledge
Validate a Canonical Knowledge Structure (CKS) to ensure its integrity and correctness. Returns validation results and diagnostics, with options to reuse a session or apply extra rules.
Instructions
Validate a Canonical Knowledge Structure. Returns validation result and diagnostics. Optionally accepts 'session_id' to validate an existing session's current state instead of creating a new one. Optionally accepts 'extensions' to opt into additional, non-default validation rules for this call only (see 'extensions' parameter). Returns a 'session_id' that can be used with list_versions and revert_version to track and manage version history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json_data | Yes | A valid CKS Knowledge Structure as a JSON string. Each object has an 'identity' ({'id', 'type', 'name'}) and a free-form 'structure' dict. Relations are objects whose 'structure' contains 'participants' (a list of object ids) and 'relation_type'. Example: '{"objects": [{"identity": {"id": "obj-1", "type": "Definition", "name": "Photosynthesis"}, "structure": {"content": "..."}}, {"identity": {"id": "rel-1", "type": "Relation", "name": "r"}, "structure": {"participants": ["obj-1", "obj-2"], "relation_type": 'derives"}}]}'. | |
| extensions | No | Optional list of opt-in validation extensions to apply for this call only (does not affect other calls). Currently available: 'embedding_projection', 'verification_record', 'type_hierarchy', 'relation_type', 'mutual_exclusion', 'functional_relation', 'inference_referential_integrity', 'confidence_bounds', 'supersession_chain', 'inference_confidence_conflict' (see ADR-001: these apply to 'InferenceStep' objects -- {'identity': {'id': ..., 'type': 'InferenceStep', 'name': ...}, 'structure': {'premises': [...], 'conclusion': <object_id>, 'operator': 'deductive|inductive|abductive|heuristic', 'confidence': 0.0-1.0, 'justification': ..., 'alternatives_considered': [...], 'superseded_by': <object_id> | null}}. 'inference_confidence_conflict' flags active (non-superseded) InferenceSteps that share a conclusion but disagree on confidence, at WARNING severity rather than ERROR). Examples of contradiction rules: - MutualExclusionRule: {"identity": {"id": "rule-1", "type": "MutualExclusionRule", "name": "no-support-and-refute"}, "structure": {"relation_type_a": "supports", "relation_type_b": "refutes"}}. This flags when the SAME source-target pair has BOTH a 'supports' and a 'refutes' relation. - FunctionalRelationRule: {"identity": {"id": "rule-2", "type": "FunctionalRelationRule", "name": "single-orbit"}, "structure": {"relation_type": "orbits"}}. This flags when a single source has MORE THAN ONE target via 'orbits'. Example of a correct EmbeddingProjection with its 'represents' relation: {"objects": [{"identity": {"id": "src-1", "type": "Document", "name": "Real paper"}, "structure": {}}, {"identity": {"id": "proj-1", "type": "EmbeddingProjection", "name": "projection"}, "structure": {"store_ref": "vecdb://xyz"}}, {"identity": {"id": "rel-1", "type": "Relation", "name": "r"}, "structure": {"participants": ["src-1", "proj-1"], "relation_type": "represents"}}]}. Example of TypeDefinition and TypeRule for ontology validation: {"objects": [{"identity": {"id": "td-1", "type": "TypeDefinition", "name": "Planet"}, "structure": {"type_name": "Planet", "parent_type": "CelestialBody"}}, {"identity": {"id": "tr-1", "type": "TypeRule", "name": "orbits rule"}, "structure": {"relation_type": "orbits", "allowed_source_types": ["Planet", "Moon"], "allowed_target_types": ["Star", "Planet"]}}]}. | |
| session_id | No | Optional. If provided, validate the current structure of this session instead of creating a new session from json_data. |