@prefix : <http://proethica.org/ontology/core#> .
@prefix proeth-core: <http://proethica.org/ontology/core#> .
@prefix bfo: <http://purl.obolibrary.org/obo/BFO_> .
@prefix iao: <http://purl.obolibrary.org/obo/IAO_> .
@prefix ro: <http://purl.obolibrary.org/obo/RO_> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@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 skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix time: <http://www.w3.org/2006/time#> .

# Ontology Declaration
<http://proethica.org/ontology/core> a owl:Ontology ;
    rdfs:label "ProEthica Core Ontology"@en ;
    dc:creator "ProEthica AI"@en ;
    dc:date "2026-02-19"^^xsd:date ;
    rdfs:comment "Core ontology defining the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs) with CodeProvision extension for ethics code integration."@en ;
    owl:versionInfo "2.7.2"^^xsd:string ;
    owl:imports <http://proethica.org/ontology/foundation> ;
    owl:imports <http://purl.obolibrary.org/obo/bfo.owl> ;
    owl:imports <http://purl.obolibrary.org/obo/iao.owl> ;
    owl:imports <http://purl.obolibrary.org/obo/ro.owl> ;
    owl:imports <http://www.w3.org/2006/time#> ;
    dc:description "Version 2.7.2 grounds the role and action relations in the OBO Relations Ontology and imports the curated proethica-foundation stub (a BFO/IAO/RO subset declared locally so the alignment resolves and is reasoned). hasRole was already subPropertyOf ro:has_role; v2.7.2 adds isRoleOf (inverse of hasRole) subPropertyOf ro:role_of, and grounds performsAction subPropertyOf ro:participates_in and isPerformedBy subPropertyOf ro:has_participant. The normative participant edges (obligatedParty, constrainedEntity, invokedBy) are deliberately NOT grounded under ro:has_participant: their subject is an information content entity, not a process, so process-participation does not apply (the same reason v2.3.0 removed has_participant from fulfillsObligation). Version 2.7.1 asserts Agent disjointWith Role, Capability, and Resource explicitly. These separations would follow from the BFO alignment (material entity versus role, disposition, and information content entity), but the validation harness strips owl:imports and does not load BFO, so without the explicit axiom an individual could be typed both Agent and Role (or Capability, or Resource) with no consistency violation. Agent was already disjoint with Action, Event, State, Principle, Obligation, and Constraint. Version 2.7.0 adds the canonical Event Calculus fluent-transition object properties initiates and terminates (a happening, Action or Event, initiates or terminates a State/fluent; Kowalski and Sergot 1986, Berreby et al. 2017), generalising the State-side activatedByEvent / terminatedByEvent to both happening kinds in the happening->State direction so the fluent layer connects the temporal components to the normative ones (Action/Event initiates State, State activatesObligation). Version 2.6.0 adds four participant object properties (obligatedParty, constrainedEntity, possessedBy, invokedBy) that wire the extracted 'who bears / is constrained by / possesses / invokes' fields of Obligation, Constraint, Capability, and Principle into first-class edges to the case Agent, joining the actor-edge family (availableTo, citedByAgent, affects). Their range is Agent, which is outside the nine disjoint D-tuple categories, so each edge is OWL-DL safe; possessedBy is declared owl:inverseOf hasCapability. Version 2.5.0 adds three defeasibility object properties (competesWith, prevailsOver, defeasibleUnder) that expose obligation competition as first-class structural relationships between typed individuals, supporting the architectural claim that defeasible patterns are queryable via SPARQL and available to external non-monotonic engines. Version 2.3.0 corrected BFO/IAO superclass alignments following formal audit against BFO 2020 (ISO/IEC 21838-2) and IAO definitions: Resource from independent continuant to information content entity; State from quality to specifically dependent continuant; Obligation refined to directive information entity (Donohue 2017); Principle and Constraint refined to directive information entity based on their prescriptive character (Frankel 1989, Ganascia 2007, Dennis et al. 2016); Capability from realizable entity to disposition."@en .

###############################################################
# Core Formal Specification Classes -- BFO 2020 / IAO Aligned (v2.3.0)
###############################################################

# R - Role: Professional roles with BFO alignment
proeth-core:Role a owl:Class ;
    rdfs:subClassOf bfo:0000023 ;  # BFO:role
    rdfs:label "Role"@en ;
    rdfs:comment "A role that can be realized by processes involving professional duties and ethical obligations. This is the R component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:definition "A role that can be realized by processes involving professional duties and ethical obligations. This is the R component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en .

# P - Principle: Ethical principles as directive information entities
proeth-core:Principle a owl:Class ;
    rdfs:subClassOf iao:0000033 ;  # IAO:directive information entity
    rdfs:label "Principle"@en ;
    rdfs:comment "A directive information entity representing ethical values and guidelines for conduct. Principles prescribe professional behavior and gain operational meaning through accumulated case precedents (McLaren 2003). This is the P component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:definition "A directive information entity representing ethical values and guidelines for conduct. This is the P component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:changeNote "v2.3.0: Refined from IAO:information content entity to IAO:directive information entity. Professional principles occupy the aspirational level of code hierarchies (Frankel 1989) and function analogously to constitutional provisions requiring interpretation in context (Taddeo et al. 2024). Their prescriptive character (world-to-word fit) distinguishes them from descriptive information content."@en .

# O - Obligation: Professional obligations as directive information entities (Donohue 2017)
proeth-core:Obligation a owl:Class ;
    rdfs:subClassOf iao:0000033 ;  # IAO:directive information entity
    rdfs:label "Obligation"@en ;
    rdfs:comment "A directive information entity expressing required actions or behaviors in professional contexts. Obligations prescribe conduct and, when concretized by an agent, guide compliant behavior. This is the O component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:definition "A directive information entity expressing required actions or behaviors in professional contexts. This is the O component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:changeNote "v2.3.0: Refined from IAO:information content entity to IAO:directive information entity per Donohue (ICBO 2017) analysis of deontic entities in BFO-aligned ontologies."@en .

# S - State: Professional states as specifically dependent continuants
proeth-core:State a owl:Class ;
    rdfs:subClassOf bfo:0000020 ;  # BFO:specifically dependent continuant
    rdfs:label "State"@en ;
    rdfs:comment "A specifically dependent continuant representing conditions that affect ethical decisions and professional conduct. States span the quality-disposition boundary: some are monadic qualities of individual bearers (competence gaps, financial pressures) while others are relational or situational conditions (conflicts of interest, stakeholder divisions). This is the S component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:definition "A specifically dependent continuant representing conditions that affect ethical decisions and professional conduct. This is the S component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:changeNote "v2.3.0: Changed from BFO:quality to BFO:specifically dependent continuant. ProEthica States include relational and situational conditions that do not fit the strict BFO definition of quality (which requires inherence in a single bearer). SDC is the common parent of quality and realizable entity."@en .

# Rs - Resource: Professional knowledge sources as information content entities
proeth-core:Resource a owl:Class ;
    rdfs:subClassOf iao:0000030 ;  # IAO:information content entity
    rdfs:label "Resource"@en ;
    rdfs:comment "An information content entity that serves as a professional knowledge source for ethical decision-making. Resources include codes of ethics, case precedents, technical standards, and expert interpretations -- all generically dependent continuants with descriptive content about professional practice. This is the Rs component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:definition "An information content entity that serves as a professional knowledge source for ethical decision-making. This is the Rs component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:changeNote "v2.3.0: Changed from BFO:independent continuant to IAO:information content entity. All extracted resources (codes, precedents, standards, interpretations) are generically dependent continuants, not independent continuants. Resources are descriptive ICEs (they describe existing professional knowledge) as distinct from the prescriptive ICEs (P, O, Cs) that direct conduct."@en .

# A - Action: Professional actions as processes
proeth-core:Action a owl:Class ;
    rdfs:subClassOf bfo:0000015 ;  # BFO:process
    rdfs:label "Action"@en ;
    rdfs:comment "A process directed toward achieving specific goals in professional contexts. This is the A component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:definition "A process directed toward achieving specific goals in professional contexts. This is the A component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en .

# E - Event: Professional events as processes  
proeth-core:Event a owl:Class ;
    rdfs:subClassOf bfo:0000015 ;  # BFO:process
    rdfs:label "Event"@en ;
    rdfs:comment "A process that occurs in professional contexts, which may or may not involve intentional agency. This is the E component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:definition "A process that occurs in professional contexts, which may or may not involve intentional agency. This is the E component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en .

# Ca - Capability: Professional capabilities as dispositions
proeth-core:Capability a owl:Class ;
    rdfs:subClassOf bfo:0000016 ;  # BFO:disposition
    rdfs:label "Capability"@en ;
    rdfs:comment "A disposition that inheres in a professional agent and is realized through professional activities. Capabilities represent skills, competencies, and abilities that exist as potentials and are realized when the agent performs corresponding actions. This is the Ca component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:definition "A disposition that inheres in a professional agent and is realized through professional activities. This is the Ca component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:changeNote "v2.3.0: Reverted from BFO:realizable entity to BFO:disposition. Extracted capabilities (technical skills, ethical reasoning abilities, communication competencies) are dispositions -- they inhere in individual bearers and are realized through professional processes. Disposition is the more precise subclass of realizable entity."@en .

# Cs - Constraint: Professional constraints as directive information entities
proeth-core:Constraint a owl:Class ;
    rdfs:subClassOf iao:0000033 ;  # IAO:directive information entity
    rdfs:label "Constraint"@en ;
    rdfs:comment "A directive information entity expressing limitations or restrictions on professional actions or decisions. Constraints prescribe boundaries on permissible conduct. This is the Cs component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:definition "A directive information entity expressing limitations or restrictions on professional actions or decisions. This is the Cs component of the formal specification D=(R,P,O,S,Rs,A,E,Ca,Cs)."@en ;
    skos:changeNote "v2.3.0: Refined from IAO:information content entity to IAO:directive information entity. Constraints define the permissible space of action through negative behavioral limits (Arkin 2008) and prohibitions specifying what must not be done (Ganascia 2007). Their specification of prohibited actions under temporal and contextual conditions (Dennis et al. 2016) constitutes directive content."@en .

###############################################################
# CodeProvision: Extension for Ethics Code Integration
# Added: 2026-01-12 - Support for representing guideline provisions
###############################################################

# CodeProvision: Individual provisions from codes of ethics
proeth-core:CodeProvision a owl:Class ;
    rdfs:subClassOf iao:0000030 ;  # IAO:information content entity
    rdfs:label "Code Provision"@en ;
    rdfs:comment "An information content entity representing a single provision, section, or rule from a professional code of ethics (e.g., NSPE Code of Ethics, NEA Code of Ethics). Provisions establish the normative foundation from which Principles, Obligations, and Constraints are derived."@en ;
    skos:definition "A discrete normative statement from a code of ethics that establishes ethical requirements for professional conduct."@en ;
    skos:example "NSPE Code II.1.c: 'Engineers shall not reveal facts, data, or information without the prior consent of the client or employer except as authorized or required by law or this Code.'"@en ;
    skos:scopeNote "CodeProvisions serve as the authoritative source for derived ethical concepts. When analyzing cases, provisions are cited to justify the application of principles and obligations."@en .

# Guideline: Container for provisions (the full code document)
proeth-core:Guideline a owl:Class ;
    rdfs:subClassOf iao:0000310 ;  # IAO:document (IAO_0000310 = "document"; codes of ethics are documents)
    rdfs:label "Guideline"@en ;
    rdfs:comment "A professional code of ethics or guideline document containing multiple provisions. Examples include NSPE Code of Ethics, NEA Code of Ethics, ACM Code of Ethics."@en ;
    skos:definition "A formal document establishing ethical standards for a profession, containing individual CodeProvisions."@en .

# Agent: Supporting class for role bearers
proeth-core:Agent a owl:Class ;
    rdfs:subClassOf bfo:0000040 ;  # BFO:material entity
    rdfs:label "Agent"@en ;
    rdfs:comment "A material entity capable of bearing roles and performing intentional actions in professional contexts."@en ;
    skos:definition "A material entity capable of bearing roles and performing intentional actions in professional contexts."@en .

###############################################################
# Core Object Properties 
###############################################################

proeth-core:hasRole a owl:ObjectProperty ;
    rdfs:subPropertyOf ro:0000087 ;  # RO:has role
    rdfs:domain proeth-core:Agent ;
    rdfs:range proeth-core:Role ;
    rdfs:label "has role"@en ;
    rdfs:comment "Relates an agent to a role it bears."@en ;
    skos:definition "Relates an agent to a role it bears."@en .

proeth-core:isRoleOf a owl:ObjectProperty ;
    owl:inverseOf proeth-core:hasRole ;
    rdfs:subPropertyOf ro:0000081 ;  # RO:role of
    rdfs:domain proeth-core:Role ;
    rdfs:range proeth-core:Agent ;
    rdfs:label "is role of"@en ;
    rdfs:comment "Relates a role to the agent that bears it. Inverse of hasRole, so the reasoner sees both directions from one asserted edge. Grounded under RO:role of (v2.7.2)."@en ;
    skos:definition "Relates a Role to the Agent who bears it. Inverse of hasRole."@en .

proeth-core:hasObligation a owl:ObjectProperty ;
    rdfs:domain proeth-core:Role ;
    rdfs:range proeth-core:Obligation ;
    rdfs:label "has obligation"@en ;
    rdfs:comment "Relates a role to its professional obligations."@en ;
    skos:definition "Relates a role to its professional obligations."@en .

proeth-core:adheresToPrinciple a owl:ObjectProperty ;
    rdfs:domain proeth-core:Role ;
    rdfs:range proeth-core:Principle ;
    rdfs:label "adheres to principle"@en ;
    rdfs:comment "Relates a role to principles that guide its conduct."@en ;
    skos:definition "Relates a role to principles that guide its conduct."@en ;
    skos:changeNote "v2.3.0: Removed subPropertyOf iao:0000136 (is about). The is_about relation links information content to what it represents; adheresToPrinciple links a role to the directive content that governs it, which is a different semantic relation."@en .

proeth-core:hasCapability a owl:ObjectProperty ;
    rdfs:domain proeth-core:Agent ;
    rdfs:range proeth-core:Capability ;
    rdfs:label "has capability"@en ;
    rdfs:comment "Relates an agent to capabilities they possess."@en ;
    skos:definition "Relates an agent to capabilities they possess."@en .

proeth-core:performsAction a owl:ObjectProperty ;
    rdfs:subPropertyOf ro:0000056 ;  # RO:participates in (a continuant participates in a process)
    rdfs:domain proeth-core:Agent ;
    rdfs:range proeth-core:Action ;
    rdfs:label "performs action"@en ;
    rdfs:comment "Relates an agent to actions they perform."@en ;
    skos:definition "Relates an agent to actions they perform."@en .

proeth-core:isPerformedBy a owl:ObjectProperty ;
    owl:inverseOf proeth-core:performsAction ;
    rdfs:subPropertyOf ro:0000057 ;  # RO:has participant (a process has a continuant participant)
    rdfs:domain proeth-core:Action ;
    rdfs:range proeth-core:Agent ;
    rdfs:label "is performed by"@en ;
    rdfs:comment "Relates an action to the agent that performs it. Inverse of performsAction."@en ;
    skos:definition "Relates an action to the agent responsible for performing it."@en ;
    skos:changeNote "v2.4.1: Added as named inverse of performsAction to support OWL DL-compliant cardinality restriction on Action."@en .

proeth-core:fulfillsObligation a owl:ObjectProperty ;
    rdfs:domain proeth-core:Action ;
    rdfs:range proeth-core:Obligation ;
    rdfs:label "fulfills obligation"@en ;
    rdfs:comment "Relates an action to obligations it fulfills. The action realizes the directive content of the obligation."@en ;
    skos:definition "Relates an action to obligations it fulfills."@en ;
    skos:changeNote "v2.3.0: Removed subPropertyOf ro:0000057 (has participant). RO:has_participant relates a process to an independent continuant that participates in it. Obligations are directive information entities (generically dependent continuants), not process participants in the BFO sense."@en .

proeth-core:realizesCapability a owl:ObjectProperty ;
    rdfs:domain proeth-core:Action ;
    rdfs:range proeth-core:Capability ;
    rdfs:label "realizes capability"@en ;
    rdfs:comment "Relates an action to capabilities it realizes."@en ;
    skos:definition "Relates an action to capabilities it realizes."@en .

proeth-core:hasState a owl:ObjectProperty ;
    rdfs:domain proeth-core:Action ;
    rdfs:range proeth-core:State ;
    rdfs:label "has state"@en ;
    rdfs:comment "Relates an action to contextual states that affect its evaluation. NOTE: BFO strict interpretation requires SDCs to inhere in independent continuants, not processes. This property is an intentional pragmatic deviation -- it links a process to contextual SDCs (e.g., emergency conditions, competence states) that affect its ethical evaluation, without reifying the SDC-bearer-process chain."@en ;
    skos:definition "Relates an action to contextual states that affect its evaluation."@en ;
    skos:changeNote "v2.4.2: Documented as intentional pragmatic deviation from strict BFO. The domain (Action/process) to range (State/SDC) link is retained because the alternative (reifying the independent continuant bearer for each state) would add modeling complexity disproportionate to the extraction use case."@en .

proeth-core:usesResource a owl:ObjectProperty ;
    rdfs:domain proeth-core:Action ;
    rdfs:range proeth-core:Resource ;
    rdfs:label "uses resource"@en ;
    rdfs:comment "Relates an action to resources it utilizes."@en ;
    skos:definition "Relates an action to resources it utilizes."@en .

proeth-core:triggersEvent a owl:ObjectProperty ;
    rdfs:subPropertyOf ro:0002411 ;  # RO:causally upstream of (RO_0002411)
    rdfs:domain proeth-core:Action ;
    rdfs:range proeth-core:Event ;
    rdfs:label "triggers event"@en ;
    rdfs:comment "Relates an action to events it causes or initiates."@en ;
    skos:definition "Relates an action to events it causes or initiates."@en ;
    skos:changeNote "v2.4.1: Corrected RO IRI from non-existent ro:0000012 to ro:0002411 (causally upstream of). RO_0002411 is the correct IRI for 'causally upstream of' in the OBO Relations Ontology."@en .

proeth-core:constrainedBy a owl:ObjectProperty ;
    rdfs:domain proeth-core:Action ;
    rdfs:range proeth-core:Constraint ;
    rdfs:label "constrained by"@en ;
    rdfs:comment "Relates an action to constraints that limit or restrict it."@en ;
    skos:definition "Relates an action to constraints that limit or restrict it."@en .

###############################################################
# Defeasibility Relations (v2.5.0)
# Added: 2026-04-11 - Structural support for obligation competition
#
# These three properties expose the defeasibility pattern described in the
# D-tuple formalism as first-class object properties between typed
# individuals, rather than leaving the pattern implicit in class names or
# narrative datatype fields. They do NOT encode non-monotonic inference
# (OWL-DL cannot); they make the competing-obligation structure queryable
# via SPARQL and available to external non-monotonic engines.
#
# Usage guidance:
#   O1  proeth-core:competesWith     O2   (symmetric; two obligations in tension)
#   O2  proeth-core:prevailsOver     O1   (directed; winner under defeat conditions)
#   O1  proeth-core:defeasibleUnder  S    (obligation yields when state S obtains)
###############################################################

proeth-core:competesWith a owl:ObjectProperty, owl:SymmetricProperty ;
    rdfs:domain proeth-core:Obligation ;
    rdfs:range proeth-core:Obligation ;
    rdfs:label "competes with"@en ;
    rdfs:comment "Relates an obligation to another obligation with which it stands in normative tension within a case. Symmetric: if O1 competes with O2 then O2 competes with O1. Does not itself specify which obligation prevails; use prevailsOver for the directed resolution."@en ;
    skos:definition "Links two Obligations that are in direct normative competition within a case scenario."@en ;
    skos:scopeNote "Typical pattern: an obligation derived from one Principle competes with an obligation derived from another Principle of the same professional code, or with an obligation that inherits from a role-level constraint."@en .

proeth-core:prevailsOver a owl:ObjectProperty, owl:AsymmetricProperty, owl:IrreflexiveProperty ;
    rdfs:domain proeth-core:Obligation ;
    rdfs:range proeth-core:Obligation ;
    rdfs:label "prevails over"@en ;
    rdfs:comment "Relates an obligation to another obligation that it defeats under the conditions of the case. The prevailing obligation retains its force; the defeated obligation is subordinated to it. Use together with defeasibleUnder to record the State that licenses the resolution."@en ;
    skos:definition "Links a prevailing Obligation to a defeated Obligation within a specific case resolution."@en ;
    skos:scopeNote "prevailsOver is NOT a logical override relation in OWL-DL. It records a case-specific resolution of an obligation competition; generalizing across cases is the job of an external non-monotonic engine."@en .

proeth-core:defeasibleUnder a owl:ObjectProperty ;
    rdfs:domain proeth-core:Obligation ;
    rdfs:range proeth-core:State ;
    rdfs:label "defeasible under"@en ;
    rdfs:comment "Relates an obligation to a State whose obtaining renders the obligation defeasible, that is, subject to override by a competing obligation with stronger normative support. The State specifies the context in which the obligation yields."@en ;
    skos:definition "Links an Obligation to a State whose obtaining activates the obligation's defeasibility."@en ;
    skos:scopeNote "Typical pattern: an obligation that normally holds becomes defeasible when a State representing risk, harm, or unrealizability obtains. This reflects the deontic principle that obligation presupposes capacity (Stenseke 2024): an Obligation is defeasible when the agent lacks the Capability required to fulfill it, or when fulfilling it would cause a harm the role exists to prevent."@en .

###############################################################
# State-anchored structural properties (2026-05-30)
# Materialize the state-extraction linkages that drive the methodology:
#   S activatesObligation O   (a state makes an obligation applicable; the
#                              forward complement of defeasibleUnder's yielding)
#   S activatesConstraint Cs  (a state activates an action constraint)
#   S activatedByEvent E      (Event Calculus initiation: the event that brings
#                              the state into being)
#   S terminatedByEvent E     (Event Calculus termination: the event that ends it)
# Each is materialized at commit from the extracted state fields and carries a
# prov:Derivation, so the state's role in obligation/constraint activation and
# its temporal boundaries are first-class and SPARQL-queryable.
###############################################################

proeth-core:activatesObligation a owl:ObjectProperty ;
    rdfs:domain proeth-core:State ;
    rdfs:range proeth-core:Obligation ;
    rdfs:label "activates obligation"@en ;
    rdfs:comment "Relates a State whose obtaining makes an Obligation applicable. This is the forward, activating complement of defeasibleUnder (which records the State under which an obligation yields): a State of risk, harm, or commitment can bring an obligation into force for the role-bearers it concerns."@en ;
    skos:definition "Links a State to an Obligation that the State's obtaining renders applicable."@en .

proeth-core:activatesConstraint a owl:ObjectProperty ;
    rdfs:domain proeth-core:State ;
    rdfs:range proeth-core:Constraint ;
    rdfs:label "activates constraint"@en ;
    rdfs:comment "Relates a State whose obtaining activates a Constraint on the actions available to the role-bearers it concerns (the S->Cs linkage)."@en ;
    skos:definition "Links a State to a Constraint that the State's obtaining activates."@en .

proeth-core:activatedByEvent a owl:ObjectProperty ;
    rdfs:domain proeth-core:State ;
    rdfs:range proeth-core:Event ;
    rdfs:label "activated by event"@en ;
    rdfs:comment "Event Calculus initiation: relates a State to the Event whose occurrence brings the State into being (the fluent's start boundary)."@en ;
    skos:definition "Links a State to the Event that initiates it."@en .

proeth-core:terminatedByEvent a owl:ObjectProperty ;
    rdfs:domain proeth-core:State ;
    rdfs:range proeth-core:Event ;
    rdfs:label "terminated by event"@en ;
    rdfs:comment "Event Calculus termination: relates a State to the Event whose occurrence ends the State (the fluent's end boundary)."@en ;
    skos:definition "Links a State to the Event that terminates it."@en .

# Fluent transitions (v2.7.0). The canonical Event Calculus direction (Kowalski and
# Sergot 1986; Berreby et al. 2017): a happening Initiates or Terminates a fluent. Here a
# happening is an Action (volitional) OR an Event (non-volitional), and a fluent is a
# State. These generalise the State-side activatedByEvent / terminatedByEvent (which cover
# Events only, from the State side) to BOTH happening kinds in the happening -> State
# direction, so an action that brings a condition into being is recorded the same way an
# event is. A State (fluent) that holds is the middle term between a happening and its
# normative effect: Action/Event initiates State, then State activatesObligation /
# activatesConstraint. OWL-DL safe: subject is Action or Event and object is State, all
# distinct individuals, so no one individual is forced into two disjoint categories.
proeth-core:initiates a owl:ObjectProperty ;
    rdfs:domain [ a owl:Class ; owl:unionOf ( proeth-core:Action proeth-core:Event ) ] ;
    rdfs:range proeth-core:State ;
    rdfs:label "initiates"@en ;
    rdfs:comment "Event Calculus initiation: relates a happening (Action or Event) to a State (fluent) that begins to hold as a result and persists until terminated (inertial) or holds momentarily (non-inertial)."@en ;
    skos:definition "Links an Action or Event to a State (fluent) it initiates."@en .

proeth-core:terminates a owl:ObjectProperty ;
    rdfs:domain [ a owl:Class ; owl:unionOf ( proeth-core:Action proeth-core:Event ) ] ;
    rdfs:range proeth-core:State ;
    rdfs:label "terminates"@en ;
    rdfs:comment "Event Calculus termination: relates a happening (Action or Event) to a State (fluent) that ceases to hold as a result."@en ;
    skos:definition "Links an Action or Event to a State (fluent) it terminates."@en .

###############################################################
# CodeProvision Properties
# Added: 2026-01-12 - Support for provision-concept linkage
###############################################################

# Relates a provision to the concepts it establishes
proeth-core:establishes a owl:ObjectProperty ;
    rdfs:domain proeth-core:CodeProvision ;
    rdfs:range [
        a owl:Class ;
        owl:unionOf (proeth-core:Principle proeth-core:Obligation proeth-core:Constraint)
    ] ;
    rdfs:label "establishes"@en ;
    rdfs:comment "Relates a code provision to the ethical concepts (principles, obligations, constraints) it establishes or defines."@en ;
    skos:definition "Links a CodeProvision to the normative concepts it creates or reinforces."@en ;
    skos:example "NSPE I.1 establishes PublicSafety (Principle), DutyOfCare (Obligation)"@en .

# Inverse: track which provision establishes a concept
proeth-core:establishedBy a owl:ObjectProperty ;
    owl:inverseOf proeth-core:establishes ;
    rdfs:domain [
        a owl:Class ;
        owl:unionOf (proeth-core:Principle proeth-core:Obligation proeth-core:Constraint)
    ] ;
    rdfs:range proeth-core:CodeProvision ;
    rdfs:label "established by"@en ;
    rdfs:comment "Indicates which code provision establishes this ethical concept."@en ;
    skos:definition "Links a normative concept to the CodeProvision that defines it."@en .

# Relates a provision to its parent guideline
proeth-core:partOfGuideline a owl:ObjectProperty ;
    rdfs:domain proeth-core:CodeProvision ;
    rdfs:range proeth-core:Guideline ;
    rdfs:label "part of guideline"@en ;
    rdfs:comment "Relates a code provision to the guideline document it belongs to."@en ;
    skos:definition "Links a CodeProvision to its containing Guideline document."@en .

# Inverse: guideline contains provisions
proeth-core:containsProvision a owl:ObjectProperty ;
    owl:inverseOf proeth-core:partOfGuideline ;
    rdfs:domain proeth-core:Guideline ;
    rdfs:range proeth-core:CodeProvision ;
    rdfs:label "contains provision"@en ;
    rdfs:comment "Relates a guideline to the provisions it contains."@en ;
    skos:definition "Links a Guideline to the CodeProvisions it contains."@en .

# For case analysis to cite provisions
proeth-core:citesProvision a owl:ObjectProperty ;
    rdfs:range proeth-core:CodeProvision ;
    rdfs:label "cites provision"@en ;
    rdfs:comment "Relates an ethical analysis or decision to the code provisions it references."@en ;
    skos:definition "Links an analysis element to the CodeProvision(s) that justify or support it."@en ;
    skos:scopeNote "Used in case analysis to track which provisions are cited when applying ethical principles."@en .

###############################################################
# CodeProvision Datatype Properties
###############################################################

proeth-core:provisionCode a owl:DatatypeProperty ;
    rdfs:domain proeth-core:CodeProvision ;
    rdfs:range xsd:string ;
    rdfs:label "provision code"@en ;
    rdfs:comment "The alphanumeric code identifying this provision within its guideline (e.g., 'II.1.c', 'P1.3')."@en ;
    skos:definition "The unique identifier code for a provision within its parent guideline."@en .

proeth-core:provisionText a owl:DatatypeProperty ;
    rdfs:domain proeth-core:CodeProvision ;
    rdfs:range xsd:string ;
    rdfs:label "provision text"@en ;
    rdfs:comment "The full normative text of the provision."@en ;
    skos:definition "The complete text content of the code provision."@en .

proeth-core:provisionCategory a owl:DatatypeProperty ;
    rdfs:domain proeth-core:CodeProvision ;
    rdfs:range xsd:string ;
    rdfs:label "provision category"@en ;
    rdfs:comment "The category or section type within the guideline (e.g., 'fundamental_canons', 'rules_of_practice', 'professional_obligations')."@en ;
    skos:definition "Classification of the provision within the guideline structure."@en .

###############################################################
# IAO Document Integration for Resources
# Added: 2025-10-07 - Support for linking Resources to IAO documents
###############################################################

# Link Resource to IAO document
proeth-core:refersToDocument a owl:ObjectProperty ;
    rdfs:domain proeth-core:Resource ;
    rdfs:range iao:0000310 ;  # IAO_0000310 = document (was iao:0000300, which is "textual entity")
    rdfs:label "refers to document"@en ;
    rdfs:comment "Links a resource to the IAO document it represents or references. Used to connect ethical resources (NSPE Code, case precedents) to their document representations."@en ;
    skos:definition "Relates a Resource to an Information Artifact Ontology document that it represents."@en .

# Indicate which agent uses or has access to a resource (case context).
# Range broadened Role -> Agent on 2026-05-30: under the Agent model an actor is
# a proeth-core:Agent that bears Role facets, so resource usage is an actor-level
# fact (the same level hasRole / hasCapability / performsAction attach at). This
# property was previously declared but unused in every case; it is now
# materialized at commit by proethica's resource_edges applier from the extracted
# resource `used_by` field (Resource -> the case Agent(s) that use it), with a
# prov:Derivation carrying the verbatim source text.
proeth-core:availableTo a owl:ObjectProperty ;
    rdfs:domain proeth-core:Resource ;
    rdfs:range proeth-core:Agent ;
    rdfs:label "available to"@en ;
    rdfs:comment "Indicates which Agent(s) in the case scenario use or have access to this resource. Distinguishes resources used by case participants from those cited by analysts (citedByAgent)."@en ;
    skos:definition "Relates a Resource to an Agent indicating who uses or can access it within the case scenario."@en .

# Indicate which agent cited a resource (analytic authority)
proeth-core:citedByAgent a owl:ObjectProperty ;
    rdfs:domain proeth-core:Resource ;
    rdfs:range proeth-core:Agent ;
    rdfs:label "cited by agent"@en ;
    rdfs:comment "Indicates which Agent(s) cited this resource as an authoritative source in their ethical analysis. Distinguishes citations (References section) from resources used by case participants (availableTo). Range broadened Role -> Agent on 2026-05-30 for parity with availableTo: citing is an actor-level fact, like resource usage."@en ;
    skos:definition "Relates a Resource to an Agent indicating who cited it as authority."@en .

# State -> the Agent(s) it affects. Materialized from the state extractor's
# `affectedParties` field (the actors a state bears on), resolved to the case
# Agent(s) by embedding shortlist + LLM multi-select, with a prov:Derivation
# carrying the verbatim party text (added 2026-05-31). Agent is outside the nine
# disjoint D-tuple categories, so a State -> Agent edge is OWL-DL-safe, as with
# availableTo. Generic affected parties ("future occupants and public") match no
# Agent and correctly yield no edge.
proeth-core:affects a owl:ObjectProperty ;
    rdfs:domain proeth-core:State ;
    rdfs:range proeth-core:Agent ;
    rdfs:label "affects"@en ;
    rdfs:comment "Relates a State to the Agent(s) it bears on in the case scenario (the parties whose situation the state changes), distinct from the obligations/constraints the state activates (activatesObligation / activatesConstraint)."@en ;
    skos:definition "Relates a State to an Agent it affects within the case scenario."@en .

# Participant edges (v2.6.0). Each Pass-2 normative component carries an extracted
# field naming the actor it bears on -- the obligation's obligatedParty, the
# constraint's constrainedEntity, the capability's possessedBy, the principle's
# invokedBy. These were committed only as opaque literals (and read by
# rpo_edges/defeasibility as string context); they are now ALSO materialized at
# commit by proethica's participant_edges applier, which resolves the named party
# to the case Agent(s) by embedding shortlist + LLM select, with a prov:Derivation
# carrying the verbatim source text. The literal is retained (the wire-in is
# additive). Range is Agent, which is outside the nine disjoint D-tuple categories,
# so each edge is OWL-DL safe exactly as availableTo / citedByAgent / affects are
# (the object resolves to no disjoint category; the commit-time guard still
# validates the component subject). A generic or institutional party that matches
# no case Agent correctly yields no edge.

proeth-core:obligatedParty a owl:ObjectProperty ;
    rdfs:domain proeth-core:Obligation ;
    rdfs:range proeth-core:Agent ;
    rdfs:label "obligated party"@en ;
    rdfs:comment "Relates an Obligation to the Agent that bears it (Dennis et al. 2016: 'by whom'). The duty-bearer of the obligation in the case scenario."@en ;
    skos:definition "Relates an Obligation to the Agent who is obligated by it."@en .

proeth-core:constrainedEntity a owl:ObjectProperty ;
    rdfs:domain proeth-core:Constraint ;
    rdfs:range proeth-core:Agent ;
    rdfs:label "constrained entity"@en ;
    rdfs:comment "Relates a Constraint to the Agent whose conduct it limits in the case scenario. Distinct from constrainedBy (Action -> Constraint), which records that an action is subject to a constraint."@en ;
    skos:definition "Relates a Constraint to the Agent it constrains."@en .

proeth-core:possessedBy a owl:ObjectProperty ;
    owl:inverseOf proeth-core:hasCapability ;
    rdfs:domain proeth-core:Capability ;
    rdfs:range proeth-core:Agent ;
    rdfs:label "possessed by"@en ;
    rdfs:comment "Relates a Capability to the Agent that possesses it in the case scenario. Inverse of hasCapability (Agent -> Capability), so the reasoner sees both directions from one asserted edge."@en ;
    skos:definition "Relates a Capability to the Agent who possesses it. Inverse of hasCapability."@en .

proeth-core:invokedBy a owl:ObjectProperty ;
    rdfs:domain proeth-core:Principle ;
    rdfs:range proeth-core:Agent ;
    rdfs:label "invoked by"@en ;
    rdfs:comment "Relates a Principle to the Agent(s) that invoke it in the case scenario (the parties who appeal to the principle to justify or evaluate conduct). May name several agents."@en ;
    skos:definition "Relates a Principle to an Agent who invokes it."@en .

# Link normative concepts to cited authorities
proeth-core:citesAuthority a owl:ObjectProperty ;
    rdfs:domain [
        a owl:Class ;
        owl:unionOf (proeth-core:Principle proeth-core:Obligation proeth-core:Constraint)
    ] ;
    rdfs:range [
        a owl:Class ;
        owl:unionOf (iao:0000310 iao:0000314)  # document (IAO_0000310) or document part (IAO_0000314); was iao:0000300 "textual entity"
    ] ;
    rdfs:label "cites authority"@en ;
    rdfs:comment "Links an ethical concept (Principle, Obligation, Constraint) to the authoritative document that establishes or supports it. Used for tracking Board of Ethical Review citations."@en ;
    skos:definition "Relates a normative concept to the IAO document or document part that serves as its authoritative source."@en .

###############################################################
# Actor relations (professional/social relationships between role-bearers)
###############################################################
# RO and BFO provide no social relations such as client, peer, or employer, because
# in BFO such relationships are realized through the roles agents bear. The relational
# role archetypes (ProviderClientRole, ProfessionalPeerRole, and so on) carry the
# relationship TYPE; these properties carry the specific counterparty. Declared
# domain-only (no rdfs:domain or rdfs:range) so a target that is not a role-bearer
# cannot force a disjointness clash. relatedTo is the controlled fallback for
# relationship types not mapped to a more specific relation.

proeth-core:relatedTo a owl:ObjectProperty ;
    rdfs:label "related to"@en ;
    skos:definition "A professional or social relationship between two role-bearing agents whose specific type is not mapped to a more specific actor relation."@en .

proeth-core:hasClient a owl:ObjectProperty ;
    rdfs:subPropertyOf proeth-core:relatedTo ;
    rdfs:label "has client"@en ;
    skos:definition "Relates a provider role-bearer to the client for whom it performs professional service."@en .

proeth-core:professionalPeerOf a owl:ObjectProperty, owl:SymmetricProperty ;
    rdfs:subPropertyOf proeth-core:relatedTo ;
    rdfs:label "professional peer of"@en ;
    skos:definition "Relates two role-bearers in a collegial professional-peer relationship, for example mutual review or mentoring. Symmetric."@en .

proeth-core:employedBy a owl:ObjectProperty ;
    rdfs:subPropertyOf proeth-core:relatedTo ;
    rdfs:label "employed by"@en ;
    skos:definition "Relates a role-bearer to the employer it works for."@en .

proeth-core:reviewsWorkOf a owl:ObjectProperty ;
    rdfs:subPropertyOf proeth-core:relatedTo ;
    rdfs:label "reviews work of"@en ;
    skos:definition "Relates a reviewing role-bearer to the role-bearer whose work it reviews."@en .

proeth-core:workReviewedBy a owl:ObjectProperty ;
    rdfs:subPropertyOf proeth-core:relatedTo ;
    rdfs:label "work reviewed by"@en ;
    skos:definition "Relates a role-bearer to another role-bearer who reviews its work."@en .

###############################################################
# Formal Specification Completeness Constraints
###############################################################

# Ensure every role has at least one obligation
# Using owl:someValuesFrom (OBO/BFO standard existential pattern) rather than
# owl:minCardinality which is unqualified and does not specify the filler type.
proeth-core:Role rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty proeth-core:hasObligation ;
    owl:someValuesFrom proeth-core:Obligation
] .

# Ensure every action is performed by at least one agent
# Uses named inverse property isPerformedBy (OWL DL compliant, no anonymous inverseOf in restriction).
proeth-core:Action rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty proeth-core:isPerformedBy ;
    owl:someValuesFrom proeth-core:Agent
] .

###############################################################
# Enhanced Disjointness Axioms for Ontology Engineering Quality
###############################################################

# CRITICAL BFO-Based Disjointness: Continuants vs Occurrents
# Agent (material entity/continuant) is disjoint from processes (occurrents)
proeth-core:Agent owl:disjointWith proeth-core:Action, proeth-core:Event .

# Role vs Capability conceptual distinction (both realizable entities)
# Role = social/institutional position vs Capability = skill/competence disposition
proeth-core:Role owl:disjointWith proeth-core:Capability .

# Directive ICEs (P, O, Cs) are disjoint from material entities and descriptive ICEs (Rs)
proeth-core:Principle owl:disjointWith proeth-core:Agent, proeth-core:Resource .
proeth-core:Obligation owl:disjointWith proeth-core:Agent, proeth-core:Resource .
proeth-core:Constraint owl:disjointWith proeth-core:Agent, proeth-core:Resource .
proeth-core:CodeProvision owl:disjointWith proeth-core:Agent, proeth-core:Resource .
proeth-core:Guideline owl:disjointWith proeth-core:Agent, proeth-core:Resource .

# Processes (occurrents) are disjoint from continuants
proeth-core:Action owl:disjointWith proeth-core:Agent, proeth-core:Resource, proeth-core:Role, proeth-core:Capability .
proeth-core:Event owl:disjointWith proeth-core:Agent, proeth-core:Resource, proeth-core:Role, proeth-core:Capability .

# SDC (State) is disjoint from material entities, ICEs, and other SDC subtypes
proeth-core:State owl:disjointWith proeth-core:Agent, proeth-core:Resource, proeth-core:Role, proeth-core:Capability .

# Agent (material entity) cannot also be a Role, Capability, or Resource (v2.7.1).
# Asserted explicitly because the validation harness strips owl:imports, so the BFO
# separation (material entity vs role / disposition / information content entity) is not
# loaded. Agent is already disjoint with Action, Event, State, Principle, Obligation,
# and Constraint above.
proeth-core:Agent owl:disjointWith proeth-core:Role, proeth-core:Capability, proeth-core:Resource .

# Core formal specification components remain disjoint
[] a owl:AllDisjointClasses ;
   owl:members ( proeth-core:Role proeth-core:Principle proeth-core:Obligation 
                proeth-core:State proeth-core:Resource proeth-core:Action 
                proeth-core:Event proeth-core:Capability proeth-core:Constraint ) .

# BFO foundational disjointness preservation
[] a owl:AllDisjointClasses ;
   owl:members ( bfo:0000002 bfo:0000003 ) .  # continuant vs occurrent