@prefix : <https://ontology.inferal.com/modules/advertising-budget/> .
@prefix adm: <https://ontology.inferal.com/modules/advertising-measurement/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix mod: <https://w3id.org/mod#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pubacc: <https://ontology.inferal.com/modules/publication-access/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rng: <https://ontology.inferal.com/modules/range/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:
    a owl:Ontology, pubacc:PublicationManagedOntology ;
    dcterms:accessRights pubacc:PublicAccess ;
    owl:imports
        adm: ,
        rng: ,
        <http://www.w3.org/2004/02/skos/core> ;
    dcterms:title "Advertising Budget Ontology" ;
    dcterms:description "Terms for stating an advertising budget as separable parts: an amount, the period it renews over, how it is paced, what it applies to, and whether it is shared. Spend caps are modelled apart from budgets." ;
    dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
    dcterms:source adm: , rng: , <http://www.w3.org/2004/02/skos/core> ;
    vann:preferredNamespacePrefix "abg" ;
    vann:preferredNamespaceUri "https://ontology.inferal.com/modules/advertising-budget/" ;
    mod:status "draft" ;
    rdfs:comment "Budget is one word covering five independent things: how much, over what period, how fast, applied to what, and shared with whom. Providers collapse them differently. One encodes the period in the field name and the amount as a minor-unit string; another separates the period into an enumeration and the amount into micros; a third carries a money object with no period at all. A figure is meaningless without all five, and two figures are comparable only when the period, pacing, and scope agree. This module names the parts so a rule can check that before comparing. Money is reused from the advertising-measurement module rather than restated, so a budget and a spend observation are denominated in the same terms." ;
    owl:versionInfo "0.1.0" .


# --- Budget ------------------------------------------------------------------

:Budget
    a rdfs:Class ;
    rdfs:label "budget" ;
    rdfs:comment "A planned spending allowance: an amount of money, the period it applies over, how it is paced within that period, and the scope of entities it covers." ;
    dcterms:description "A budget directs delivery. Pacing spends toward it, and exhausting it stops delivery. That is what separates it from a spend cap, which only forbids exceeding a ceiling. Two budgets are comparable only when their period, delivery method, and scope agree; a daily figure and a lifetime figure are different quantities wearing the same word." .

:BudgetPeriod
    a rdfs:Class ;
    rdfs:subClassOf skos:Concept ;
    rdfs:label "budget period" ;
    rdfs:comment "The recurrence over which a budget amount is allowed to be spent, such as each day or once over the whole flight." ;
    dcterms:description "A first-class value rather than a suffix on a property name. One provider distinguishes daily from lifetime by having two separate fields, which makes the period invisible to any rule that reads only the amount. Comparing or summing across periods is the most common budget error." .

:DeliveryMethod
    a rdfs:Class ;
    rdfs:subClassOf skos:Concept ;
    rdfs:label "delivery method" ;
    rdfs:comment "How spending is paced within the budget period: evenly across it, or as quickly as inventory allows." ;
    dcterms:description "Pacing changes what a partial-period figure means. Under accelerated delivery a budget can be exhausted early, so a mid-period spend total is not a proportional indicator of the period's outcome. A consumer comparing pacing-sensitive metrics must be able to see this." .

:BudgetScope
    a rdfs:Class ;
    rdfs:label "budget scope" ;
    rdfs:comment "The set of advertising entities a budget or spend cap applies to, and whether that set is shared." ;
    dcterms:description "Reified because scope is not always one entity. When a budget covers several entities at once, spend cannot be attributed to any one of them, which invalidates per-entity cost and return figures computed from it. Stating scope as its own resource is what lets that condition be detected instead of assumed away." .

:SpendCap
    a rdfs:Class ;
    rdfs:label "spend cap" ;
    rdfs:comment "A ceiling on spending that constrains delivery without directing it." ;
    dcterms:description "Deliberately not a kind of budget. A cap forbids exceeding an amount; a budget is a target that pacing spends toward. One provider ships daily budget, lifetime budget, and spend cap as three identically shaped minor-unit strings, which invites reading a ceiling as a target and reporting an account as underspending when it is capped." .


# --- Object properties -------------------------------------------------------

:budgetAmount
    a rdf:Property ;
    rdfs:label "budget amount" ;
    rdfs:comment "The allowance a budget permits, as a monetary amount reused from the advertising measurement vocabulary so budgets and spend are denominated in the same terms." ;
    rdfs:domain :Budget ;
    rdfs:range adm:MonetaryAmount .

:budgetPeriod
    a rdf:Property ;
    rdfs:label "has budget period" ;
    rdfs:comment "The recurrence the budget amount applies over." ;
    rdfs:domain :Budget ;
    rdfs:range :BudgetPeriod .

:budgetDeliveryMethod
    a rdf:Property ;
    rdfs:label "has delivery method" ;
    rdfs:comment "How the budget is paced within its period." ;
    rdfs:domain :Budget ;
    rdfs:range :DeliveryMethod .

:appliesToScope
    a rdf:Property ;
    rdfs:label "applies to scope" ;
    rdfs:comment "The scope of entities the budget covers." ;
    rdfs:domain :Budget ;
    rdfs:range :BudgetScope .

:coversEntity
    a rdf:Property ;
    rdfs:label "covers entity" ;
    rdfs:comment "An advertising entity that a scope covers. A scope covering more than one entity is shared, and spend under it cannot be attributed to any single covered entity." ;
    dcterms:description "Optional, because a provider may report that a budget is shared and how many entities reference it without naming them. Absence means the covered set is unenumerated, not empty: a consumer must not read a scope with no covered entities as covering nothing." ;
    rdfs:domain :BudgetScope ;
    rdfs:range rdfs:Resource .

:coveredEntityCount
    a rdf:Property ;
    rdfs:label "covered entity count" ;
    rdfs:comment "How many entities a scope covers, for providers that report the count without enumerating the entities." ;
    dcterms:description "Recorded separately from the covered entities because the two carry different information and a provider may send either. A count greater than one establishes the attribution hazard even where nothing can be named, which is the case that matters: knowing spend is unattributable is more useful than knowing which entities it is unattributable across." ;
    rdfs:domain :BudgetScope ;
    rdfs:range xsd:integer .

:capAmount
    a rdf:Property ;
    rdfs:label "cap amount" ;
    rdfs:comment "The ceiling a spend cap imposes, as a monetary amount reused from the advertising measurement vocabulary." ;
    rdfs:domain :SpendCap ;
    rdfs:range adm:MonetaryAmount .

:capPeriod
    a rdf:Property ;
    rdfs:label "has cap period" ;
    rdfs:comment "The recurrence a spend cap's ceiling applies over." ;
    rdfs:domain :SpendCap ;
    rdfs:range :BudgetPeriod .

:constrainsScope
    a rdf:Property ;
    rdfs:label "constrains scope" ;
    rdfs:comment "The scope of entities a spend cap applies to." ;
    rdfs:domain :SpendCap ;
    rdfs:range :BudgetScope .

:effectiveWindow
    a rdf:Property ;
    rdfs:label "effective window" ;
    rdfs:comment "The interval over which a budget or cap is in force, for a flight with a defined start and end. Open above when the allowance is standing." ;
    rdfs:domain :Budget ;
    rdfs:range rng:Range .


# --- Datatype properties -----------------------------------------------------

:sharedAcrossEntities
    a rdf:Property ;
    rdfs:label "shared across entities" ;
    rdfs:comment "True when a scope's allowance is pooled across the entities it covers rather than divided among them. Asserted by producers even where it can be derived from the covered entities, because some providers report sharing without enumerating what is shared." ;
    rdfs:domain :BudgetScope ;
    rdfs:range xsd:boolean .


# --- Budget period scheme ----------------------------------------------------

:BudgetPeriodScheme
    a skos:ConceptScheme ;
    rdfs:label "budget period scheme" ;
    rdfs:comment "Controlled vocabulary of budget recurrences." ;
    skos:prefLabel "Budget periods" .

:dailyPeriod
    a :BudgetPeriod, skos:Concept ;
    skos:inScheme :BudgetPeriodScheme ;
    rdfs:label "daily" ;
    rdfs:comment "The amount is allowed each day and resets at the provider's day boundary." ;
    skos:definition "A recurring per-day allowance." .

:lifetimePeriod
    a :BudgetPeriod, skos:Concept ;
    skos:inScheme :BudgetPeriodScheme ;
    rdfs:label "lifetime" ;
    rdfs:comment "The amount is allowed once across the entire flight and does not reset." ;
    skos:definition "A single allowance spanning the whole effective window." .

:customPeriod
    a :BudgetPeriod, skos:Concept ;
    skos:inScheme :BudgetPeriodScheme ;
    rdfs:label "custom period" ;
    rdfs:comment "The amount is allowed once across a provider-defined span that is neither a day nor the entity's whole flight. The span itself is carried by the effective window rather than by this concept." ;
    skos:definition "A single allowance over an explicitly bounded span." .


# --- Delivery method scheme --------------------------------------------------

:DeliveryMethodScheme
    a skos:ConceptScheme ;
    rdfs:label "delivery method scheme" ;
    rdfs:comment "Controlled vocabulary of pacing behaviours." ;
    skos:prefLabel "Delivery methods" .

:standardDelivery
    a :DeliveryMethod, skos:Concept ;
    skos:inScheme :DeliveryMethodScheme ;
    rdfs:label "standard" ;
    rdfs:comment "Spending is paced evenly across the budget period." ;
    skos:definition "Even pacing across the period." .

:acceleratedDelivery
    a :DeliveryMethod, skos:Concept ;
    skos:inScheme :DeliveryMethodScheme ;
    rdfs:label "accelerated" ;
    rdfs:comment "Spending proceeds as quickly as inventory allows and may exhaust the budget before the period ends." ;
    skos:definition "Unpaced delivery, front-loaded within the period." .
