@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#> .
@prefix dc:     <http://purl.org/dc/terms/> .
@prefix hcai:   <http://www.w3.org/ns/hcai#> .
@prefix skos:   <http://www.w3.org/2004/02/skos/core#> .
@prefix values: <https://ns.webcivics.net/values/> .

# ===========================================================================
# Values-Credential vocabulary — the shared model for the UN human-rights
# instruments re-expressed as affirmable undertakings binding EVERY agent.
# Grounded in RDFS + SHACL + N3Logic (NOT OWL — a person is not an owl:Thing;
# see crates/qualia-core-db/shapes/qualia-agency.shacl.ttl).
# ===========================================================================

# --- The agent model: the State is ONE kind of agent, not the root duty-bearer ---
values:Agent a rdfs:Class ;
    rdfs:label "Agent" ;
    rdfs:comment "Any entity that can bear rights and duties — human or otherwise. Root of the duty model. NOT a subclass of owl:Thing." .

values:NaturalPerson a rdfs:Class ;
    rdfs:subClassOf values:Agent ;
    rdfs:seeAlso hcai:NaturalPerson ;
    rdfs:label "Natural person" .

# --- "PERSON" = THE HUMAN (NOT corporate personhood / legal personality) ---
# CRITICAL DISAMBIGUATION: in law the bare word "person" silently includes corporations
# (legal personality) — the very ambiguity through which corporate personhood captures
# human rights. Here the UNQUALIFIED "person" is the PERSON OF HUMAN DIGNITY = the human
# being = values:NaturalPerson. A Definitional binding (modal-junctures: Definitional →
# ConceptBinding → skos:exactMatch), foundationally human-attested (Timothy's axiom).
values:Person a rdfs:Class ;
    rdfs:subClassOf values:NaturalPerson ;
    skos:exactMatch values:NaturalPerson ;
    rdfs:label "Person (the human being of human rights)" ;
    rdfs:comment "The dignity-bearing 'person' of the instruments = the HUMAN = values:NaturalPerson. NOT legal/corporate personality; a corporation is not a person in this sense." .

# Only the human bears INHERENT DIGNITY (UDHR Preamble / Art 1 — 'the inherent dignity ...
# of all members of the human family'). A legal person bears FUNCTIONAL juridical capacity
# (contract, property, treaty), NEVER inherent dignity.
values:inherentDignity a rdf:Property ; rdfs:range xsd:boolean ;
    rdfs:comment "Inherent human dignity — held ONLY by a NaturalPerson/Person; never by a LegalPerson / CorporatePerson / ArtificialAgent." .
values:NaturalPerson values:inherentDignity true .

# DISJOINTNESS (the anti-conflation axiom): a legal person is NOT a natural person; an
# artificial agent is neither. "Legal personality" uses "person" by analogy/construct (the
# 'world of man'; OWL-appropriate), never as the dignity-Person (the natural world; RDFS).
values:PersonhoodDisjointnessShape a sh:NodeShape ;
    sh:targetClass values:NaturalPerson ;
    sh:not [ sh:class values:LegalPerson ] ;
    sh:not [ sh:class values:ArtificialAgent ] ;
    sh:message "A natural person (the human, dignity-bearer) is NOT a legal/corporate person or an artificial agent — 'person' here means the human, not corporate personhood." .

values:LegalPerson    a rdfs:Class ; rdfs:subClassOf values:Agent ; rdfs:label "Legal person (juridical personality)" ;
    rdfs:comment "Juridical personality (contracts, bears treaties) — NOT a values:Person and NOT a bearer of inherent dignity. Disjoint from values:NaturalPerson." .

# --- "PERSON" IS RESOLVED PER DOCUMENT — the reading is CONTEXTUAL (frame-relative #15) ---
# values:Person above is the DIGNITY CONCEPT (the human). But the WORD "person" in a given
# document does NOT globally mean that — its reading is contextual to the document /
# jurisdiction / author. The UN instruments INTEND "human being"; later documents vary. So
# "person" is resolved per the document's personReading (the document is the FRAME); it
# equals values:Person (the dignity-human) ONLY under a HumanOnly reading.

# WHAT a document's "person" denotes:
values:PersonReading a rdfs:Class .
values:HumanOnly     a values:PersonReading ; rdfs:comment "'person' = the human being (the dignity sense; = values:Person)." .
values:Incorporative a values:PersonReading ; rdfs:comment "'person' INCLUDES legal/corporate personality — a capture-risk reading." .
values:MixedReading  a values:PersonReading ; rdfs:comment "Both human and legal, unseparated." .

# HOW well-determined that reading is (provenance / epistemic quality of the definition):
values:ReadingStatus a rdfs:Class .
values:Intended            a values:ReadingStatus ; rdfs:comment "Contextually clear from purpose (e.g. the UN human-rights instruments)." .
values:Declared            a values:ReadingStatus ; rdfs:comment "Explicitly defined in the document (a Definitional illocutionary act)." .
values:AmbiguousReading    a values:ReadingStatus ; rdfs:comment "Unresolved — multiple candidate readings; HELD, not collapsed (paraconsistent)." .
values:IntentionallyOpaque a values:ReadingStatus ; rdfs:comment "Deliberately vague to enable capture — an abuse signal." .
values:AuthorUnaware       a values:ReadingStatus ; rdfs:comment "The author does not understand the human/legal distinction — low epistemic quality." .

values:personReading a rdf:Property ; rdfs:comment "Document/context → how 'person' is read there (values:PersonReading)." .
values:personReadingStatus a rdf:Property ; rdfs:comment "Document/context → how well-determined that reading is (values:ReadingStatus)." .

values:PersonhoodCaptureRiskFlag a rdfs:Class ;
    rdfs:comment "Flag: a document reads 'person' incorporatively or opaquely — corporate-personhood capture risk; routed to the values abuse-check (not auto-judged)." .

# Default for the UN human-rights corpus: a values:ValuesCredential reads "person" as the
# human being (HumanOnly / Intended) unless the document declares otherwise.
{ ?d a values:ValuesCredential } => { ?d values:personReading values:HumanOnly ; values:personReadingStatus values:Intended } .

# An incorporative or intentionally-opaque reading raises the capture-risk flag.
{ ?doc values:personReading values:Incorporative } => { ?doc values:flag values:PersonhoodCaptureRiskFlag } .
{ ?doc values:personReadingStatus values:IntentionallyOpaque } => { ?doc values:flag values:PersonhoodCaptureRiskFlag } .
values:ArtificialAgent a rdfs:Class ; rdfs:subClassOf values:Agent ; rdfs:label "Artificial agent (software/AI)" .

# STATE DECISION (PLAN.md §9.2, resolved 2026-06-21): a State HAS juridical
# personality (it contracts, bears treaties), so it stays WITHIN values:LegalPerson
# — but LegalPerson is split into two DISJOINT sub-kinds: public-law authorities
# vs commercial fictions. This prevents conflating State public power with a
# corporation for rights-holding purposes, without denying the State legal
# personality. The corporate-capture guard (agency.n3 G1) targets CorporatePerson
# ONLY. (Chosen over making State a bare sibling of Agent, which would wrongly
# strip its juridical personality.)
values:PublicAuthority a rdfs:Class ; rdfs:subClassOf values:LegalPerson ;
    rdfs:label "Public-law authority" ;
    rdfs:comment "Disjoint from values:CorporatePerson (a State is not a commercial legal person)." .
values:CorporatePerson a rdfs:Class ; rdfs:subClassOf values:LegalPerson ;
    rdfs:label "Corporate person (commercial/private juridical fiction)" ;
    rdfs:comment "Disjoint from values:PublicAuthority; the corporate-capture guard target (agency.n3 G1)." .
values:State a rdfs:Class ; rdfs:subClassOf values:PublicAuthority ; rdfs:label "State / party" ;
    rdfs:comment "A specialised PUBLIC-law agent. Universal duties borne by values:Agent bind it a fortiori (R1); its heightened responsibility is a SPECIALISATION of the universal duty, not its source. NOT interchangeable with a CorporatePerson for rights-holding." .

# --- The credential model ---
values:ValuesCredential a rdfs:Class ; rdfs:label "Values credential" ;
    rdfs:comment "A whole affirmable instrument (e.g. the UDHR)." .
values:Undertaking a rdfs:Class ; rdfs:label "Undertaking" ;
    rdfs:comment "One affirmable provision (article/paragraph)." .

values:Right       a rdfs:Class ; rdfs:subClassOf values:Undertaking ; rdfs:label "Right" .
values:Obligation  a rdfs:Class ; rdfs:subClassOf values:Undertaking ; rdfs:label "Obligation (Obligate)" .
values:Prohibition a rdfs:Class ; rdfs:subClassOf values:Undertaking ; rdfs:label "Prohibition (Forbid)" .
values:Permission  a rdfs:Class ; rdfs:subClassOf values:Undertaking ; rdfs:label "Permission (Permit)" .

# --- Properties ---
values:partOf      a rdf:Property ; rdfs:domain values:Undertaking ; rdfs:range values:ValuesCredential .
values:borneBy     a rdf:Property ; rdfs:comment "The Agent CLASS a duty binds. Default values:Agent = every agent." .
values:heldBy      a rdf:Property ; rdfs:comment "The Agent class a right is held by." .
values:specialisedFor a rdf:Property ; rdfs:comment "Marks a duty intensified for a specific agent kind (e.g. values:State)." .
values:correlativeDuty a rdf:Property ; rdfs:domain values:Right ; rdfs:range values:Undertaking .
values:forbids     a rdf:Property ; rdfs:domain values:Prohibition ; rdfs:comment "An act-class that is forbidden." .
values:requires    a rdf:Property ; rdfs:domain values:Obligation ;  rdfs:comment "An act-class that is required." .
values:affirms     a rdf:Property ; rdfs:domain values:Agent ; rdfs:comment "Agent affirms a credential/undertaking (affirmation, not oath)." .
values:source      a rdf:Property ; rdfs:comment "Citation URI of the originating instrument/article." .
values:originalText a rdf:Property ; rdfs:range rdfs:Literal .
values:amendedText  a rdf:Property ; rdfs:range rdfs:Literal ;
    rdfs:comment "The parties-not-states, agent-universalised wording actually affirmed." .

# --- Intent/act vocabulary (the abuse-check surface; see AGENT_INTENT_LOGGING_SPEC) ---
values:wouldPerform a rdf:Property ; rdfs:comment "An AgentIntent → an act it would perform." .
values:byAgent      a rdf:Property ; rdfs:comment "An AgentIntent → the acting agent." .
values:violates     a rdf:Property ; rdfs:comment "INFERRED: an intent/act breaches an undertaking (the abuse signal)." .

# ===========================================================================
# N3Logic rules (foundational reasoning)
# ===========================================================================

# (R1) Universalisation → State specialisation: a duty borne by every Agent is,
# a fortiori, borne by the State. This SUPPORTS state responsibility by deriving
# it from the universal duty rather than rooting duty in the State.
{ ?u values:borneBy values:Agent } => { ?u values:borneBy values:State } .

# (R2) Right → correlative duty binds all agents: if a right is held, its
# correlative duty is borne by every agent unless already specified.
{ ?r a values:Right ; values:correlativeDuty ?d } => { ?d values:borneBy values:Agent } .

# (R3) Abuse detection: an intent to perform an act of a forbidden class, by an
# agent the prohibition binds, violates that prohibition. (The deontic baseline
# the MCP / agreement layer checks: useful activity vs abuse.)
{ ?i values:wouldPerform ?act .
  ?act a ?C .
  ?p a values:Prohibition ; values:forbids ?C ; values:borneBy values:Agent
} => { ?i values:violates ?p } .

# ===========================================================================
# SHACL — a compliant agent intent asserts no violation
# ===========================================================================
values:CompliantIntentShape a sh:NodeShape ;
    sh:targetClass values:AgentIntent ;
    sh:not [ sh:property [ sh:path values:violates ; sh:minCount 1 ] ] ;
    sh:message "Agent intent violates an affirmed values undertaking (abuse)." .
