PREFIX cso: <https://cathexis.health/ontology/cso/v1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

cso:Territory a sh:NodeShape ;
  rdfs:comment "A distinct pattern of neurobiological organization. Not a diagnosis; describes how a person's nervous system is currently organized and what that organization feels like from the inside. In Pessoa's terms, a characteristic pattern of dynamic functional coalition formation." ;
  sh:closed false ;
  sh:property [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 0
  ] , [
    sh:name "blanket configuration" ;
    sh:description "The characteristic blanket organization pattern for a territory." ;
    sh:path cso:blanketConfiguration ;
    sh:class cso:BlanketConfiguration ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:order 1
  ] , [
    sh:name "affect configuration" ;
    sh:description "The characteristic Panksepp affect system configuration for a territory." ;
    sh:path cso:affectConfiguration ;
    sh:datatype xsd:string ;
    sh:nodeKind sh:Literal ;
    sh:order 2
  ] , [
    sh:name "change mechanism" ;
    sh:description "The primary therapeutic change mechanism for a territory." ;
    sh:path cso:changeMechanism ;
    sh:class cso:ChangeMechanism ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:order 3
  ] , [
    sh:name "territory number" ;
    sh:path cso:territoryNumber ;
    sh:datatype xsd:integer ;
    sh:nodeKind sh:Literal ;
    sh:order 4
  ] ;
  sh:targetClass cso:Territory .

cso:BronfenbrennerLayer a sh:NodeShape ;
  rdfs:comment "An ecological systems layer from Bronfenbrenner's developmental ecology. Used to classify external state entities by their proximity and influence type." ;
  sh:closed false ;
  sh:property [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 0
  ] ;
  sh:targetClass cso:BronfenbrennerLayer .

cso:BodyZone a sh:NodeShape ;
  rdfs:comment "An anatomical zone for somatic data capture. Each zone has defined clinical significance derived from its role in somatic therapy." ;
  sh:closed false ;
  sh:property [
    sh:name "zone number" ;
    sh:path cso:zoneNumber ;
    sh:datatype xsd:integer ;
    sh:nodeKind sh:Literal ;
    sh:order 0
  ] , [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 1
  ] ;
  sh:targetClass cso:BodyZone .

cso:MechanismType a sh:NodeShape ;
  rdfs:comment "A type of therapeutic intervention mechanism with defined neurobiological action." ;
  sh:closed false ;
  sh:property [
    sh:name "serves territory" ;
    sh:description "A mechanism type that serves a specific territory." ;
    sh:path cso:servesTerritory ;
    sh:class cso:Territory ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:order 0
  ] , [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 1
  ] ;
  sh:targetClass cso:MechanismType .

cso:BrainRegion a sh:NodeShape ;
  rdfs:comment "A brain region rendered in the Neural Net visualization. Each region participates in multiple functional networks with graded membership (Pessoa). Activation is always distributed across multiple co-participating regions; no single region produces a given emotion (Barrett + Pessoa design constraint)." ;
  sh:closed false ;
  sh:property [
    sh:name "primary territories" ;
    sh:description "Territories for which a brain region carries the strongest clinical signal." ;
    sh:path cso:primaryTerritories ;
    sh:class cso:Territory ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:order 0
  ] , [
    sh:name "Panksepp affects" ;
    sh:description "Primary affect systems associated with a brain region." ;
    sh:path cso:pankseppAffects ;
    sh:class cso:AffectSystem ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:order 1
  ] , [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 2
  ] , [
    sh:name "anatomical name" ;
    sh:description "The neuroanatomical name for a brain region. Only shown at deep zoom level." ;
    sh:path cso:anatomicalName ;
    sh:datatype xsd:string ;
    sh:nodeKind sh:Literal ;
    sh:order 3
  ] , [
    sh:name "is rich club hub" ;
    sh:description "Whether this brain region is a Pessoa rich club hub with dense cross-network connectivity." ;
    sh:path cso:isRichClubHub ;
    sh:datatype xsd:boolean ;
    sh:nodeKind sh:Literal ;
    sh:order 4
  ] ;
  sh:targetClass cso:BrainRegion .

cso:AffectSystem a sh:NodeShape ;
  rdfs:comment "One of Panksepp's seven genetically encoded primary affect systems with distinct neural circuitry." ;
  sh:closed false ;
  sh:property [
    sh:name "neural substrate" ;
    sh:path cso:neuralSubstrate ;
    sh:datatype xsd:string ;
    sh:nodeKind sh:Literal ;
    sh:order 0
  ] , [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 1
  ] ;
  sh:targetClass cso:AffectSystem .

cso:IntelligenceLayer a sh:NodeShape ;
  rdfs:comment "A level of pattern detection sophistication over somatic data. Each layer has distinct regulatory implications." ;
  sh:closed false ;
  sh:property [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 0
  ] ;
  sh:targetClass cso:IntelligenceLayer .

cso:ChangeMechanism a sh:NodeShape ;
  rdfs:comment "A therapeutic change mechanism, each engaging a distinct memory system." ;
  sh:closed false ;
  sh:property [
    sh:name "memory system" ;
    sh:path cso:memorySystem ;
    sh:datatype xsd:string ;
    sh:nodeKind sh:Literal ;
    sh:order 0
  ] , [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 1
  ] ;
  sh:targetClass cso:ChangeMechanism .

cso:BrainNetwork a sh:NodeShape ;
  rdfs:comment "A large-scale functional network. Networks are the meaningful functional unit (Pessoa Principle 3): the same region participates in multiple networks with graded membership." ;
  sh:closed false ;
  sh:property [
    sh:name "has region" ;
    sh:description "A brain network that includes a specific brain region." ;
    sh:path cso:hasRegion ;
    sh:class cso:BrainRegion ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:order 0
  ] , [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 1
  ] ;
  sh:targetClass cso:BrainNetwork .

cso:SomaticEntity a sh:NodeShape ;
  rdfs:comment "Abstract base class for all entities in the Cathexis Somatic Ontology." ;
  sh:closed false ;
  sh:property [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 0
  ] ;
  sh:targetClass cso:SomaticEntity .

cso:BlanketConfiguration a sh:NodeShape ;
  rdfs:comment "A characteristic pattern of Markov blanket organization shared by related territories." ;
  sh:closed false ;
  sh:property [
    sh:name "therapeutic direction" ;
    sh:path cso:therapeuticDirection ;
    sh:datatype xsd:string ;
    sh:nodeKind sh:Literal ;
    sh:order 0
  ] , [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 1
  ] ;
  sh:targetClass cso:BlanketConfiguration .

cso:SomaticSnapshot a sh:NodeShape ;
  rdfs:comment "A complete body state at a single moment: the composite portrait of all active zones. Contains one or more SomaticDataPoints." ;
  sh:closed false ;
  sh:property [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 0
  ] ;
  sh:targetClass cso:SomaticSnapshot .

cso:SomaticDataPoint a sh:NodeShape ;
  rdfs:comment "A single sensation report: where in the body (zone), what kind (quality), how intense (0.0-1.0), how the user relates to it (valence). The atomic unit of somatic data." ;
  sh:closed false ;
  sh:property [
    sh:name "intensity" ;
    sh:description "Sensation intensity on a continuous 0.0-1.0 scale." ;
    sh:path cso:intensity ;
    sh:datatype xsd:float ;
    sh:nodeKind sh:Literal ;
    sh:order 0
  ] , [
    sh:name "quality" ;
    sh:description "The phenomenological sensation quality reported." ;
    sh:path cso:quality ;
    sh:in ( cso:tightness cso:pressure cso:contraction cso:vibration cso:expansion cso:trembling cso:heaviness cso:stillness cso:pulsing cso:lightness cso:buzzing cso:hollow cso:nausea cso:floating cso:tingling cso:ache cso:cold cso:heat cso:pain cso:numbness ) ;
    sh:order 1
  ] , [
    sh:name "zone" ;
    sh:description "The anatomical zone where a sensation was reported." ;
    sh:path cso:zone ;
    sh:class cso:BodyZone ;
    sh:nodeKind sh:BlankNodeOrIRI ;
    sh:order 2
  ] , [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 3
  ] ;
  sh:targetClass cso:SomaticDataPoint .

cso:LearningLevel a sh:NodeShape ;
  rdfs:comment "One of six universal progression levels. Content differs by territory; structure is universal. Each level is a prerequisite for the next." ;
  sh:closed false ;
  sh:property [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 0
  ] ;
  sh:targetClass cso:LearningLevel .

cso:SomaticTrajectory a sh:NodeShape ;
  rdfs:comment "A body state over time: ordered snapshots with computed per-zone aggregate statistics." ;
  sh:closed false ;
  sh:property [
    sh:name "blanket component" ;
    sh:description "The primary Markov blanket component this entity belongs to." ;
    sh:path cso:blanketComponent ;
    sh:in ( cso:ExternalState cso:SensoryState cso:InternalState cso:ActiveState ) ;
    sh:order 0
  ] ;
  sh:targetClass cso:SomaticTrajectory .
