@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.5.0"^^xsd:string ;
    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.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: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: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: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 ;
    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 aligns with the deontic principle that obligation presupposes capacity (Govindarajulu and Bringsjord 2017): 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 .

###############################################################
# 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:0000300 ;  # IAO:document
    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 has access to a resource (case context)
proeth-core:availableTo a owl:ObjectProperty ;
    rdfs:domain proeth-core:Resource ;
    rdfs:range proeth-core:Role ;  # agents in roles
    rdfs:label "available to"@en ;
    rdfs:comment "Indicates which agent(s) in the case scenario have access to this resource. Distinguishes resources available to case participants from those cited by analysts."@en ;
    skos:definition "Relates a Resource to a Role indicating who can access or use 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:Role ;  # BER, etc.
    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 available resources."@en ;
    skos:definition "Relates a Resource to a Role indicating who cited it as authority."@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:0000300 iao:0000310)  # document or document part
    ] ;
    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 .

###############################################################
# 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 .

# 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