@prefix core: <http://proethica.org/ontology/core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pcsh: <http://proethica.org/shapes/core#> .
@prefix proeth: <http://proethica.org/ontology/intermediate#> .
@prefix proeth-prov: <http://proethica.org/provenance#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

proeth:PeerReviewConfidentialityBalance a owl:Class ;
    rdfs:label "Peer Review Confidentiality Balance" ;
    proeth:abstractNature "Requires contextual balancing between the legitimate interests served by confidentiality in peer review and the non-waivable obligations of public safety disclosure and collegial notification." ;
    proeth:confidence "0.83" ;
    proeth:derivedObligations "Advise client of limits of confidentiality before signing",
        "Disclose safety violations despite confidentiality agreement",
        "Notify original engineer of review as precondition" ;
    proeth:extensionalExamples "NSPE BER Case 96-8 where contractual confidentiality did not override obligation to report safety code violations to authorities" ;
    proeth:operationalization "Requires that peer review confidentiality agreements be drafted to permit safety disclosures and collegial notifications, and that reviewers understand these limits before accepting confidentiality obligations." ;
    proeth:potentialConflicts "Collegial Notification Principle",
        "Public Safety Paramount" ;
    proeth:principleCategory "relational" ;
    proeth:textReferences "In BER Case 96-8, Engineer A contractually agreed not to disclose confidential information acquired in the review... Engineer A had an obligation to immediately discuss these issues with Engineer B in order to seek clarification and resolution.",
        "Such confidentiality agreements encourage the firm being reviewed to cooperate fully, build trust, and support a collegial atmosphere.",
        "if Engineers A and B were unable to successfully resolve Engineer A's concerns, Engineer A had an obligation to first advise Engineer B that Engineer A had an obligation to inform the appropriate authorities, and then to so inform the appropriate authorities." ;
    proeth:valueBasis "Recognition that confidentiality in professional review serves trust and cooperation, but cannot be used as an instrument to suppress safety concerns or circumvent professional obligations." ;
    proeth-prov:discoveredInCase 15 ;
    proeth-prov:discoveredInPass 2 ;
    proeth-prov:discoveredInSection "discussion" ;
    proeth-prov:firstDiscoveredAt "2026-06-02T19:58:41.183712+00:00"^^xsd:dateTime ;
    proeth-prov:firstDiscoveredInCase 15 ;
    proeth-prov:matchConfidence 0.78 ;
    proeth-prov:matchReasoning "The existing Confidentiality Principle states it must be balanced against public safety obligations and legal disclosure requirements, which is precisely the balancing function this principle performs in the peer review context. The prior extraction also includes Confidentiality of Professional Review as a case-level individual. This class is a variant of the existing Confidentiality Principle applied to the peer review setting, warranting a match at the variant confidence level rather than a new class." ;
    proeth-prov:matchedOntologyClass proeth:ConfidentialityPrinciple ;
    proeth-prov:matchedOntologyLabel "Confidentiality Principle" ;
    proeth-prov:matchesExisting true ;
    proeth-prov:sourceText "Such confidentiality agreements encourage the firm being reviewed to cooperate fully, build trust, and support a collegial atmosphere." ;
    rdfs:comment "Relational principle governing the design and enforcement of confidentiality agreements in peer review contexts, recognizing that such agreements serve legitimate purposes of encouraging cooperation and trust but must be structured to preserve safety reporting obligations and collegial notification rights." ;
    rdfs:subClassOf proeth:RelationalPrinciple ;
    skos:definition "Relational principle governing the design and enforcement of confidentiality agreements in peer review contexts, recognizing that such agreements serve legitimate purposes of encouraging cooperation and trust but must be structured to preserve safety reporting obligations and collegial notification rights." ;
    skos:scopeNote "[ConfidentialityPrinciple] Must be balanced against public safety obligations and legal disclosure requirements." ;
    prov:generatedAtTime "2026-06-02T19:58:41.183712+00:00"^^xsd:dateTime ;
    prov:wasAttributedTo "Case 15 Extraction",
        "claude-sonnet-4-6" .

pcsh:CaseAnnotationShape a sh:NodeShape ;
    rdfs:label "Shared per-case annotation schema (all nine components)"@en ;
    rdfs:comment "The cross-component annotation fields on committed case individuals: proeth:confidence (extraction confidence, decimal; all components except Action, whose Step-3 contract carries no confidence field), proeth:textReferences (verbatim supporting quotes, universal), proeth-prov sourceText (the source snippet, on the Step-1/2 provenance layers; Step-3 A/E individuals ground via textReferences only), and the involvement gloss (proeth:caseInvolvement on role individuals, proeth:caseContext on obligation, capability, and constraint individuals). Values are per-individual; the fields do not individuate any type."@en ;
    sh:property [ sh:description "Extraction confidence for this individual (0 to 1)." ;
            sh:name "confidence" ;
            sh:order 1 ;
            sh:path proeth:confidence ],
        [ sh:description "Verbatim case quotes supporting this individual." ;
            sh:name "text references" ;
            sh:order 2 ;
            sh:path proeth:textReferences ],
        [ sh:description "How this individual figures in the case narrative (role individuals; the same text is routed into rdfs:comment)." ;
            sh:name "case involvement" ;
            sh:order 3 ;
            sh:path proeth:caseInvolvement ],
        [ sh:description "Grounding context in this case (obligation, capability, and constraint individuals)." ;
            sh:name "case context" ;
            sh:order 4 ;
            sh:path proeth:caseContext ] ;
    sh:targetClass core:Action,
        core:Capability,
        core:Constraint,
        core:Event,
        core:Obligation,
        core:Principle,
        core:Resource,
        core:Role,
        core:State .

pcsh:PrincipleDefinitionShape a sh:NodeShape ;
    rdfs:label "Principle definition schema (type-level, descriptive, field contract)"@en ;
    rdfs:comment "What individuates a principle TYPE: its canonical kind (drives the four-kind subClassOf typing; the canonical leaf becomes the rdf:type) and the extensional cases that ground it (McLaren). The five per-case narrative literals and the invokedBy edge are per-individual and now declared on PrinciplePropertyShape, mirroring the RoleDefinitionShape/ProfessionalRolePropertyShape split so the {{ principle_schema }} prompt separates the type judgment from what the case supplies. Descriptive only (no validation result); principle_category is a routing input, not stored as a literal."@en ;
    sh:property [ sh:description "The controlled principle kind, which drives the four-kind subClassOf typing: FundamentalEthicalPrinciple, ProfessionalVirtuePrinciple, RelationalPrinciple, DomainSpecificPrinciple. The canonical leaf label becomes the rdf:type; the category is a routing input, not stored as a literal." ;
            sh:name "principle kind" ;
            sh:order 1 ;
            sh:path proeth:principleCategory ],
        [ sh:description "Class-level prior cases that instantiate the principle (McLaren extensional grounding); an optional class-mint field." ;
            sh:name "extensional cases" ;
            sh:order 2 ;
            sh:path proeth:extensionalCases ] ;
    sh:targetClass core:Principle .

pcsh:PrinciplePropertyShape a sh:NodeShape ;
    rdfs:label "Principle per-case schema (individual data, non-definitional)"@en ;
    rdfs:comment "What a principle INDIVIDUAL is described by in a specific case: the five narrative literals the defeasibility pipeline consumes and the agent that invokes it. These do NOT individuate the principle TYPE (that is PrincipleDefinitionShape); their values are per-case, asserted on the individual. Descriptive only."@en ;
    sh:property [ sh:description "Per-case reading of what the principle requires in this situation (a defeasibility-pipeline source field)." ;
            sh:name "interpretation" ;
            sh:order 1 ;
            sh:path proeth:interpretation ],
        [ sh:description "How the principle is concretely expressed in the case (a defeasibility-pipeline source field)." ;
            sh:name "concrete expression" ;
            sh:order 2 ;
            sh:path proeth:concreteExpression ],
        [ sh:description "What the principle is applied to in the case (the situation or party it bears on)." ;
            sh:name "applied to" ;
            sh:order 3 ;
            sh:path proeth:appliedTo ],
        [ sh:description "The competing principle or value this principle is balanced against in the case, recorded as a literal; extraction records the tension but asserts no defeat or precedence, and the defeasibility edges are materialized by a separate pass from this field." ;
            sh:name "balancing with" ;
            sh:order 4 ;
            sh:path proeth:balancingWith ],
        [ sh:description "How the case resolves the tension involving this principle (a defeasibility-pipeline source field)." ;
            sh:name "tension resolution" ;
            sh:order 5 ;
            sh:path proeth:tensionResolution ],
        [ sh:description "The agent who invokes the principle, via the P->Agent invokedBy edge (resolved to a case Agent by embedding shortlist + LLM select; a Board-pattern invoking party resolves deterministically to the case-scoped NSPE Board of Ethical Review Agent). Range: Agent." ;
            sh:name "invoked by" ;
            sh:order 6 ;
            sh:path core:invokedBy ] ;
    sh:targetClass core:Principle .

