{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Fiscal Data Package", "description": "Fiscal Data Package is a simple specification for data access and delivery of fiscal data.", "type": "object", "required": [ "name", "title", "resources", "model" ], "properties": { "name": { "$ref": "definitions.json#/define/name", "propertyOrder": 10 }, "title": { "$ref": "definitions.json#/define/title", "propertyOrder": 20 }, "description": { "$ref": "definitions.json#/define/description", "format": "textarea", "propertyOrder": 30 }, "homepage": { "$ref": "definitions.json#/define/homepage", "propertyOrder": 40 }, "version": { "$ref": "definitions.json#/define/version", "propertyOrder": 50 }, "license": { "$ref": "definitions.json#/define/license", "propertyOrder": 60 }, "author": { "$ref": "definitions.json#/define/author", "propertyOrder": 70 }, "contributors": { "$ref": "definitions.json#/define/contributors", "propertyOrder": 80, "options": { "hidden": true } }, "resources": { "title": "Resources", "description": "The data resources that this package describes.", "type": "array", "propertyOrder": 90, "minItems": 0, "items": { "type": "object", "properties": { "name": { "$ref": "definitions.json#/define/name", "propertyOrder": 10 }, "title": { "$ref": "definitions.json#/define/title", "propertyOrder": 20 }, "description": { "$ref": "definitions.json#/define/description", "propertyOrder": 30, "format": "textarea" }, "schema": { "$ref": "definitions.json#/define/schema", "propertyOrder": 40 }, "url": { "$ref": "definitions.json#/define/url", "propertyOrder": 50 }, "path": { "$ref": "definitions.json#/define/path", "propertyOrder": 60 }, "data": { "$ref": "definitions.json#/define/data", "propertyOrder": 70 }, "format": { "$ref": "definitions.json#/define/format", "propertyOrder": 80 }, "mediatype": { "$ref": "definitions.json#/define/mediatype", "propertyOrder": 90 }, "encoding": { "$ref": "definitions.json#/define/encoding", "propertyOrder": 100 }, "bytes": { "$ref": "definitions.json#/define/bytes", "propertyOrder": 110, "options": { "hidden": true } }, "hash": { "$ref": "definitions.json#/define/hash", "propertyOrder": 120, "options": { "hidden": true } }, "dialect": { "$ref": "definitions.json#/define/dialect", "propertyOrder": 130, "options": { "hidden": true } }, "sources": { "$ref": "definitions.json#/define/sources", "propertyOrder": 140, "options": { "hidden": true } }, "license": { "$ref": "definitions.json#/define/license", "description": "The license under which the resource is published.", "propertyOrder": 150, "options": { "hidden": true } } }, "anyOf": [ { "title": "url required", "required": ["url"] }, { "title": "path required", "required": ["path"] }, { "title": "data required", "required": ["data"] } ] } }, "keywords": { "$ref": "definitions.json#/define/keywords", "propertyOrder": 100 }, "sources": { "$ref": "definitions.json#/define/sources", "propertyOrder": 110, "options": { "hidden": true } }, "image": { "$ref": "definitions.json#/define/image", "propertyOrder": 120, "options": { "hidden": true } }, "base": { "$ref": "definitions.json#/define/base", "propertyOrder": 130, "options": { "hidden": true } }, "dataDependencies": { "$ref": "definitions.json#/define/dataDependencies", "propertyOrder": 140, "options": { "hidden": true } }, "countryCode": { "$ref": "definitions.json#/define/countryCode" }, "granularity": { "title": "Granularity of resources", "description": "A keyword that represents the type of spend data, eiter aggregated or transactional", "type": "string", "enum": ["aggregated", "transactional"] }, "fiscalPeriod": { "title": "Fiscal period for the budget", "description": "The fiscal period of the dataset", "type": "object", "properties": { "start": { "type": "string", "pattern": "^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12]\\d|3[01])" }, "end": { "type": "string", "pattern": "^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12]\\d|3[01])" } }, "required": ["start"] }, "model": { "title": "Model", "description": "The 'logical model' for the data", "type": "object", "properties": { "measures": { "title": "Measures", "description": "Measures are numerical and correspond to financial amounts in the source data.", "type": "object", "patternProperties": { "^\\w+": { "type": "object", "properties": { "source": { "type": "string" }, "resource": { "type": "string" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }, "factor": { "type": "number" }, "direction": { "title": "Direction of the spending", "description": "A keyword that represents the direction of the spend, either expenditure or revenue.", "type": "string", "enum": [ "expenditure", "revenue" ] }, "phase": { "title": "Budget phase", "description": "A keyword that represents the phase of the data, can be proposed for a budget proposal, approved for an approved budget, adjusted for modified budget or executed for the enacted budget", "type": "string", "enum": ["proposed", "approved", "adjusted", "executed"] } }, "required": [ "source", "currency" ] } } }, "dimensions": { "title": "Dimensions", "description": "Dimensions are groups of related fields. Dimensions cover all items other than the measure.", "type": "object", "patternProperties": { "^\\w+": { "type": "object", "properties": { "attributes": { "title": "Attributes", "description": "Attribute objects that make up the dimension", "type": "object", "minItems": 1, "patternProperties": { "^\\w+": { "type": "object", "properties": { "source": { "type": "string" }, "resource": { "type": "string" }, "constant": { "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "parent": { "type": "string" }, "labelfor": { "type": "string" } }, "required": [ "source" ] } } }, "primaryKey": { "title": "Primary Key", "description": "Either an array of strings corresponding to the name attributes in a set of field objects in the fields array or a single string corresponding to one of these names. The value of primaryKey indicates the primary key or primary keys for the dimension.", "oneOf": [ { "type": "string" }, { "type": "array", "minItems": 1, "items": { "type": "string" } } ] }, "dimensionType": { "title": "Dimension Type", "description": "Describes what kind of a dimension it is.", "type": "string", "enum": [ "datetime", "entity", "classification", "activity", "fact", "location", "other" ] }, "classificationType": { "title": "Classification Type", "description": "The type of the classification.", "enum": [ "functional", "administrative", "economic" ] } }, "required": [ "attributes", "primaryKey" ] } } } }, "required": [ "measures", "dimensions" ] } } }