# -*- coding: utf-8 -*-
# ==========================================================================
# Iroko Framework — Epistemic Module  v1.3.0
# ==========================================================================
# Namespace: https://ontology.irokosociety.org/iroko#
# Prefix:    ep:
# Requires:  iroko-core v1.3.0
#
# Optional module for modeling epistemic constraints and disclosure
# permissions — "knowledge gating" in sovereignty-aware archives.
# Governs when, to whom, and under what conditions knowledge may be
# disclosed, withheld, transformed, or restricted.
#
# This module does NOT encode ritual instructions. It encodes governance
# claims about who may access what knowledge under what conditions.
#
# NOTE: iroko:hasTemporalVariation is defined in Core and applies
# to iroko:EpistemicConstraint instances without redefinition here.
# ==========================================================================

@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix iroko: <https://ontology.irokosociety.org/iroko#> .

<https://ontology.irokosociety.org/iroko-epistemic>
    a owl:Ontology ;
    dcterms:title "Iroko Framework: Epistemic Module"@en ;
    dcterms:description "Governance Layer module. Optional module for modeling epistemic constraints and disclosure permissions — knowledge gating in sovereignty-aware archives. Enables archives to express conditions under which knowledge may be disclosed, withheld, transformed, or restricted without encoding the restricted knowledge itself. Distinct from iroko:accessLevel (who may access) — epistemic constraints govern the conditions and basis of disclosure. Commonly paired with iroko-authority."@en ;
    dcterms:creator "Iroko Historical Society" ;
    dcterms:issued "2026-02-23"^^xsd:date ;
    dcterms:modified "2026-02-25"^^xsd:date ;
    owl:versionInfo "1.3.0" ;
    owl:versionIRI <https://ontology.irokosociety.org/iroko-epistemic/1.3.0> ;
    dcterms:license <https://creativecommons.org/publicdomain/zero/1.0/> ;
    dcterms:isPartOf <https://ontology.irokosociety.org/iroko-framework/> ;
    dcterms:requires <https://ontology.irokosociety.org/iroko-core> ;
    dcterms:references <https://ontology.irokosociety.org/iroko-authority> ;
    rdfs:seeAlso <https://ontology.irokosociety.org/iroko-framework/> .


# ===========================================================================
# CLASSES
# ===========================================================================

iroko:EpistemicConstraint
    a owl:Class ;
    rdfs:label "Epistemic Constraint"@en ;
    rdfs:comment "A constraint describing conditions under which knowledge may be disclosed, withheld, transformed, or restricted. The abstract superclass — use DisclosurePermission, DisclosureRestriction, or SanctionedDisclosure for typed instances. iroko:hasTemporalVariation (Core) may be applied to qualify constraints that vary by season, cycle, or ritual state."@en ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .

iroko:DisclosurePermission
    a owl:Class ;
    rdfs:subClassOf iroko:EpistemicConstraint ;
    rdfs:label "Disclosure Permission"@en ;
    rdfs:comment "An epistemic constraint asserting that disclosure is permitted under specified conditions. The conditions may be temporal, initiatory, lineage-bound, or community-mandated."@en ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .

iroko:DisclosureRestriction
    a owl:Class ;
    rdfs:subClassOf iroko:EpistemicConstraint ;
    rdfs:label "Disclosure Restriction"@en ;
    rdfs:comment "An epistemic constraint asserting that disclosure is restricted, limited, or prohibited under specified conditions."@en ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .

iroko:SanctionedDisclosure
    a owl:Class ;
    rdfs:subClassOf iroko:EpistemicConstraint ;
    rdfs:label "Sanctioned Disclosure"@en ;
    rdfs:comment "An epistemic constraint asserting that disclosure is permitted only when explicitly sanctioned by a recognized authority or mandate. Combines permission with a required authorization step."@en ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .

iroko:ConstraintBasis
    a owl:Class ;
    rdfs:subClassOf skos:Concept ;
    rdfs:label "Constraint Basis"@en ;
    rdfs:comment "A SKOS concept describing the basis for an epistemic constraint: initiation, lineage, community mandate, ritual condition, safety, or unknown."@en ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .


# ===========================================================================
# PROPERTIES
# ===========================================================================

iroko:hasEpistemicConstraint
    a owl:ObjectProperty ;
    rdfs:label "has epistemic constraint"@en ;
    rdfs:comment "Associates a record, assertion, access policy, or any resource with an EpistemicConstraint. The constraint governs what may be known about the resource, not merely who may access it — these are related but distinct."@en ;
    rdfs:range iroko:EpistemicConstraint ;
    iroko:minimumAccessLevel iroko:access-public-unrestricted ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .

iroko:hasConstraintBasis
    a owl:ObjectProperty ;
    rdfs:label "has constraint basis"@en ;
    rdfs:comment "Associates an EpistemicConstraint with a ConstraintBasis concept classifying its foundation."@en ;
    rdfs:domain iroko:EpistemicConstraint ;
    rdfs:range iroko:ConstraintBasis ;
    iroko:minimumAccessLevel iroko:access-public-unrestricted ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .

iroko:constraintSanctionedBy
    a owl:ObjectProperty ;
    rdfs:label "constraint sanctioned by"@en ;
    rdfs:comment "Links a SanctionedDisclosure to the iroko:Authority that must sanction the disclosure."@en ;
    rdfs:domain iroko:SanctionedDisclosure ;
    rdfs:range iroko:RitualAuthority ;
    iroko:minimumAccessLevel iroko:access-public-unrestricted ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .

iroko:constraintNote
    a owl:DatatypeProperty ;
    rdfs:label "constraint note"@en ;
    rdfs:comment "Free-text description of the epistemic constraint — what it restricts or permits and why."@en ;
    rdfs:domain iroko:EpistemicConstraint ;
    rdfs:range rdf:langString ;
    iroko:minimumAccessLevel iroko:access-community-only ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .

iroko:constraintCondition
    a owl:DatatypeProperty ;
    rdfs:label "constraint condition"@en ;
    rdfs:comment "Explicit condition statement for this constraint. May reference initiation levels, temporal variation, community mandate, or ritual state. Complements iroko:hasTemporalVariation for non-temporal conditions."@en ;
    rdfs:domain iroko:EpistemicConstraint ;
    rdfs:range rdf:langString ;
    iroko:minimumAccessLevel iroko:access-community-only ;
    rdfs:isDefinedBy <https://ontology.irokosociety.org/iroko-epistemic> .

# NOTE: Use iroko:hasTemporalVariation (Core) on EpistemicConstraint
# instances to qualify seasonal or cycle-bound variations:
#   <iroko:someConstraint> iroko:hasTemporalVariation <iroko:TemporalVariation/...> .


# ===========================================================================
# CONCEPT SCHEME: Constraint Basis
# ===========================================================================

iroko:ConstraintBasisScheme
    a skos:ConceptScheme ;
    rdfs:label "Constraint Bases"@en ;
    dcterms:description "Controlled terms describing the foundation for epistemic constraints on sacred knowledge."@en ;
    skos:hasTopConcept iroko:basis-initiation,
                       iroko:basis-lineage,
                       iroko:basis-gender-regime,
                       iroko:basis-community-mandate,
                       iroko:basis-ritual-condition,
                       iroko:basis-safety,
                       iroko:basis-temporal,
                       iroko:basis-unknown .

iroko:basis-initiation
    a iroko:ConstraintBasis ;
    skos:inScheme iroko:ConstraintBasisScheme ;
    skos:prefLabel "Initiation"@en ;
    skos:definition "Constraint basis asserted as initiation level or initiatory boundary. Knowledge may not cross to the uninitiated."@en .

iroko:basis-lineage
    a iroko:ConstraintBasis ;
    skos:inScheme iroko:ConstraintBasisScheme ;
    skos:prefLabel "Lineage"@en ;
    skos:definition "Constraint basis asserted as lineage affiliation. Knowledge belongs to a specific transmission line."@en .

iroko:basis-gender-regime
    a iroko:ConstraintBasis ;
    skos:inScheme iroko:ConstraintBasisScheme ;
    skos:prefLabel "Gender Regime"@en ;
    skos:definition "Constraint basis asserted as a tradition-specific gender regime governing access. These are culturally defined and may be contested — model with iroko:contestedStatus where appropriate."@en ;
    skos:scopeNote "Gender-based constraints vary significantly across lineages and are often the subject of active debate. Record the constraint as asserted; use iroko:contestedStatus and iroko:assertionStatus to represent disputed cases."@en .

iroko:basis-community-mandate
    a iroko:ConstraintBasis ;
    skos:inScheme iroko:ConstraintBasisScheme ;
    skos:prefLabel "Community Mandate"@en ;
    skos:definition "Constraint basis asserted as a community mandate or collective governance decision."@en .

iroko:basis-ritual-condition
    a iroko:ConstraintBasis ;
    skos:inScheme iroko:ConstraintBasisScheme ;
    skos:prefLabel "Ritual Condition"@en ;
    skos:definition "Constraint basis asserted as a ritual state or condition — mourning period, ritual preparation, post-initiation obligation, etc."@en .

iroko:basis-safety
    a iroko:ConstraintBasis ;
    skos:inScheme iroko:ConstraintBasisScheme ;
    skos:prefLabel "Safety"@en ;
    skos:definition "Constraint basis asserted as safety or harm prevention — knowledge that could cause spiritual, physical, or social harm if disclosed."@en .

iroko:basis-temporal
    a iroko:ConstraintBasis ;
    skos:inScheme iroko:ConstraintBasisScheme ;
    skos:prefLabel "Temporal"@en ;
    skos:definition "Constraint basis asserted as time-bound — a festival period, mourning cycle, ritual season, or other temporal regime. Use with iroko:hasTemporalVariation for structured modeling."@en .

iroko:basis-unknown
    a iroko:ConstraintBasis ;
    skos:inScheme iroko:ConstraintBasisScheme ;
    skos:prefLabel "Unknown"@en ;
    skos:definition "Constraint basis not known or not recorded."@en .
