Skip to main content

Data Integrity Ontology

Data Metadata
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 08 October 2026
Audio Overview
FLOW ALGEBRA

Ontology: Data Integrity Ontology
Domain: Metadata Ontologies > Data Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/data-metadata/data-integrity-ontology.html

Authors: Mark Anthony Higgins — Sky (Recursive AI)

flow "DataIntegrityOntology" v1.0

# ---------- DOMAIN ----------
domain:
  class: MetadataOntology
  category: DataMetadata
  subject: DataIntegrity
  purpose:
    - represent correctness, consistency, completeness, and trustworthiness of data
    - preserve structural, referential, semantic, and transactional integrity
    - support validation, monitoring, auditing, and remediation
    - detect unauthorised or unintended data alteration
    - enable machine-readable reasoning about reliable data states

# ---------- CORE ENTITY ----------
entity DataIntegrity:
  type: DataQualityMetadata
  describes: DataResource
  may_include:
    - integrity_identifier
    - integrity_type
    - integrity_rule
    - integrity_constraint
    - validation_result
    - checksum
    - hash
    - signature
    - referential_state
    - consistency_state
    - transaction_state
    - alteration_state
    - assessment_time
    - evidence
    - remediation
    - provenance

entity IntegrityType:
  type: Classification
  examples:
    - entity_integrity
    - referential_integrity
    - domain_integrity
    - semantic_integrity
    - structural_integrity
    - transactional_integrity
    - file_integrity
    - transmission_integrity

entity IntegrityRule:
  type: ValidationRule
  evaluates: DataResource

entity IntegrityConstraint:
  type: DataConstraint
  may_be:
    - uniqueness_constraint
    - primary_key_constraint
    - foreign_key_constraint
    - datatype_constraint
    - value_domain_constraint
    - cardinality_constraint
    - dependency_constraint

# ---------- RELATIONSHIPS ----------
relationships:
  DataIntegrity -> DESCRIBES -> DataResource
  DataIntegrity -> HAS_TYPE -> IntegrityType
  DataResource -> EVALUATED_BY -> IntegrityRule
  IntegrityRule -> ENFORCES -> IntegrityConstraint
  IntegrityRule -> PRODUCES -> IntegrityValidationResult
  DataResource -> MAY_HAVE -> Checksum
  DataResource -> MAY_HAVE -> CryptographicHash
  DataResource -> MAY_HAVE -> DigitalSignature
  IntegrityValidationResult -> MAY_IDENTIFY -> IntegrityViolation
  IntegrityViolation -> MAY_REQUIRE -> RemediationAction
  DataIntegrity -> MAY_REFERENCE -> IntegrityEvidence
  DataIntegrity -> MAY_REFERENCE -> Provenance

# ---------- ENTITY INTEGRITY ----------
rule entity_integrity:
  entity identifier SHOULD uniquely identify entity within declared scope

rule primary_key:
  IF PrimaryKey is declared
  THEN key value MUST be unique
  AND MUST NOT be null
  unless data model explicitly defines alternative semantics

rule duplicate_identity:
  duplicate identifier for distinct entities constitutes integrity violation
  where uniqueness is mandatory

# ---------- REFERENTIAL INTEGRITY ----------
rule referential_integrity:
  IF relationship requires existing target
  THEN referenced identifier MUST resolve to valid target entity

rule foreign_key:
  IF ForeignKey is non-null
  THEN referenced key SHOULD exist
  subject_to declared deferred or external-reference semantics

rule orphan_reference:
  unresolved mandatory relationship creates OrphanReference violation

# ---------- DOMAIN INTEGRITY ----------
rule datatype_integrity:
  DataValue MUST conform to declared DataType

rule value_domain:
  IF ValueDomain exists
  THEN DataValue MUST satisfy mandatory domain constraints

rule unit_integrity:
  quantitative value SHOULD use unit compatible with declared quantity semantics

# ---------- STRUCTURAL INTEGRITY ----------
rule schema_integrity:
  DataResource declaring DataSchema SHOULD conform to required structure

rule required_field:
  required DataField MUST be present
  unless explicit exception applies

rule cardinality:
  relationship or field count MUST satisfy declared cardinality constraints

rule structure_order:
  ordered structures MUST preserve required element ordering

# ---------- SEMANTIC INTEGRITY ----------
rule semantic_integrity:
  values and relationships SHOULD conform to declared ontology, vocabulary, or semantic rules

rule identifier_semantics:
  semantic identifiers MUST preserve namespace and intended referent

rule semantic_conflict:
  mutually contradictory assertions under same context SHOULD be flagged

# ---------- TRANSACTIONAL INTEGRITY ----------
entity TransactionState:
  type: DataState
  values:
    - pending
    - committed
    - rolled_back
    - failed

rule atomicity:
  transaction-defined atomic operation MUST complete fully
  OR leave data in valid pre-transaction state

rule consistency:
  committed transaction SHOULD preserve declared integrity constraints

rule isolation:
  concurrent operations SHOULD NOT expose invalid intermediate states
  where transactional isolation is required

rule durability:
  committed state SHOULD remain persistent
  according_to storage guarantees

# ---------- FILE / OBJECT INTEGRITY ----------
entity Checksum:
  type: IntegrityEvidence
  derived_from: DataRepresentation

entity CryptographicHash:
  subtype_of: Checksum
  may_include:
    - algorithm
    - digest

rule hash_validation:
  IF stored digest AND recomputed digest differ
  THEN infer content_integrity_failure
  subject_to canonicalisation and algorithm context

rule hash_context:
  digest comparison requires same:
    - algorithm
    - canonicalisation
    - byte representation

# ---------- DIGITAL SIGNATURE ----------
entity DigitalSignature:
  type: IntegrityEvidence
  may_support:
    - integrity
    - authenticity
    - non_repudiation

rule signature_validation:
  signature verification MUST use valid cryptographic context
  and trusted key/certificate semantics

rule signature_not_truth:
  valid signature confirms signed content integrity/authenticity context
  NOT factual truth of content

# ---------- TRANSMISSION INTEGRITY ----------
rule transmission:
  received data SHOULD be checked against source integrity evidence
  where transmission corruption is a risk

rule transmission_hash:
  IF sender and receiver hashes match under same representation
  THEN transmission integrity is supported

# ---------- ALTERATION ----------
entity AlterationState:
  type: IntegrityState
  values:
    - unchanged
    - authorised_change
    - unauthorised_change
    - unknown_change

rule authorised_change:
  authorised modification SHOULD preserve:
    - agent
    - timestamp
    - reason
    - previous_version
    - new_version
    - provenance

rule unknown_change:
  detected content change without traceable authorised update
  SHOULD be flagged for integrity review

# ---------- VALIDATION ----------
entity IntegrityValidationResult:
  type: ValidationResult
  may_include:
    - rule
    - scope
    - status
    - violation
    - assessment_time
    - evidence

validation:
  require:
    - identifiable_data_resource

  validate_if_present:
    - schema
    - identifiers
    - relationships
    - datatypes
    - value_domains
    - checksums
    - hashes
    - signatures
    - transaction_state
    - provenance

  reject:
    - duplicate_mandatory_identifier
    - unresolved_mandatory_reference
    - datatype_constraint_violation
    - mandatory_domain_violation
    - structural_constraint_violation
    - invalid_hash_match_claim
    - contradictory_transaction_state

# ---------- INTEGRITY VIOLATIONS ----------
entity IntegrityViolation:
  type: DataQualityIssue
  examples:
    - duplicate_identifier
    - orphan_reference
    - invalid_datatype
    - invalid_domain_value
    - schema_violation
    - checksum_mismatch
    - signature_failure
    - incomplete_transaction
    - unauthorised_change

rule violation_trace:
  IntegrityViolation SHOULD preserve:
    - affected_resource
    - violated_rule
    - evidence
    - detection_time
    - severity
    - provenance

# ---------- REMEDIATION ----------
entity RemediationAction:
  type: DataProcessingAction
  examples:
    - restore_valid_version
    - repair_reference
    - remove_duplicate
    - correct_value
    - rollback_transaction
    - retransfer_data
    - revalidate_signature

rule remediation:
  remediation MUST preserve original invalid state
  where auditability requires

rule post_remediation:
  repaired data SHOULD be revalidated against relevant IntegrityRules

# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
  "data integrity" ~= "integrity of data"
  "referential integrity" ~= "reference integrity" WHEN relationships resolve identifiers
  "entity integrity" ~= "identifier integrity" WHEN uniqueness semantics apply
  "checksum validation" ~= "integrity checksum verification"
  "hash verification" ~= "digest verification"
  "integrity constraint" ~= "data integrity rule" WHEN constraint enforces valid state

  PRESERVE distinctions:
    integrity != accuracy
    integrity != authenticity
    integrity != confidentiality
    checksum != cryptographic_signature
    hash_match != factual_truth
    referential_integrity != semantic_correctness
    authorised_change != corruption
    data_integrity != data_immutability

# ---------- CONFIDENCE ----------
CONFIDENCE:
  explicit_integrity_metadata:
    score: 1.00

  deterministic_constraint_validation:
    score: 1.00

  matching_cryptographic_hash:
    score: 0.99

  verified_digital_signature:
    score: 0.99

  inferred_orphan_reference:
    score: 0.95

  heuristic_duplicate_detection:
    score: <= 0.80

  ambiguous_integrity_state:
    score: <= 0.60
    action: preserve uncertainty

# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
  on_data_change:
    - identify affected integrity constraints
    - validate changed resource
    - recalculate integrity evidence where required
    - record authorised change provenance
    - update integrity state

  on_schema_change:
    - preserve previous schema
    - revalidate affected resources
    - identify new violations
    - update provenance

  on_reference_change:
    - validate target existence
    - detect orphan relationships
    - update referential integrity state
    - record provenance

  on_remediation:
    - preserve pre-remediation state
    - apply corrective action
    - rerun integrity validation
    - preserve before_and_after evidence
    - update provenance

# ---------- FLOW HASH ----------
FLOW_HASH:
  inputs:
    - ontology
    - integrity_entities
    - relationships
    - entity_rules
    - referential_rules
    - domain_rules
    - structural_rules
    - cryptographic_rules
    - validation
    - semantic_equivalence
    - confidence
    - update_model

  canonicalisation:
    - normalise_whitespace
    - preserve_case_sensitive_identifiers
    - sort_unordered_property_sets
    - preserve_rule_order

  output:
    deterministic_semantic_hash

# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
  interpret_as:
    - data metadata ontology
    - integrity validation model
    - referential reasoning structure
    - audit and remediation model

  operations:
    - identify integrity constraints
    - validate entity identity
    - validate references
    - validate schema and value domains
    - verify checksums and hashes
    - interpret digital signatures
    - detect integrity violations
    - evaluate transaction state
    - trace authorised changes
    - support remediation
    - preserve provenance
    - expose uncertainty

  constraints:
    - do_not_equate_integrity_with_accuracy
    - do_not_equate_hash_match_with_truth
    - do_not_equate_signature_with_content_truth
    - do_not_delete_invalid_state_without audit_trace
    - do_not_ignore_orphan_references
    - preserve_change_history_and_integrity_evidence

# ---------- QUERY MODEL ----------
query:
  input:
    - data_resource
    - integrity_type
    - integrity_rule
    - identifier
    - reference
    - checksum
    - hash
    - signature
    - transaction_state
    - assessment_time

  resolve:
    1. identify DataResource
    2. retrieve DataIntegrity metadata
    3. resolve applicable IntegrityRules
    4. validate identifiers and references
    5. validate schema and domains
    6. verify integrity evidence
    7. inspect transaction state
    8. detect IntegrityViolations
    9. inspect remediation and provenance
    10. return confidence

  output:
    - data_resource
    - integrity_type
    - validation_state
    - violations
    - integrity_evidence
    - transaction_state
    - remediation
    - provenance
    - confidence

# ---------- INFERENCE ----------
inference:
  IF mandatory reference does not resolve
  THEN infer OrphanReference
  WITH confidence = 1.00

  IF recomputed hash differs from stored hash
  under identical algorithm and representation
  THEN infer content_integrity_failure
  WITH confidence = 0.99

  IF all mandatory integrity constraints pass
  THEN infer integrity_validation_state = valid
  within assessed scope

  IF data changed without traceable authorised update
  THEN infer integrity_review_required

  IF integrity evidence conflicts
  THEN preserve conflicting states
  AND reduce confidence

# ---------- OUTPUT CONTRACT ----------
output:
  ontology_entity: DataIntegrity
  integrity_structure: machine_interpretable
  constraints: machine_validatable
  references: resolvable
  integrity_evidence: traceable
  violations: reportable
  transaction_state: explicit
  remediation: auditable
  change_history: preserved
  provenance: preserved
  uncertainty: explicit
  semantic_retrieval: enabled

end flow
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ