@prefix decision: <https://ontology.inferal.com/modules/decision/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ex: <https://example.com/decision/cache/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# The goal is the desired future state; the issue is the question being decided.
ex:reduce-latency
    a decision:Goal ;
    dcterms:title "Reduce checkout latency"@en .

ex:cache-issue
    a decision:Issue ;
    dcterms:title "Choose a cache for the checkout service"@en .

# Options are alternatives, not commitments. This option also records a projection.
ex:managed-cache
    a decision:Option ;
    dcterms:title "Use the managed cache service"@en ;
    decision:anticipatesConsequence ex:lower-operations-load .

ex:self-hosted-cache
    a decision:Option ;
    dcterms:title "Operate a self-hosted cache"@en .

# An anticipated consequence is a forecast, not an observation that it occurred.
ex:lower-operations-load
    a decision:AnticipatedConsequence ;
    dcterms:description "The platform team expects less operational work."@en .

# The criterion names the dimension used by the qualified evaluation below.
ex:operations-cost
    a decision:Criterion ;
    dcterms:title "Operations cost"@en .

# Evidence stays a distinct PROV entity so its provenance can be described separately.
ex:service-pricing
    a prov:Entity ;
    dcterms:title "Managed service pricing estimate"@en .

# This resource qualifies one option against one criterion and cites its evidence.
ex:managed-cost-evaluation
    a decision:Evaluation ;
    decision:evaluatesOption ex:managed-cache ;
    decision:appliesCriterion ex:operations-cost ;
    decision:basedOnEvidence ex:service-pricing ;
    prov:value "Lower operational cost despite higher direct fees"@en .

ex:architecture-council
    a prov:Organization .

# The deliberation gathers the issue, goal, options, evaluation, actor, and end time.
# generatedDecision points to the commitment produced by this activity.
ex:cache-deliberation
    a decision:Deliberation ;
    decision:addressesIssue ex:cache-issue ;
    decision:pursuesGoal ex:reduce-latency ;
    decision:considersOption ex:managed-cache, ex:self-hosted-cache ;
    decision:hasEvaluation ex:managed-cost-evaluation ;
    decision:generatedDecision ex:use-managed-cache ;
    prov:wasAssociatedWith ex:architecture-council ;
    prov:endedAtTime "2026-07-13T17:00:00Z"^^xsd:dateTime .

# The decision is the commitment. It is not the selected option or its document.
# basedOnEvaluation is intentionally non-exhaustive: other influences may be absent.
ex:use-managed-cache
    a decision:Decision ;
    decision:resultedFromDeliberation ex:cache-deliberation ;
    decision:selectedOption ex:managed-cache ;
    decision:basedOnEvaluation ex:managed-cost-evaluation ;
    prov:wasAttributedTo ex:architecture-council .

# The rationale is its own information entity, derived here from the evaluation.
ex:cache-rationale
    a decision:Rationale ;
    dcterms:description "The managed service best balances latency and operational cost."@en ;
    prov:wasDerivedFrom ex:managed-cost-evaluation .

# The ADR documents the commitment but remains a distinct, independently revisable entity.
ex:adr-0042
    a decision:DecisionRecord ;
    dcterms:title "ADR 0042: Use the managed cache service"@en ;
    decision:recordsDecision ex:use-managed-cache ;
    decision:hasRationale ex:cache-rationale ;
    prov:wasAttributedTo ex:architecture-council .

# Implementation is modeled as a later activity, not entailed by selecting the option.
ex:deploy-managed-cache
    a decision:ResultingAction ;
    decision:implementsDecision ex:use-managed-cache ;
    decision:producedConsequence ex:measured-operations-load ;
    prov:wasAssociatedWith ex:architecture-council .

# This is an observed outcome. Its correspondence to the forecast is not identity
# and does not prove that the deployment was its only cause.
ex:measured-operations-load
    a decision:ObservedConsequence ;
    dcterms:description "On-call interventions fell after the managed cache deployment."@en ;
    decision:correspondsToAnticipation ex:lower-operations-load .

# Explicit feedback closes the loop without implying that every later decision uses it.
ex:next-capacity-deliberation
    a decision:Deliberation ;
    decision:addressesIssue ex:cache-issue ;
    decision:pursuesGoal ex:reduce-latency ;
    decision:considersOption ex:managed-cache ;
    decision:informedByConsequence ex:measured-operations-load .
