- Pārlūkā, README, docs, XSD un ODCS aprakstos „naudas fakts” → „finanšu fakts”, „kam nauda paredzēta” → „kam finansējums paredzēts” u. c.; datu struktūra un identifikatori nemainās - Pārlūks: skaidrojums „Tabulās nav klasifikācijas kodu” ar piemēru; virsraksts „Kas datukopā vēl nav iekļauts” Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016679RwmHsuTFfxt26wP6rk
286 lines
17 KiB
XML
286 lines
17 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
Valsts budžets kā kods — loģiskais modelis, shēma v0.1
|
|
PPP Asociācija (PPPA), Valsts Pirmkods (VPK). Melnraksts.
|
|
Plakana struktūra: viens saknes elements un septiņi ierakstu veidi, kas saistīti ar identifikatoriem.
|
|
-->
|
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
xmlns="urn:pppa:vpk:budzets:0.1"
|
|
xmlns:b="urn:pppa:vpk:budzets:0.1"
|
|
targetNamespace="urn:pppa:vpk:budzets:0.1"
|
|
elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.1" xml:lang="lv">
|
|
|
|
<xs:annotation>
|
|
<xs:documentation xml:lang="lv">
|
|
Budžets ir lēmums par periodu: kurš drīkst saņemt vai izlietot finanšu līdzekļus, kādā apmērā, kādam mērķim un pēc kādiem noteikumiem.
|
|
Modelis nav likuma pielikumu izkārtojuma kopija. Pielikumi ir skati, kurus var atjaunot no šiem ierakstiem.
|
|
|
|
Ierakstu veidi:
|
|
Source — avota dokuments (likuma teksts, pielikuma datne) ar kontrolsummu
|
|
Provision — likuma panta daļa (teksts)
|
|
Parameter — likumā vai pielikumā noteikts lielums, kas nav finanšu piešķīrums (piemēram, IKP prognoze)
|
|
Actor — kurš tur, dod vai saņem finansējumu (resors, iestāde, pašvaldība)
|
|
Purpose — kam finansējums paredzēts (resors, programma, apakšprogramma, projekts) kā koks
|
|
ClassItem — izmantotie klasifikāciju kodi ar nosaukumiem un vecākkodu
|
|
Allocation — viens finanšu fakts
|
|
Indicator — mērķa sasniegšanas rādītājs (no budžeta paskaidrojumiem; likumā nav)
|
|
Rule — mašīnlasāms noteikums vai ierobežojums no likuma teksta (piemēram, pārdales robeža)
|
|
Kopsummas, starpsummas un bilance netiek glabātas: tās aprēķina no Allocation ierakstiem.
|
|
Izņēmums: Allocation ar partOf ir „tai skaitā” daļa no cita ieraksta un kopsummās netiek skaitīta otrreiz.
|
|
</xs:documentation>
|
|
</xs:annotation>
|
|
|
|
<!-- ============================================================ identifikatori -->
|
|
<xs:simpleType name="BudgetId">
|
|
<xs:annotation><xs:documentation xml:lang="lv">Budžeta likuma versijas identifikators: lv-vb-GGGG[-rN], kur GGGG ir budžeta gads; -rN — N-tā likuma redakcija (grozījumi).</xs:documentation></xs:annotation>
|
|
<xs:restriction base="xs:ID"><xs:pattern value="lv-vb-[0-9]{4}(-r[0-9]+)?"/></xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="ItemId">
|
|
<xs:annotation><xs:documentation xml:lang="lv">Ieraksta identifikators: budžeta identifikators + segmenti, piemēram lv-vb-2026.a.p04.000123 vai lv-vb-2026.pr.17.23.06.00. Noteikumi: docs/IDENTIFIKATORI.md.</xs:documentation></xs:annotation>
|
|
<xs:restriction base="xs:ID"><xs:pattern value="lv-vb-[0-9]{4}(-r[0-9]+)?(\.[A-Za-z0-9_-]+)+"/></xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="ItemRef">
|
|
<xs:restriction base="xs:string"><xs:pattern value="lv-vb-[0-9]{4}(-r[0-9]+)?(\.[A-Za-z0-9_-]+)+"/></xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="VpkId">
|
|
<xs:annotation><xs:documentation xml:lang="lv">VPK ID no Valsts kancelejas organizāciju reģistra (B01): SS-IIII.</xs:documentation></xs:annotation>
|
|
<xs:restriction base="xs:string"><xs:pattern value="[0-9]{2}-[0-9]{4}"/></xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="Amount">
|
|
<xs:annotation><xs:documentation xml:lang="lv">Summa euro, kā publicēta (veseli euro vai ar centiem). Negatīva vērtība nozīmē samazinājumu vai līdzekļu izlietojumu finansēšanā.</xs:documentation></xs:annotation>
|
|
<xs:restriction base="xs:decimal"><xs:fractionDigits value="2"/></xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<!-- ============================================================ vārdnīcas -->
|
|
<xs:simpleType name="Status">
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="draft"/> <!-- likumprojekts -->
|
|
<xs:enumeration value="adopted"/> <!-- pieņemts un izsludināts -->
|
|
<xs:enumeration value="amended"/> <!-- redakcija pēc grozījumiem -->
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="Flow">
|
|
<xs:annotation><xs:documentation xml:lang="lv">
|
|
revenue — valsts ieņēmumi (nodokļi, nodevas), ko administrē resors;
|
|
resource — resursi izdevumu segšanai konkrētam mērķim (dotācija, pašu ieņēmumi, transferti, ārvalstu palīdzība);
|
|
expenditure — izdevumi; financing — finansēšana (aizņēmumi, aizdevumi, līdzekļu atlikumu izmaiņas).
|
|
</xs:documentation></xs:annotation>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="revenue"/>
|
|
<xs:enumeration value="resource"/>
|
|
<xs:enumeration value="expenditure"/>
|
|
<xs:enumeration value="financing"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="Fund">
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="basic"/> <!-- valsts pamatbudžets -->
|
|
<xs:enumeration value="special"/> <!-- valsts speciālais budžets -->
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="Block">
|
|
<xs:annotation><xs:documentation xml:lang="lv">
|
|
core — valsts pamatfunkciju īstenošana; eu — Eiropas Savienības politiku instrumentu un pārējās ārvalstu finanšu palīdzības līdzfinansēto projektu un pasākumu īstenošana.
|
|
</xs:documentation></xs:annotation>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="core"/>
|
|
<xs:enumeration value="eu"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="Nature">
|
|
<xs:annotation><xs:documentation xml:lang="lv">
|
|
appropriation — apropriācija (drīkst izlietot); forecast — prognoze (sagaidāmie ieņēmumi);
|
|
ceiling — maksimāli pieļaujamais apjoms nākamajiem gadiem (ietvars); commitment — ilgtermiņa saistības;
|
|
earmarkedGrant — mērķdotācija pašvaldībai.
|
|
</xs:documentation></xs:annotation>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="appropriation"/>
|
|
<xs:enumeration value="forecast"/>
|
|
<xs:enumeration value="ceiling"/>
|
|
<xs:enumeration value="commitment"/>
|
|
<xs:enumeration value="earmarkedGrant"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="Scheme">
|
|
<xs:annotation><xs:documentation xml:lang="lv">
|
|
ekk — izdevumu ekonomiskā klasifikācija (MK 27.12.2005. noteikumi Nr. 1031);
|
|
revenue — ieņēmumu klasifikācija (MK noteikumi par budžetu ieņēmumu klasifikāciju);
|
|
financing — finansēšanas klasifikācija (MK 22.11.2005. noteikumi Nr. 875);
|
|
function — funkcionālā klasifikācija (MK noteikumi Nr. 934, COFOG);
|
|
commitment — ilgtermiņa saistību veidi (11. pielikums, 10 ciparu kods);
|
|
law — likuma kopsavilkuma pozīcijas bez klasifikācijas koda (piemēram, KA, PB, IKP).
|
|
</xs:documentation></xs:annotation>
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="ekk"/>
|
|
<xs:enumeration value="revenue"/>
|
|
<xs:enumeration value="financing"/>
|
|
<xs:enumeration value="function"/>
|
|
<xs:enumeration value="commitment"/>
|
|
<xs:enumeration value="law"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="ActorKind">
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="resort"/> <!-- ministrija vai cita centrālā valsts iestāde (budžeta resors) -->
|
|
<xs:enumeration value="institution"/>
|
|
<xs:enumeration value="municipality"/>
|
|
<xs:enumeration value="unallocated"/> <!-- „nesadalītie līdzekļi” -->
|
|
<xs:enumeration value="other"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
<xs:simpleType name="PurposeKind">
|
|
<xs:restriction base="xs:token">
|
|
<xs:enumeration value="resort"/>
|
|
<xs:enumeration value="programme"/>
|
|
<xs:enumeration value="subprogramme"/>
|
|
<xs:enumeration value="project"/>
|
|
<xs:enumeration value="grant"/> <!-- mērķdotācijas mērķis -->
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<!-- ============================================================ ieraksti -->
|
|
<xs:complexType name="SourceType">
|
|
<xs:annotation><xs:documentation xml:lang="lv">Avota dokuments. Katrs Allocation un Provision norāda savu avotu (src).</xs:documentation></xs:annotation>
|
|
<xs:attribute name="id" type="ItemId" use="required"/>
|
|
<xs:attribute name="kind" use="required">
|
|
<xs:simpleType><xs:restriction base="xs:token">
|
|
<xs:enumeration value="lawText"/><xs:enumeration value="annex"/><xs:enumeration value="form"/>
|
|
</xs:restriction></xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="annex" type="xs:positiveInteger"/>
|
|
<xs:attribute name="title" type="xs:string" use="required"/>
|
|
<xs:attribute name="url" type="xs:anyURI" use="required"/>
|
|
<xs:attribute name="sha256" type="xs:hexBinary"/>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="ProvisionType">
|
|
<xs:simpleContent>
|
|
<xs:extension base="xs:string">
|
|
<xs:attribute name="id" type="ItemId" use="required"/>
|
|
<xs:attribute name="chapter" type="xs:string"/>
|
|
<xs:attribute name="article" type="xs:positiveInteger" use="required"/>
|
|
<xs:attribute name="part" type="xs:string"/>
|
|
<xs:attribute name="src" type="ItemRef" use="required"/>
|
|
</xs:extension>
|
|
</xs:simpleContent>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="ParameterType">
|
|
<xs:attribute name="id" type="ItemId" use="required"/>
|
|
<xs:attribute name="name" type="xs:string" use="required"/>
|
|
<xs:attribute name="code" type="xs:string"/>
|
|
<xs:attribute name="year" type="xs:gYear"/>
|
|
<xs:attribute name="value" type="xs:decimal" use="required"/>
|
|
<xs:attribute name="unit" type="xs:string" use="required"/>
|
|
<xs:attribute name="src" type="ItemRef" use="required"/>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="ActorType">
|
|
<xs:attribute name="id" type="ItemId" use="required"/>
|
|
<xs:attribute name="kind" type="ActorKind" use="required"/>
|
|
<xs:attribute name="code" type="xs:string"><xs:annotation><xs:documentation xml:lang="lv">Resora kods budžetā (01–74) vai cits avota kods.</xs:documentation></xs:annotation></xs:attribute>
|
|
<xs:attribute name="vpk" type="VpkId"/>
|
|
<xs:attribute name="name" type="xs:string" use="required"/>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="PurposeType">
|
|
<xs:attribute name="id" type="ItemId" use="required"/>
|
|
<xs:attribute name="kind" type="PurposeKind" use="required"/>
|
|
<xs:attribute name="code" type="xs:string"><xs:annotation><xs:documentation xml:lang="lv">Programmas vai apakšprogrammas kods (NN.NN.NN) vai projekta kods.</xs:documentation></xs:annotation></xs:attribute>
|
|
<xs:attribute name="name" type="xs:string" use="required"/>
|
|
<xs:attribute name="parent" type="ItemRef"/>
|
|
<xs:attribute name="holder" type="ItemRef"/>
|
|
<xs:attribute name="block" type="Block"/>
|
|
<xs:attribute name="function" type="xs:string"/>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="ClassItemType">
|
|
<xs:attribute name="scheme" type="Scheme" use="required"/>
|
|
<xs:attribute name="code" type="xs:string" use="required"/>
|
|
<xs:attribute name="name" type="xs:string" use="required"/>
|
|
<xs:attribute name="parent" type="xs:string"/>
|
|
<xs:attribute name="intraFund" type="xs:boolean" default="false"><xs:annotation><xs:documentation xml:lang="lv">true — transferts viena budžeta veida (fonda) ietvaros; fonda kopsummās (konsolidēti) to neskaita.</xs:documentation></xs:annotation></xs:attribute>
|
|
<xs:attribute name="parentScheme" type="Scheme"><xs:annotation><xs:documentation xml:lang="lv">Vecākkoda shēma, ja tā atšķiras (piemēram, ekk 1000 zem likuma pozīcijas „Uzturēšanas izdevumi”).</xs:documentation></xs:annotation></xs:attribute>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="IndicatorType">
|
|
<xs:attribute name="id" type="ItemId" use="required"/>
|
|
<xs:attribute name="purpose" type="ItemRef" use="required"/>
|
|
<xs:attribute name="name" type="xs:string" use="required"/>
|
|
<xs:attribute name="unit" type="xs:string" use="required"/>
|
|
<xs:attribute name="year" type="xs:gYear" use="required"/>
|
|
<xs:attribute name="base" type="xs:decimal"/>
|
|
<xs:attribute name="target" type="xs:decimal"/>
|
|
<xs:attribute name="src" type="ItemRef" use="required"/>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="RuleType">
|
|
<xs:simpleContent>
|
|
<xs:extension base="xs:string">
|
|
<xs:attribute name="id" type="ItemId" use="required"/>
|
|
<xs:attribute name="kind" use="required">
|
|
<xs:simpleType><xs:restriction base="xs:token">
|
|
<xs:enumeration value="limit"/><xs:enumeration value="condition"/><xs:enumeration value="permission"/>
|
|
</xs:restriction></xs:simpleType>
|
|
</xs:attribute>
|
|
<xs:attribute name="appliesTo" type="xs:string"/>
|
|
<xs:attribute name="parameter" type="xs:string"/>
|
|
<xs:attribute name="value" type="xs:decimal"/>
|
|
<xs:attribute name="unit" type="xs:string"/>
|
|
<xs:attribute name="provision" type="ItemRef" use="required"/>
|
|
</xs:extension>
|
|
</xs:simpleContent>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="AllocationType">
|
|
<xs:annotation><xs:documentation xml:lang="lv">Viens finanšu fakts. Kopsummas aprēķina, saskaitot ierakstus bez partOf.</xs:documentation></xs:annotation>
|
|
<xs:attribute name="id" type="ItemId" use="required"/>
|
|
<xs:attribute name="flow" type="Flow" use="required"/>
|
|
<xs:attribute name="fund" type="Fund" use="required"/>
|
|
<xs:attribute name="nature" type="Nature" use="required"/>
|
|
<xs:attribute name="year" type="xs:gYear" use="required"/>
|
|
<xs:attribute name="untilEnd" type="xs:boolean" default="false"><xs:annotation><xs:documentation xml:lang="lv">true — summa attiecas uz laiku no „year” līdz projekta beigām (11. pielikuma „tālākā laika posmā”).</xs:documentation></xs:annotation></xs:attribute>
|
|
<xs:attribute name="periodFrom" type="xs:date"/>
|
|
<xs:attribute name="periodTo" type="xs:date"/>
|
|
<xs:attribute name="holder" type="ItemRef"><xs:annotation><xs:documentation xml:lang="lv">Actor, kura budžetā ir summa (resors).</xs:documentation></xs:annotation></xs:attribute>
|
|
<xs:attribute name="recipient" type="ItemRef"><xs:annotation><xs:documentation xml:lang="lv">Actor, kas saņem (piemēram, pašvaldība mērķdotācijai).</xs:documentation></xs:annotation></xs:attribute>
|
|
<xs:attribute name="purpose" type="ItemRef"/>
|
|
<xs:attribute name="block" type="Block"/>
|
|
<xs:attribute name="commitmentKind" type="xs:string"><xs:annotation><xs:documentation xml:lang="lv">Saistību veida kods (ClassItem scheme="commitment").</xs:documentation></xs:annotation></xs:attribute>
|
|
<xs:attribute name="function" type="xs:string"/>
|
|
<xs:attribute name="scheme" type="Scheme" use="required"/>
|
|
<xs:attribute name="code" type="xs:string" use="required"/>
|
|
<xs:attribute name="amount" type="Amount" use="required"/>
|
|
<xs:attribute name="partOf" type="ItemRef"><xs:annotation><xs:documentation xml:lang="lv">„Tai skaitā”: šī summa ir daļa no norādītā ieraksta.</xs:documentation></xs:annotation></xs:attribute>
|
|
<xs:attribute name="src" type="ItemRef" use="required"/>
|
|
<xs:attribute name="srcRow" type="xs:positiveInteger"><xs:annotation><xs:documentation xml:lang="lv">Rinda avota datnē, lai katru summu var pārbaudīt.</xs:documentation></xs:annotation></xs:attribute>
|
|
</xs:complexType>
|
|
|
|
<!-- ============================================================ sakne -->
|
|
<xs:element name="Budget">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="Source" type="SourceType" maxOccurs="unbounded"/>
|
|
<xs:element name="Provision" type="ProvisionType" minOccurs="0" maxOccurs="unbounded"/>
|
|
<xs:element name="Parameter" type="ParameterType" minOccurs="0" maxOccurs="unbounded"/>
|
|
<xs:element name="Actor" type="ActorType" maxOccurs="unbounded"/>
|
|
<xs:element name="Purpose" type="PurposeType" minOccurs="0" maxOccurs="unbounded"/>
|
|
<xs:element name="Indicator" type="IndicatorType" minOccurs="0" maxOccurs="unbounded"/>
|
|
<xs:element name="Rule" type="RuleType" minOccurs="0" maxOccurs="unbounded"/>
|
|
<xs:element name="ClassItem" type="ClassItemType" maxOccurs="unbounded"/>
|
|
<xs:element name="Allocation" type="AllocationType" maxOccurs="unbounded"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="id" type="BudgetId" use="required"/>
|
|
<xs:attribute name="title" type="xs:string" use="required"/>
|
|
<xs:attribute name="year" type="xs:gYear" use="required"/>
|
|
<xs:attribute name="horizonTo" type="xs:gYear" use="required"/>
|
|
<xs:attribute name="status" type="Status" use="required"/>
|
|
<xs:attribute name="act" type="xs:anyURI" use="required"/>
|
|
<xs:attribute name="published" type="xs:string"/>
|
|
<xs:attribute name="version" type="xs:string"><xs:annotation><xs:documentation xml:lang="lv">Budžeta versija avota sistēmā (piemēram, D200).</xs:documentation></xs:annotation></xs:attribute>
|
|
</xs:complexType>
|
|
<xs:key name="itemKey"><xs:selector xpath="b:Source|b:Provision|b:Parameter|b:Actor|b:Purpose|b:Indicator|b:Rule|b:Allocation"/><xs:field xpath="@id"/></xs:key>
|
|
<xs:key name="classKey"><xs:selector xpath="b:ClassItem"/><xs:field xpath="@scheme"/><xs:field xpath="@code"/></xs:key>
|
|
</xs:element>
|
|
</xs:schema>
|