# ConceptKernel Proof Ontology
# Version: v3.5
# Date: 2026-03-25
# Purpose: OWL classes for ProofRecord, ProofCheck, ProofOutcome, and CheckType
# Source: SPEC.CKP.v3.5.alpha-3.md

@prefix : <https://conceptkernel.org/ontology/v3.5/> .
@prefix ckp: <https://conceptkernel.org/ontology/v3.5/> .
@prefix bfo: <http://purl.obolibrary.org/obo/BFO_> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .

<https://conceptkernel.org/ontology/v3.5/proof> a owl:Ontology ;
    dc:title "ConceptKernel Proof Ontology" ;
    dc:description "OWL classes defining proof records, proof checks, outcomes, and check types for verifiable instance integrity" ;
    dcterms:created "2026-03-25"^^xsd:date ;
    owl:versionInfo "v3.5" ;
    rdfs:comment "Defines the proof verification structures: ProofRecord, ProofCheck, ProofOutcome, CheckType" ;
    owl:imports <http://purl.obolibrary.org/obo/bfo.owl> ,
                <https://conceptkernel.org/ontology/v3.5/> ,
                <https://conceptkernel.org/ontology/v3.5/base-instances> .

#################################################################
#    ProofRecord — verification record for a sealed instance
#################################################################

ckp:ProofRecord a owl:Class ;
    rdfs:subClassOf bfo:0000031 ;  # bfo:GenericallyDependentContinuant (information entity)
    rdfs:label "Proof Record"@en ;
    rdfs:comment "A verification record documenting that a sealed instance has been checked for integrity, schema compliance, provenance, and structure. Stored at storage/proof/{instance_id}/proof.json."@en ;
    dc:description "Generated by TechGames.ComplianceCheck or equivalent verification kernel" .

### ProofRecord Properties

ckp:proof_id a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "proof ID"@en ;
    rdfs:comment "Unique identifier for this proof record"@en .

ckp:proofInstanceId a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "instance ID"@en ;
    rdfs:comment "The instance_id of the sealed instance that was verified"@en .

ckp:data_hash a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "data hash"@en ;
    rdfs:comment "SHA-256 hash of the instance data.json content, proving data integrity"@en .

ckp:manifest_hash a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "manifest hash"@en ;
    rdfs:comment "SHA-256 hash of the instance manifest.json content, proving manifest integrity"@en .

ckp:checks a owl:ObjectProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range ckp:ProofCheck ;
    rdfs:label "checks"@en ;
    rdfs:comment "The individual proof checks that were executed as part of this proof record"@en .

ckp:outcome a owl:ObjectProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range ckp:ProofOutcome ;
    rdfs:label "outcome"@en ;
    rdfs:comment "The overall outcome of the proof verification (PASS, FAIL, PARTIAL)"@en .

ckp:checked_by_kernel a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "checked by kernel"@en ;
    rdfs:comment "The kernel class name that performed the verification (e.g., TechGames.ComplianceCheck)"@en .

ckp:checked_by_identity a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "checked by identity"@en ;
    rdfs:comment "The kernel URN identity that performed the verification"@en .

ckp:checked_at a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:dateTime ;
    rdfs:label "checked at"@en ;
    rdfs:comment "ISO 8601 timestamp of when the proof verification was performed"@en .

ckp:svid a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "SVID"@en ;
    rdfs:comment "SPIFFE Verifiable Identity Document of the verifier, enabling trust chain validation. Required per spec — every ProofRecord must carry the verifier's SVID for trust chain validation."@en .

#################################################################
#    ProofCheck — individual verification check
#################################################################

ckp:ProofCheck a owl:Class ;
    rdfs:subClassOf bfo:0000031 ;  # bfo:GenericallyDependentContinuant (information entity)
    rdfs:label "Proof Check"@en ;
    rdfs:comment "An individual verification check within a proof record. Each check validates a specific aspect of the instance (schema, SHACL, provenance, structure, integrity, operational)."@en .

### ProofCheck Properties

ckp:check_name a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range xsd:string ;
    rdfs:label "check name"@en ;
    rdfs:comment "Human-readable name of this check (e.g., 'manifest-schema', 'data-hash', 'provenance-chain')"@en .

ckp:check_type a owl:ObjectProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range ckp:CheckType ;
    rdfs:label "check type"@en ;
    rdfs:comment "The category of this verification check (SCHEMA, SHACL, PROVENANCE, STRUCTURE, INTEGRITY, OPERATIONAL)"@en .

ckp:expected a owl:DatatypeProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range xsd:string ;
    rdfs:label "expected"@en ;
    rdfs:comment "The expected value or condition for this check to pass"@en .

ckp:actual a owl:DatatypeProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range xsd:string ;
    rdfs:label "actual"@en ;
    rdfs:comment "The actual observed value or condition during verification"@en .

ckp:passed a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range xsd:boolean ;
    rdfs:label "passed"@en ;
    rdfs:comment "Whether this individual check passed (true) or failed (false)"@en .

#################################################################
#    ProofOutcome — enumeration of verification outcomes
#################################################################

ckp:ProofOutcome a owl:Class ;
    rdfs:label "Proof Outcome"@en ;
    rdfs:comment "The overall result of a proof verification. One of: PASS (all checks passed), FAIL (one or more critical checks failed), PARTIAL (some checks passed, some non-critical failed)."@en .

ckp:ProofOutcome-PASS a owl:NamedIndividual , ckp:ProofOutcome ;
    rdfs:label "PASS"@en ;
    rdfs:comment "All proof checks passed successfully"@en .

ckp:ProofOutcome-FAIL a owl:NamedIndividual , ckp:ProofOutcome ;
    rdfs:label "FAIL"@en ;
    rdfs:comment "One or more critical proof checks failed"@en .

ckp:ProofOutcome-PARTIAL a owl:NamedIndividual , ckp:ProofOutcome ;
    rdfs:label "PARTIAL"@en ;
    rdfs:comment "Some proof checks passed, some non-critical checks failed"@en .

#################################################################
#    CheckType — enumeration of verification check categories
#################################################################

ckp:CheckType a owl:Class ;
    rdfs:label "Check Type"@en ;
    rdfs:comment "Category of a proof verification check. Determines what aspect of the instance is being validated."@en .

ckp:CheckType-SCHEMA a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "SCHEMA"@en ;
    rdfs:comment "JSON Schema validation of manifest.json and data.json structure"@en .

ckp:CheckType-SHACL a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "SHACL"@en ;
    rdfs:comment "SHACL shape validation against CKP ontology constraints"@en .

ckp:CheckType-PROVENANCE a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "PROVENANCE"@en ;
    rdfs:comment "PROV-O provenance chain validation (wasGeneratedBy, wasAttributedTo)"@en .

ckp:CheckType-STRUCTURE a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "STRUCTURE"@en ;
    rdfs:comment "File/folder structure validation (required files exist, naming conventions)"@en .

ckp:CheckType-INTEGRITY a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "INTEGRITY"@en ;
    rdfs:comment "Data integrity validation (SHA-256 hash verification of data and manifest)"@en .

ckp:CheckType-OPERATIONAL a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "OPERATIONAL"@en ;
    rdfs:comment "Operational validation (tool executed correctly, expected output produced)"@en .

#################################################################
# End of ConceptKernel Proof Ontology
#################################################################
