# AUTHORED-BY Claude Opus 4.8 (Fable unavailable) — re-review/upgrade candidate
#
@prefix fin:     <https://w3id.org/jeswr/sectors/finance#> .
@prefix core:    <https://w3id.org/jeswr/core#> .
@prefix gufo:    <http://purl.org/nemo/gufo#> .
@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 dcterms: <http://purl.org/dc/terms/> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix vann:    <http://purl.org/vocab/vann/> .
@prefix fibo-fnd-acc-cur: <https://spec.edmcouncil.org/fibo/ontology/FND/Accounting/CurrencyAmount/> .
@prefix fibo-fbc-pas-caa: <https://spec.edmcouncil.org/fibo/ontology/FBC/ProductsAndServices/ClientsAndAccounts/> .
@prefix fibo-fbc-fct-fse: <https://spec.edmcouncil.org/fibo/ontology/FBC/FunctionalEntities/FinancialServicesEntities/> .
@prefix fibo-fbc-fi-fi:   <https://spec.edmcouncil.org/fibo/ontology/FBC/FinancialInstruments/FinancialInstruments/> .

# =============================================================================
# Finance Sector Ontology (FIN) — RE-BASED onto the gUFO Solid Core (R11 §4.2).
#
# AUTHORING PROVENANCE: authored as an OntoUML model (finance.ontouml.json),
# verified anti-pattern-free by OntoumlVerification.verify() (F3, 0 issues),
# transformed to gUFO-OWL by Ontouml2Gufo (finance.gufo.ttl backbone), then
# ENRICHED here with F1 definitions, Core-rooting, the FIBO slim-module subclass
# axioms, the status-phase partition, and the property spine. The backbone's
# gUFO meta-types are preserved verbatim.
#
# gUFO META-TYPES (each sector class carries its own meta-type AND roots in Core):
#   FinancialAccount = gufo:Relator (Kind), subtypes = gufo:SubKind, status =
#       gufo:Phase  → root core:Account (gufo:Relator)
#   Transaction/Payment/Transfer/CardPayment = gufo:EventType → root core:Activity
#   FinancialInstitution = gufo:Kind, Bank = gufo:SubKind → root core:Organization
#   FinancialInstrument = gufo:Kind, Security = gufo:SubKind, Holding = gufo:Kind
#       → root core:Asset
#   MonetaryAmount = gufo:Kind (Object value) → root gufo:Object
#   Counterparty/Payer/Payee/AccountCustodian = gufo:RoleMixin → root core:Agent
#
# CONTRACT (R8 §4, F1–F7): imports the re-based gUFO Core; roots every domain
# class transitively in a Core class; CONSTRAINS, never forks. External FIBO
# terms are reused via the version-pinned slim MIREOT module (imports/fibo-slim.ttl,
# Mode B). ISO 4217 is data (currency codes); ISO 20022 is Mode-A alignment.
#
# v0 COUNTERPARTY FIX: v0 made fin:counterparty an rdfs:subPropertyOf
# core:hadParticipant (domain core:Event), which forced every Transaction to be a
# core:Event by entailment and coupled the party-link to a domain-narrow Core
# property. Under gUFO that is wrong: a counterparty is a contingent, relational
# ROLE, not a participation-of-a-Core-Event. The fix: model Counterparty (with
# Payer/Payee) as a gufo:RoleMixin played by an Agent, linked from the Transaction
# event by fin:hasCounterparty — a fresh sector property, NOT a subproperty of any
# domain-narrow Core property. No Core property's domain/range is widened.
#
# =============================================================================

<https://w3id.org/jeswr/sectors/finance> a owl:Ontology ;
    dcterms:title "Solid Finance Sector Ontology (gUFO re-base)"@en ;
    rdfs:label "Solid Finance Sector Ontology"@en ;
    vann:preferredNamespacePrefix "fin" ;
    vann:preferredNamespaceUri "https://w3id.org/jeswr/sectors/finance#" ;
    owl:imports <https://w3id.org/jeswr/core> ,
                <https://w3id.org/jeswr/sectors/finance/imports/fibo-slim> ;
    owl:versionInfo "1.2.0" ;
    owl:versionIRI <https://w3id.org/jeswr/sectors/finance/1.2.0> ;
    dcterms:description """Personal-finance terms (accounts, transactions,
        holdings, payments) for the EDMA lending/banking use cases, re-based onto
        the gUFO Solid Core. Account=Relator(+Phase status); transactions/payments
        =Event; institutions/instruments=Kind; counterparty roles=RoleMixin. Reuses
        FIBO via a version-pinned slim MIREOT module (Mode B); ISO 4217 as data,
        ISO 20022 as Mode-A alignment (finance-alignments.ttl). v1 is a BREAKING
        re-base of v0 (meta-types change meaning), so a new MAJOR version. v1.1.0
        ADDITIVE: personal envelope/zero-based budgeting (fin:Budget,
        fin:BudgetCategory, allocation + category-assignment props) + a CRDT-sync
        pointer pair (fin:syncLog/fin:snapshot) for the Actual Budget use case.
        v1.2.0 ADDITIVE (revenue-products ontology review §4–§5): a double-entry
        LEDGER module (fin:LedgerAccount, fin:JournalEntry, fin:LedgerEntry,
        fin:entrySide + fin:Debit/fin:Credit, fin:postsTo, fin:accountClass /
        Code / parentAccountCode) for Keystone's general ledger, a private-equity
        module (fin:Fund, fin:Commitment, fin:Notice, GP/LP roles, commitment /
        called / distribution / call amounts, fin:vintageYear, fin:noticeType) for
        CapNote's capital calls & distributions, and fin:sharePct (the honest
        percentage datatype replacing Keystone's range-violating bare-literal
        qudt:quantityValue) + fin:jurisdiction. Generic double-entry + PE terms,
        aligned to FIBO Mode-A (finance-alignments.ttl); no existing term changed."""@en ;
    dcterms:modified "2026-07-03"^^xsd:date ;
    rdfs:comment "Re-based per R11 §4.2. v1.2.0 ADDITIVE: double-entry ledger (Keystone) + private-equity capital-calls/distributions (CapNote) + fin:sharePct/jurisdiction. See the revenue-products ontology review §4–§5."@en .

# -----------------------------------------------------------------------------
# Annotation-property declarations (F5 DL hygiene — match the Core pattern).
# -----------------------------------------------------------------------------
dcterms:title       a owl:AnnotationProperty .
dcterms:description a owl:AnnotationProperty .
dcterms:modified    a owl:AnnotationProperty .
dcterms:source      a owl:AnnotationProperty .
vann:preferredNamespacePrefix a owl:AnnotationProperty .
vann:preferredNamespaceUri    a owl:AnnotationProperty .
skos:definition     a owl:AnnotationProperty .
skos:scopeNote      a owl:AnnotationProperty .

# =============================================================================
# 1. INSTITUTIONS — providers of accounts and services
#    gufo:Kind / SubKind; root core:Organization. FIBO: fibo-fbc-fct-fse.
# =============================================================================

fin:FinancialInstitution a owl:Class, gufo:Kind ;
    rdfs:subClassOf core:Organization, fibo-fbc-fct-fse:FinancialInstitution ;
    rdfs:label "Financial Institution"@en ;
    skos:definition "An organization that provides financial accounts and services (a bank, a building society, a payment institution). Typically the agent playing core:AccountProvider for an account."@en ;
    skos:scopeNote "gufo:Kind. Roots in core:Organization; reuses fibo-fbc-fct-fse:FinancialInstitution from the slim module."@en .

fin:Bank a owl:Class, gufo:SubKind ;
    rdfs:subClassOf fin:FinancialInstitution, fibo-fbc-fct-fse:Bank ;
    rdfs:label "Bank"@en ;
    skos:definition "A deposit-taking financial institution."@en ;
    skos:scopeNote "gufo:SubKind of FinancialInstitution (a Kind is an ultimate sortal and cannot be specialised by another Kind)."@en .

# =============================================================================
# 2. MONETARY AMOUNT — a value + an ISO 4217 currency
#    gufo:Kind (an Object value); root gufo:Object. FIBO: MonetaryAmount.
# =============================================================================

fin:MonetaryAmount a owl:Class, gufo:Kind ;
    rdfs:subClassOf core:Quantity, fibo-fnd-acc-cur:MonetaryAmount ;
    rdfs:label "Monetary Amount"@en ;
    skos:definition "A quantity of money: a decimal value in a single ISO 4217 currency. A value object reused by transactions, payments, balances and holdings. A core:Quantity whose unit is a currency (the ISO 4217 code on fin:currency)."@en ;
    skos:scopeNote "gufo:Kind (Object value). Roots in core:Quantity (which roots in gufo:Object) — this is the foundation rooting. Reuses fibo-fnd-acc-cur:MonetaryAmount from the slim module; fin:amount/fin:currency are the sector-typed forms of core:numericValue/core:unit. Not an Agent/Account/Asset/Event."@en .

fin:amount a owl:DatatypeProperty ;
    rdfs:label "amount"@en ;
    rdfs:domain fin:MonetaryAmount ;
    rdfs:range xsd:decimal ;
    skos:definition "The numeric value of a monetary amount."@en .

fin:currency a owl:DatatypeProperty ;
    rdfs:label "currency"@en ;
    rdfs:domain fin:MonetaryAmount ;
    rdfs:range xsd:string ;
    skos:definition "The ISO 4217 alphabetic currency code (e.g. \"GBP\", \"EUR\", \"USD\") of a monetary amount."@en .

fin:hasMonetaryAmount a owl:ObjectProperty ;
    rdfs:label "has monetary amount"@en ;
    rdfs:range fin:MonetaryAmount ;
    skos:definition "Relates an entity (a transaction, payment, balance, or holding) to a monetary amount. No rdfs:domain: it spans both endurants (holdings) and events (transactions), which gUFO holds disjoint, so a domain axiom would force inconsistent typing — intended usage is enforced in SHACL."@en .

# =============================================================================
# 3. ACCOUNTS — gufo:Relator; root core:Account. Subtypes = gufo:SubKind.
#    Status (Active/Frozen/Closed) = gufo:Phase partition of the relator.
#    FIBO: fibo-fbc-pas-caa:Account + DepositAccount.
# =============================================================================

fin:FinancialAccount a owl:Class, gufo:Relator ;
    rdfs:subClassOf gufo:Relator, core:Account, fibo-fbc-pas-caa:Account ;
    rdfs:label "Financial Account"@en ;
    skos:definition "A core:Account at a financial institution through which money is held and money movements are recorded. A reified relator mediating an account holder and a provider."@en ;
    skos:scopeNote "gufo:Relator. Roots in core:Account; reuses fibo-fbc-pas-caa:Account. Holder/provider via the inherited core:hasAccountHolder / core:hasAccountProvider mediations."@en .

fin:CurrentAccount a owl:Class, gufo:SubKind ;
    rdfs:subClassOf fin:FinancialAccount ;
    rdfs:label "Current Account"@en ;
    skos:definition "A transactional demand-deposit account (US: checking account)."@en ;
    skos:scopeNote "gufo:SubKind of the FinancialAccount relator."@en .

fin:SavingsAccount a owl:Class, gufo:SubKind ;
    rdfs:subClassOf fin:FinancialAccount, fibo-fbc-pas-caa:DepositAccount ;
    rdfs:label "Savings Account"@en ;
    skos:definition "An interest-bearing deposit account intended for saving rather than day-to-day transactions."@en ;
    skos:scopeNote "gufo:SubKind. Reuses fibo-fbc-pas-caa:DepositAccount."@en .

fin:CreditAccount a owl:Class, gufo:SubKind ;
    rdfs:subClassOf fin:FinancialAccount ;
    rdfs:label "Credit Account"@en ;
    skos:definition "An account representing a credit facility or revolving credit line (a credit card or overdraft), where the holder owes the provider. Relevant to the EDMA lending use cases."@en ;
    skos:scopeNote "gufo:SubKind."@en .

fin:InvestmentAccount a owl:Class, gufo:SubKind ;
    rdfs:subClassOf fin:FinancialAccount ;
    rdfs:label "Investment Account"@en ;
    skos:definition "An account through which financial instruments are held (a brokerage or securities account). Its holdings are fin:Holding / fin:FinancialInstrument assets."@en ;
    skos:scopeNote "gufo:SubKind."@en .

# --- account-status phases (partition of the FinancialAccount relator) ---

fin:ActiveFinancialAccount a owl:Class, gufo:Phase ;
    rdfs:subClassOf fin:FinancialAccount ;
    rdfs:label "Active Financial Account"@en ;
    skos:definition "The phase of a financial account that is open and operable."@en ;
    skos:scopeNote "gufo:Phase. Member of the accountStatus partition; specialises the global core ActiveAccount phase pattern."@en .

fin:FrozenFinancialAccount a owl:Class, gufo:Phase ;
    rdfs:subClassOf fin:FinancialAccount ;
    rdfs:label "Frozen Financial Account"@en ;
    skos:definition "The phase of a financial account temporarily suspended (e.g. a compliance hold)."@en ;
    skos:scopeNote "gufo:Phase. Member of the accountStatus partition."@en .

fin:ClosedFinancialAccount a owl:Class, gufo:Phase ;
    rdfs:subClassOf fin:FinancialAccount ;
    rdfs:label "Closed Financial Account"@en ;
    skos:definition "The phase of a financial account that has been terminated."@en ;
    skos:scopeNote "gufo:Phase. Member of the accountStatus partition."@en .

# DISJOINT, complete status partition: an account is in EXACTLY ONE phase at a time.
# Ontouml2Gufo emits only owl:unionOf for an anti-rigid (Phase) partition — it writes
# owl:AllDisjointClasses only for rigid/abstract children — so the enrichment asserts the
# disjointness here. owl:disjointUnionOf gives both: union (complete) + pairwise disjoint,
# so an individual typed Active AND Closed is inconsistent.
fin:FinancialAccount owl:disjointUnionOf
    ( fin:ActiveFinancialAccount fin:FrozenFinancialAccount fin:ClosedFinancialAccount ) .

fin:Balance a owl:Class, gufo:SubKind ;
    rdfs:subClassOf core:Record ;
    rdfs:label "Balance"@en ;
    skos:definition "A point-in-time statement of the monetary amount standing on a financial account. A core:Record about the account, distinct from the account itself; use core:about for the account and core:timestamp for the as-of instant."@en ;
    skos:scopeNote "gufo:SubKind of core:Record (information object)."@en .

# =============================================================================
# 4. TRANSACTIONS & PAYMENTS — gufo:EventType; root core:Activity.
# =============================================================================

fin:Transaction a owl:Class, gufo:EventType ;
    rdfs:subClassOf gufo:Event, core:Activity ;
    rdfs:label "Transaction"@en ;
    skos:definition "A money movement on a financial account, having a monetary amount, a posting time and (usually) a counterparty. A core:Activity event."@en ;
    skos:scopeNote "gufo:EventType. Roots in core:Activity. Value via fin:hasMonetaryAmount, posting time via fin:postingTime, the other party via fin:hasCounterparty."@en .

fin:Payment a owl:Class, gufo:EventType ;
    rdfs:subClassOf fin:Transaction ;
    rdfs:label "Payment"@en ;
    skos:definition "A transaction that transfers money from a payer to a payee to settle an obligation."@en ;
    skos:scopeNote "gufo:EventType. Parties via fin:payer / fin:payee."@en .

fin:CardPayment a owl:Class, gufo:EventType ;
    rdfs:subClassOf fin:Payment ;
    rdfs:label "Card Payment"@en ;
    skos:definition "A payment initiated with a payment card."@en ;
    skos:scopeNote "gufo:EventType."@en .

fin:Transfer a owl:Class, gufo:EventType ;
    rdfs:subClassOf fin:Transaction ;
    rdfs:label "Transfer"@en ;
    skos:definition "A movement of money between accounts (a bank transfer, a standing-order execution)."@en ;
    skos:scopeNote "gufo:EventType. Accounts via fin:debitAccount / fin:creditAccount."@en .

fin:TransactionRecord a owl:Class, gufo:SubKind ;
    rdfs:subClassOf core:Record ;
    rdfs:label "Transaction Record"@en ;
    skos:definition "The stored statement-line record of a transaction (as it appears on a statement), as opposed to the money-movement event itself. Use core:about to point at the fin:Transaction it documents."@en ;
    skos:scopeNote "gufo:SubKind of core:Record. Keeps the document-vs-event split."@en .

# --- transaction properties ---

fin:debitAccount a owl:ObjectProperty ;
    rdfs:label "debit account"@en ;
    rdfs:domain fin:Transaction ;
    rdfs:range fin:FinancialAccount ;
    skos:definition "The account debited (money leaves) by a transaction."@en .

fin:creditAccount a owl:ObjectProperty ;
    rdfs:label "credit account"@en ;
    rdfs:domain fin:Transaction ;
    rdfs:range fin:FinancialAccount ;
    skos:definition "The account credited (money arrives) by a transaction."@en .

fin:postingTime a owl:DatatypeProperty ;
    rdfs:subPropertyOf core:timestamp ;
    rdfs:label "posting time"@en ;
    rdfs:domain fin:Transaction ;
    rdfs:range xsd:dateTime ;
    skos:definition "The instant a transaction was posted to the account ledger. A specialisation of core:timestamp."@en .

# =============================================================================
# 5. COUNTERPARTY ROLES — gufo:RoleMixin; root core:Agent. The v0 fix.
#    Counterparty/Payer/Payee are roles played by an Agent, NOT a participation
#    in a Core Event. fin:hasCounterparty links the Transaction event to the role
#    player and is a FRESH sector property — not a subproperty of any
#    domain-narrow Core property.
# =============================================================================

fin:Counterparty a owl:Class, gufo:RoleMixin ;
    rdfs:subClassOf core:Agent ;
    rdfs:label "Counterparty"@en ;
    skos:definition "The role of the agent on the far side of a transaction's money movement, played contingently and relationally for that transaction."@en ;
    skos:scopeNote "gufo:RoleMixin (cross-kind, anti-rigid). Replaces the v0 fin:counterparty subproperty of core:hadParticipant — the counterparty is a role, not a Core-Event participation."@en .

fin:Payer a owl:Class, gufo:RoleMixin ;
    rdfs:subClassOf fin:Counterparty ;
    rdfs:label "Payer"@en ;
    skos:definition "The role of the agent that sends money in a payment."@en ;
    skos:scopeNote "gufo:RoleMixin specialising Counterparty."@en .

fin:Payee a owl:Class, gufo:RoleMixin ;
    rdfs:subClassOf fin:Counterparty ;
    rdfs:label "Payee"@en ;
    skos:definition "The role of the agent that receives money in a payment."@en ;
    skos:scopeNote "gufo:RoleMixin specialising Counterparty."@en .

fin:AccountCustodian a owl:Class, gufo:RoleMixin ;
    rdfs:subClassOf core:Custodian ;
    rdfs:label "Account Custodian"@en ;
    skos:definition "The role of an agent that holds or controls a financial account's assets without necessarily owning them (a custodian bank)."@en ;
    skos:scopeNote "gufo:RoleMixin specialising the Core Custodian role-mixin."@en .

fin:hasCounterparty a owl:ObjectProperty ;
    rdfs:label "has counterparty"@en ;
    rdfs:domain fin:Transaction ;
    rdfs:range fin:Counterparty ;
    skos:definition "Links a transaction event to the agent playing the Counterparty role on the far side of the money movement. A fresh sector property — NOT a subproperty of core:hadParticipant, so it does not entail that a Transaction is a core:Event participation nor widen any Core property."@en .

fin:payer a owl:ObjectProperty ;
    rdfs:subPropertyOf fin:hasCounterparty ;
    rdfs:label "payer"@en ;
    rdfs:domain fin:Payment ;
    rdfs:range fin:Payer ;
    skos:definition "Links a payment to the agent playing the Payer role."@en .

fin:payee a owl:ObjectProperty ;
    rdfs:subPropertyOf fin:hasCounterparty ;
    rdfs:label "payee"@en ;
    rdfs:domain fin:Payment ;
    rdfs:range fin:Payee ;
    skos:definition "Links a payment to the agent playing the Payee role."@en .

# =============================================================================
# 6. INSTRUMENTS & HOLDINGS — gufo:Kind / SubKind; root core:Asset.
#    FIBO: fibo-fbc-fi-fi:FinancialInstrument.
# =============================================================================

fin:FinancialInstrument a owl:Class, gufo:Kind ;
    rdfs:subClassOf core:Asset, fibo-fbc-fi-fi:FinancialInstrument ;
    rdfs:label "Financial Instrument"@en ;
    skos:definition "A tradable financial asset — a security, bond, fund unit, or similar. Identify it with core:identifiedBy + an ISIN-scheme core:Identifier."@en ;
    skos:scopeNote "gufo:Kind. Roots in core:Asset; reuses fibo-fbc-fi-fi:FinancialInstrument."@en .

fin:Security a owl:Class, gufo:SubKind ;
    rdfs:subClassOf fin:FinancialInstrument ;
    rdfs:label "Security"@en ;
    skos:definition "A negotiable financial instrument such as a share or bond."@en ;
    skos:scopeNote "gufo:SubKind of FinancialInstrument."@en .

fin:Holding a owl:Class, gufo:Kind ;
    rdfs:subClassOf core:Asset ;
    rdfs:label "Holding"@en ;
    skos:definition "A held position: a quantity of a financial instrument owned within an investment account. Use core:owns for the owner, fin:ofInstrument for the instrument, fin:quantity for the units, and fin:hasMonetaryAmount for its valuation."@en ;
    skos:scopeNote "gufo:Kind. Roots in core:Asset."@en .

fin:ofInstrument a owl:ObjectProperty ;
    rdfs:label "of instrument"@en ;
    rdfs:domain fin:Holding ;
    rdfs:range fin:FinancialInstrument ;
    skos:definition "The financial instrument a holding is a position in."@en .

fin:quantity a owl:DatatypeProperty ;
    rdfs:label "quantity"@en ;
    rdfs:domain fin:Holding ;
    rdfs:range xsd:decimal ;
    skos:definition "The number of units of the instrument held."@en .

fin:heldInAccount a owl:ObjectProperty ;
    rdfs:label "held in account"@en ;
    rdfs:domain fin:Holding ;
    rdfs:range fin:InvestmentAccount ;
    skos:definition "The investment account a holding is custodied within."@en .

# =============================================================================
# 7. PERSONAL BUDGETING — envelope / zero-based budgeting (the Actual Budget
#    use case). v1.1.0 ADDITIVE: a Budget is a plan information object for a
#    period; a BudgetCategory is an "envelope" bucket holding an allocated
#    MonetaryAmount; a Transaction is assigned to an envelope. Categories'
#    grouping/classification reuses SKOS (skos:Concept), not a new term.
#    fin:Payee already exists (a Counterparty RoleMixin, §5) — NOT re-minted.
# =============================================================================

fin:Budget a owl:Class, gufo:Kind ;
    rdfs:subClassOf core:InformationResource ;
    rdfs:label "Budget"@en ;
    skos:definition "A personal budget plan for a period — the envelope/zero-based budget an app like Actual Budget maintains. An information object aggregating its BudgetCategory envelopes (via core:hasPart) over a covered period (core:validFrom/core:validUntil)."@en ;
    skos:scopeNote "gufo:Kind (information object) under core:InformationResource. Owner via core:owns/core:custodian; envelopes via fin:hasCategory."@en .

fin:BudgetCategory a owl:Class, gufo:SubKind ;
    rdfs:subClassOf core:InformationResource ;
    rdfs:label "Budget Category"@en ;
    skos:definition "An envelope budgeting bucket within a Budget — a named category (\"Groceries\", \"Rent\") holding a planned allocation (fin:allocated, a MonetaryAmount) against which transactions are spent. An information object (the allocation record), distinct from the money itself. Its grouping/classification reuses skos:Concept (skos:broader for category groups); aligns to schema (alignments file)."@en ;
    skos:scopeNote "gufo:SubKind under core:InformationResource. The \"envelope\". Allocation via fin:allocated; classified by a skos:Concept via fin:categoryConcept; part of a Budget via fin:hasCategory."@en .

fin:hasCategory a owl:ObjectProperty ;
    rdfs:subPropertyOf core:hasPart ;
    rdfs:domain fin:Budget ;
    rdfs:range fin:BudgetCategory ;
    rdfs:label "has category"@en ;
    skos:definition "An envelope category that is part of a budget. A sub-property of core:hasPart (the budget aggregates its envelopes)."@en .

fin:allocated a owl:ObjectProperty ;
    rdfs:subPropertyOf fin:hasMonetaryAmount ;
    rdfs:domain fin:BudgetCategory ;
    rdfs:range fin:MonetaryAmount ;
    rdfs:label "allocated"@en ;
    skos:definition "The amount of money planned/allocated to a budget envelope for the period. A sub-property of fin:hasMonetaryAmount narrowed to the envelope allocation."@en .

fin:categoryConcept a owl:ObjectProperty ;
    rdfs:domain fin:BudgetCategory ;
    rdfs:range skos:Concept ;
    rdfs:label "category concept"@en ;
    skos:definition "The skos:Concept classifying this envelope (the reusable category taxonomy term — \"Groceries\", a child of a \"Food\" group via skos:broader). Reuses SKOS for the category hierarchy rather than minting a parallel category-tree vocabulary."@en .

fin:inCategory a owl:ObjectProperty ;
    rdfs:domain fin:Transaction ;
    rdfs:range fin:BudgetCategory ;
    rdfs:label "in category"@en ;
    skos:definition "The budget envelope a transaction is assigned to (the spend that draws down the envelope's allocation). A plain object property (the Transaction is a gufo:Event; this is not a part-whole link)."@en .

# --- CRDT-sync pointer pair (the Actual Budget append-only sync model) ---
# Actual Budget syncs via an append-only CRDT message log + periodic snapshots;
# the honest pure-Solid translation is a pod CONTAINER of append-only sync
# messages plus a snapshot resource. The Budget points at both; the byte payloads
# are opaque to RDF (the sync messages are a binary/JSON log, like @jeswr/y-solid's
# update log) — these are pointers ONLY.

fin:syncLog a owl:ObjectProperty ;
    rdfs:domain fin:Budget ;
    rdfs:range core:InformationResource ;
    rdfs:label "sync log"@en ;
    skos:definition "The append-only CRDT-sync container this budget's mutations are logged to (an LDP container of opaque sync-message resources). The pointer to the CRDT message log — its byte payloads are opaque to RDF. A plain object property (the pointed-at container is a core:InformationResource)."@en .

fin:snapshot a owl:ObjectProperty ;
    rdfs:domain fin:Budget ;
    rdfs:range core:InformationResource ;
    rdfs:label "snapshot"@en ;
    skos:definition "A periodic compacted snapshot resource of the budget's CRDT state, so a fresh client need not replay the whole sync log. The pointer to the snapshot resource (an opaque byte payload). A plain object property."@en .

# =============================================================================
# 8. DOUBLE-ENTRY LEDGER — Keystone's general ledger (v1.2.0 ADDITIVE). Generic
#    double-entry bookkeeping terms NOT specific to Keystone, so they live in the
#    shared sector, not a dead w3id.org/keystone/ns# namespace (which returns
#    404). A LedgerAccount is a chart-of-accounts node; a JournalEntry is a
#    balanced set of LedgerEntry postings; each entry posts a debit/credit
#    (fin:entrySide) to an account (fin:postsTo). FIBO's LedgerAccount/LedgerEntry
#    are byte-verified by Keystone and dual-typed there / aligned Mode-A here —
#    these fin: terms carry only the GENERIC double-entry concepts FIBO lacks a
#    single simple term for (the debit/credit side, the account-class/code
#    hierarchy). (revenue-products ontology review §4.)
# =============================================================================

fin:LedgerAccount a owl:Class, gufo:Kind ;
    rdfs:subClassOf core:InformationResource ;
    rdfs:label "Ledger Account"@en ;
    skos:definition "A general-ledger account — a node in a chart of accounts against which double-entry postings (fin:LedgerEntry) are recorded. An information object (the account definition), classified by fin:accountClass (asset/liability/equity/income/expense), identified by fin:accountCode, and nested under a parent via fin:parentAccountCode. Distinct from a fin:FinancialAccount (a real account at an institution, a Relator); a LedgerAccount is a bookkeeping classification. Aligned Mode-A to fibo-fbc-pas-caa:LedgerAccount."@en ;
    skos:scopeNote "gufo:Kind (information object) under core:InformationResource. The chart-of-accounts node; Keystone dual-types it with the byte-verified FIBO LedgerAccount."@en .

fin:JournalEntry a owl:Class, gufo:SubKind ;
    rdfs:subClassOf core:Record ;
    rdfs:label "Journal Entry"@en ;
    skos:definition "A balanced double-entry bookkeeping transaction — a set of fin:LedgerEntry postings whose debits equal its credits, recorded on a date. A core:Record; its component postings reference it via fin:partOfJournalEntry."@en ;
    skos:scopeNote "gufo:SubKind of core:Record. The balance invariant (Σdebits = Σcredits) is a cross-resource check the app enforces, not a single-resource SHACL MUST."@en .

fin:LedgerEntry a owl:Class, gufo:SubKind ;
    rdfs:subClassOf core:Record ;
    rdfs:label "Ledger Entry"@en ;
    skos:definition "One posting line of a double-entry transaction: a monetary amount (fin:hasMonetaryAmount) posted on one side (fin:entrySide → fin:Debit or fin:Credit) to a ledger account (fin:postsTo), as part of a journal entry (fin:partOfJournalEntry). Aligned Mode-A to fibo-fnd-txnsext-rea:LedgerEntry (FIBO's FND/TransactionsExt/REATransactions module — where FIBO's LedgerEntry actually lives, byte-verified by Keystone; NOT the ClientsAndAccounts module that holds LedgerAccount)."@en ;
    skos:scopeNote "gufo:SubKind of core:Record."@en .

# --- ledger coded-value classes (gufo:Category, root core:Category) ---

fin:EntrySide a owl:Class, gufo:Category ;
    rdfs:subClassOf core:Category ;
    rdfs:label "Entry Side"@en ;
    skos:definition "The side of a double-entry posting: debit or credit. A coded value (core:Category); the two members are fin:Debit and fin:Credit in fin:entrySideScheme."@en ;
    skos:scopeNote "gufo:Category of core:Category. FIBO has no single simple debit/credit term — this is the generic double-entry concept Keystone needs."@en .

fin:AccountClass a owl:Class, gufo:Category ;
    rdfs:subClassOf core:Category ;
    rdfs:label "Account Class"@en ;
    skos:definition "The top-level classification of a ledger account: asset / liability / equity / income / expense (the five fundamental accounting classes, whose normal debit/credit balance the double-entry rules follow). A coded value; members are skos:Concepts in fin:accountClassScheme."@en ;
    skos:scopeNote "gufo:Category of core:Category."@en .

# --- ledger properties ---

fin:entrySide a owl:ObjectProperty ;
    rdfs:domain fin:LedgerEntry ;
    rdfs:range fin:EntrySide ;
    rdfs:label "entry side"@en ;
    skos:definition "The side (fin:Debit or fin:Credit) a ledger entry posts on."@en .

fin:postsTo a owl:ObjectProperty ;
    rdfs:domain fin:LedgerEntry ;
    rdfs:range fin:LedgerAccount ;
    rdfs:label "posts to"@en ;
    skos:definition "The ledger account a ledger entry posts to."@en .

fin:partOfJournalEntry a owl:ObjectProperty ;
    rdfs:subPropertyOf core:partOf ;
    rdfs:domain fin:LedgerEntry ;
    rdfs:range fin:JournalEntry ;
    rdfs:label "part of journal entry"@en ;
    skos:definition "The journal entry a ledger-entry posting belongs to. A sub-property of core:partOf (the journal entry aggregates its posting lines)."@en .

fin:accountClass a owl:ObjectProperty ;
    rdfs:domain fin:LedgerAccount ;
    rdfs:range fin:AccountClass ;
    rdfs:label "account class"@en ;
    skos:definition "The fundamental accounting class (a coded fin:AccountClass value) of a ledger account."@en .

fin:accountCode a owl:DatatypeProperty ;
    rdfs:domain fin:LedgerAccount ;
    rdfs:range xsd:string ;
    rdfs:label "account code"@en ;
    skos:definition "The chart-of-accounts code of a ledger account (e.g. \"1200\")."@en .

fin:parentAccountCode a owl:DatatypeProperty ;
    rdfs:domain fin:LedgerAccount ;
    rdfs:range xsd:string ;
    rdfs:label "parent account code"@en ;
    skos:definition "The fin:accountCode of the parent ledger account in the chart-of-accounts hierarchy (the code-based parent link Keystone uses)."@en .

# --- ledger coded-value schemes ---

fin:entrySideScheme a skos:ConceptScheme ;
    rdfs:label "Entry side scheme"@en ;
    skos:definition "The two double-entry sides for fin:entrySide."@en .

fin:Debit a fin:EntrySide, skos:Concept ;
    skos:inScheme fin:entrySideScheme ; skos:notation "debit" ;
    skos:prefLabel "Debit"@en ;
    skos:definition "The debit side of a posting — increases asset/expense accounts, decreases liability/equity/income accounts."@en .
fin:Credit a fin:EntrySide, skos:Concept ;
    skos:inScheme fin:entrySideScheme ; skos:notation "credit" ;
    skos:prefLabel "Credit"@en ;
    skos:definition "The credit side of a posting — increases liability/equity/income accounts, decreases asset/expense accounts."@en .

fin:accountClassScheme a skos:ConceptScheme ;
    rdfs:label "Account class scheme"@en ;
    skos:definition "The five fundamental accounting classes for fin:accountClass."@en .

fin:class-asset a fin:AccountClass, skos:Concept ;
    skos:inScheme fin:accountClassScheme ; skos:notation "asset" ;
    skos:prefLabel "Asset"@en ; skos:definition "Resources owned (normal debit balance)."@en .
fin:class-liability a fin:AccountClass, skos:Concept ;
    skos:inScheme fin:accountClassScheme ; skos:notation "liability" ;
    skos:prefLabel "Liability"@en ; skos:definition "Obligations owed (normal credit balance)."@en .
fin:class-equity a fin:AccountClass, skos:Concept ;
    skos:inScheme fin:accountClassScheme ; skos:notation "equity" ;
    skos:prefLabel "Equity"@en ; skos:definition "Residual owners' interest (normal credit balance)."@en .
fin:class-income a fin:AccountClass, skos:Concept ;
    skos:inScheme fin:accountClassScheme ; skos:notation "income" ;
    skos:prefLabel "Income"@en ; skos:definition "Revenue earned (normal credit balance)."@en .
fin:class-expense a fin:AccountClass, skos:Concept ;
    skos:inScheme fin:accountClassScheme ; skos:notation "expense" ;
    skos:prefLabel "Expense"@en ; skos:definition "Costs incurred (normal debit balance)."@en .

# =============================================================================
# 9. PRIVATE EQUITY — CapNote's capital calls & distributions (v1.2.0 ADDITIVE).
#    Generic PE vocabulary (fund, commitment, notice, GP/LP), NOT CapNote-specific,
#    so it lives in the shared sector rather than a non-dereferencing
#    capnote.app/vocab# namespace. Every amount is a fin:MonetaryAmount node (the
#    dual-typed FIBO+schema shape CapNote already uses). (review §5.)
# =============================================================================

fin:Fund a owl:Class, gufo:Kind ;
    rdfs:subClassOf core:Organization ;
    rdfs:label "Fund"@en ;
    skos:definition "A pooled private-equity / venture / real-asset investment fund vehicle into which limited partners commit capital and from which a general partner draws it down and distributes returns. Its vintage year is fin:vintageYear; its manager is a fin:GeneralPartner. Aligned Mode-A to FIBO's SEC Funds module."@en ;
    skos:scopeNote "gufo:Kind. Roots in core:Organization (a pooled vehicle / legal entity). GP via fin:generalPartner; LP commitments via fin:Commitment."@en .

fin:Commitment a owl:Class, gufo:SubKind ;
    rdfs:subClassOf core:Record ;
    rdfs:label "Commitment"@en ;
    skos:definition "A limited partner's standing commitment of capital to a fund: the committed amount (fin:commitmentAmount), how much has been drawn to date (fin:calledToDate) and the undrawn balance (fin:remainingCommitment), for a fund (fin:fund) and an LP (fin:limitedPartner). A core:Record of the LP↔fund commitment."@en ;
    skos:scopeNote "gufo:SubKind of core:Record. Amounts are fin:MonetaryAmount nodes (the dual-typed FIBO+schema shape)."@en .

fin:Notice a owl:Class, gufo:SubKind ;
    rdfs:subClassOf core:InformationResource ;
    rdfs:label "Notice"@en ;
    skos:definition "A capital-call or distribution notice issued by a fund's general partner to a limited partner: its kind is fin:noticeType (fin:notice-capital-call / fin:notice-distribution), its amount fin:callAmount (a call) or fin:distributionAmount (a distribution), for a fund (fin:fund). An information resource (the notice document); may be dual-typed schema:Invoice for a capital call (with schema:paymentDueDate)."@en ;
    skos:scopeNote "gufo:SubKind of core:InformationResource. Issued date via dcterms:issued; due date via schema:paymentDueDate (Mode-A)."@en .

# --- PE role-mixins (gufo:RoleMixin, root core:Agent) ---

fin:GeneralPartner a owl:Class, gufo:RoleMixin ;
    rdfs:subClassOf core:Agent ;
    rdfs:label "General Partner"@en ;
    skos:definition "The role of the agent (a management company) that manages a fund, draws down committed capital and issues notices."@en ;
    skos:scopeNote "gufo:RoleMixin (cross-kind, anti-rigid) played by an Agent for a fund."@en .

fin:LimitedPartner a owl:Class, gufo:RoleMixin ;
    rdfs:subClassOf core:Agent ;
    rdfs:label "Limited Partner"@en ;
    skos:definition "The role of the agent (an investor) that commits capital to a fund as a limited partner."@en ;
    skos:scopeNote "gufo:RoleMixin played by an Agent for a commitment."@en .

# --- PE coded-value class ---

fin:NoticeType a owl:Class, gufo:Category ;
    rdfs:subClassOf core:Category ;
    rdfs:label "Notice Type"@en ;
    skos:definition "The kind of a fund notice: a capital call (drawing committed capital) or a distribution (returning proceeds). A coded value; members are skos:Concepts in fin:noticeTypeScheme."@en ;
    skos:scopeNote "gufo:Category of core:Category."@en .

# --- PE properties ---

fin:fund a owl:ObjectProperty ;
    rdfs:range fin:Fund ;
    rdfs:label "fund"@en ;
    skos:definition "The fund a commitment or notice concerns. No rdfs:domain — shared by fin:Commitment and fin:Notice."@en .

fin:generalPartner a owl:ObjectProperty ;
    rdfs:range fin:GeneralPartner ;
    rdfs:label "general partner"@en ;
    skos:definition "The agent playing the General Partner role for a fund. No rdfs:domain — carried on a fin:Fund (its manager) or a fin:Notice (its issuer)."@en .

fin:limitedPartner a owl:ObjectProperty ;
    rdfs:domain fin:Commitment ;
    rdfs:range fin:LimitedPartner ;
    rdfs:label "limited partner"@en ;
    skos:definition "The agent playing the Limited Partner role for a commitment."@en .

fin:commitmentAmount a owl:ObjectProperty ;
    rdfs:subPropertyOf fin:hasMonetaryAmount ;
    rdfs:domain fin:Commitment ;
    rdfs:range fin:MonetaryAmount ;
    rdfs:label "commitment amount"@en ;
    skos:definition "The total capital a limited partner has committed to a fund (a fin:MonetaryAmount node)."@en .

fin:calledToDate a owl:ObjectProperty ;
    rdfs:subPropertyOf fin:hasMonetaryAmount ;
    rdfs:domain fin:Commitment ;
    rdfs:range fin:MonetaryAmount ;
    rdfs:label "called to date"@en ;
    skos:definition "The cumulative capital drawn down against a commitment so far (a fin:MonetaryAmount node)."@en .

fin:remainingCommitment a owl:ObjectProperty ;
    rdfs:subPropertyOf fin:hasMonetaryAmount ;
    rdfs:domain fin:Commitment ;
    rdfs:range fin:MonetaryAmount ;
    rdfs:label "remaining commitment"@en ;
    skos:definition "The undrawn balance of a commitment (committed minus called — a fin:MonetaryAmount node)."@en .

fin:callAmount a owl:ObjectProperty ;
    rdfs:subPropertyOf fin:hasMonetaryAmount ;
    rdfs:domain fin:Notice ;
    rdfs:range fin:MonetaryAmount ;
    rdfs:label "call amount"@en ;
    skos:definition "The amount a capital-call notice draws down (a fin:MonetaryAmount node)."@en .

fin:distributionAmount a owl:ObjectProperty ;
    rdfs:subPropertyOf fin:hasMonetaryAmount ;
    rdfs:domain fin:Notice ;
    rdfs:range fin:MonetaryAmount ;
    rdfs:label "distribution amount"@en ;
    skos:definition "The amount a distribution notice returns to a limited partner (a fin:MonetaryAmount node)."@en .

fin:vintageYear a owl:DatatypeProperty ;
    rdfs:domain fin:Fund ;
    rdfs:range xsd:gYear ;
    rdfs:label "vintage year"@en ;
    skos:definition "The vintage year of a fund — the year it began drawing capital, the standard PE cohort key."@en .

fin:noticeType a owl:ObjectProperty ;
    rdfs:domain fin:Notice ;
    rdfs:range fin:NoticeType ;
    rdfs:label "notice type"@en ;
    skos:definition "The kind (a coded fin:NoticeType value) of a fund notice: capital call or distribution."@en .

fin:noticeTypeScheme a skos:ConceptScheme ;
    rdfs:label "Notice type scheme"@en ;
    skos:definition "The kinds of fund notice for fin:noticeType."@en .

fin:notice-capital-call a fin:NoticeType, skos:Concept ;
    skos:inScheme fin:noticeTypeScheme ; skos:notation "capital-call" ;
    skos:prefLabel "Capital call"@en ;
    skos:definition "A notice drawing down committed capital from limited partners (fin:callAmount)."@en .
fin:notice-distribution a fin:NoticeType, skos:Concept ;
    skos:inScheme fin:noticeTypeScheme ; skos:notation "distribution" ;
    skos:prefLabel "Distribution"@en ;
    skos:definition "A notice returning proceeds to limited partners (fin:distributionAmount)."@en .

# =============================================================================
# 10. SHARED FINANCE DATATYPES (v1.2.0 ADDITIVE) — the honest percentage
#     (replacing Keystone's range-violating bare-literal qudt:quantityValue) and
#     a jurisdiction bridge (replacing the GovernmentService-scoped
#     schema:jurisdiction stretch). (review §4.)
# =============================================================================

fin:sharePct a owl:DatatypeProperty ;
    rdfs:range xsd:decimal ;
    rdfs:label "share percentage"@en ;
    skos:definition "A percentage (0–100) — an ownership stake or holding proportion — as a plain xsd:decimal. The HONEST replacement for a range-violating bare-literal qudt:quantityValue (QUDT requires a qudt:QuantityValue NODE; for an app-internal percentage the sector datatype property is the correct weight). No rdfs:domain — used on ownership edges and holdings."@en .

fin:jurisdiction a owl:DatatypeProperty ;
    rdfs:range xsd:string ;
    rdfs:label "jurisdiction"@en ;
    skos:definition "The legal jurisdiction (an ISO 3166 code or name) governing an entity or account. A neutral finance term replacing schema:jurisdiction, whose schema.org domain is GovernmentService/Legislation. No rdfs:domain — carried on institutions, funds or accounts."@en .

# =============================================================================
# SECTOR MARKER — the IRI an app's fedapp:sector points at to declare it operates
# in this sector (https://w3id.org/jeswr/fed#sector). A skos:Concept in the
# federation sector register; dereferences to this ontology.
# =============================================================================

<https://w3id.org/jeswr/sectors/finance#sector>
    a <http://www.w3.org/2004/02/skos/core#Concept> ;
    rdfs:label "Finance sector"@en ;
    rdfs:comment "The Finance data sector. The value an app's fedapp:sector names in its Client Identifier Document to declare it operates over finance data. Backed by this sector ontology."@en ;
    rdfs:isDefinedBy <https://w3id.org/jeswr/sectors/finance> ;
    skos:prefLabel "Finance"@en .
