UNPKG

@hestia-earth/schema

Version:
331 lines (330 loc) 15.5 kB
import { JSON, SchemaType } from './types'; import { Term } from './Term'; import { Source } from './Source'; import { Property } from './Property'; import { Transport } from './Transport'; import { TermTermType } from './Term'; export declare enum ProductStatsDefinition { animals = "animals", cycles = "cycles", modelled = "modelled", 'other observations' = "other observations", regions = "regions", replications = "replications", simulated = "simulated", sites = "sites", spatial = "spatial", time = "time" } export declare enum ProductMethodClassification { 'consistent external sources' = "consistent external sources", 'estimated with assumptions' = "estimated with assumptions", 'expert opinion' = "expert opinion", 'inconsistent external sources' = "inconsistent external sources", modelled = "modelled", 'non-verified survey data' = "non-verified survey data", 'physical measurement' = "physical measurement", 'unsourced assumption' = "unsourced assumption", 'verified survey data' = "verified survey data" } export declare enum ProductFate { 'anaerobic digestion' = "anaerobic digestion", bedding = "bedding", breeding = "breeding", burnt = "burnt", 'burnt for fuel' = "burnt for fuel", composted = "composted", fodder = "fodder", 'home consumption' = "home consumption", processing = "processing", 'saved for seeds' = "saved for seeds", sold = "sold", 'sold for breeding' = "sold for breeding", 'sold for fattening' = "sold for fattening", 'sold for slaughter' = "sold for slaughter", 'sold to domestic market' = "sold to domestic market", 'sold to export market' = "sold to export market", 'used as fertiliser' = "used as fertiliser", 'used as mulch' = "used as mulch", 'used as soil amendment' = "used as soil amendment" } export declare enum ProductPriceStatsDefinition { cycles = "cycles", 'cycles and time' = "cycles and time", time = "time" } export declare enum ProductRevenueStatsDefinition { cycles = "cycles", 'cycles and time' = "cycles and time", time = "time" } /** * Contains all the TermTermType with override on the Product. * Note: it does not contain the default TermTermType on related Blank Nodes. */ export declare const productTermTermType: { term: TermTermType[]; model: TermTermType[]; all: TermTermType[]; }; /** * Contains all the fields that make the blank nodes unique. */ export declare const productUniquenessFields: { properties: string[]; transport: string[]; }; /** * A Product created during a [Cycle](/schema/Cycle) or [Transformation](/schema/Transformation). Each Product must be unique, and the fields which determine uniqueness are defined in the <code>[products](/schema/Cycle#products)</code> field of the Cycle or [Transformation](/schema/Transformation#products). */ export declare class Product extends JSON<SchemaType.Product> { /** * A reference to the [Term](/schema/Term) describing the Product. */ term?: Term; /** * A short description of the Product. */ description?: string; /** * The variety (cultivar) of a crop or breed of animal. Standardised variety names are defined in external glossaries, such as the [OECD](https://www.niab.com/oecdv2/variety), [GEVES](https://www.geves.fr/catalogue-france/), [PLUTO](https://www.upov.int/pluto/en/), or [CPVO](https://online.plantvarieties.eu/) glossaries. */ variety?: string; /** * The quantity of the Product. If an average, it should always be the mean. Can be a single number (array of length one) or an array of numbers with associated [dates](/schema/Product#dates) (e.g., for multiple harvests in one [Cycle]). The units are always specified in the [Term](/schema/Term). For crops, value should always be per harvest or per year, following [FAOSTAT conventions](http://www.fao.org/economic/the-statistics-division-ess/methodology/methodology-systems/crops-statistics-concepts-definitions-and-classifications/en/). */ value?: (number | null)[]; /** * An array of up to 1000 random samples from the posterior distribution of <code>[value](/schema/Emission#value)</code. This should describe the entire distribution of the dataset and not the distribution of the mean. Multiple arrays can be nested where each array corresponds to a date from the <code>[dates](/schema/Product#dates)</code> field. */ distribution?: (number)[] | number[][]; /** * The standard deviation of <code>[value](/schema/Product#value)</code>. */ sd?: (number | null)[]; /** * The minimum of <code>[value](/schema/Product#value)</code>. */ min?: (number | null)[]; /** * The maximum of <code>[value](/schema/Product#value)</code>. */ max?: (number | null)[]; /** * The 10th percentile of <code>[value](/schema/Product#value)</code>. */ percentile10th?: number; /** * The 90th percentile of <code>[value](/schema/Product#value)</code>. */ percentile90th?: number; /** * What the descriptive statistics (<code>[sd](/schema/Product#sd)</code>, <code>[min](/schema/Product#min)</code>, <code>[max](/schema/Product#max)</code>, and <code>[value](/schema/Product#value)</code>) are calculated across, or whether they are simulated or the output of a model. <code>spatial</code> refers to descriptive statistics calculated across spatial units (e.g., pixels) within a region or country. <code>time</code> refers to descriptive statistics calculated across units of time (e.g., hours). */ statsDefinition?: ProductStatsDefinition; /** * The number of observations the descriptive statistics are calculated over. */ observations?: (number | null)[]; /** * A corresponding array to [value](/schema/Product#value), representing the dates of the Products in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD, YYYY-MM, YYYY, --MM-DD, --MM, or YYYY-MM-DDTHH:mm:ssZ). */ dates?: (string)[]; /** * For Products created over periods, the start date of the Product if different from the start date of the [Cycle](/schema/Cycle) in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD, YYYY-MM, or YYYY). */ startDate?: string; /** * For Products created over periods, the end date of the Product if different from the end date of the [Cycle](/schema/Cycle) in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD, YYYY-MM, or YYYY). */ endDate?: string; /** * A classification of the method used to acquire or estimate the <code>[term](/schema/Product#term)</code> and <code>[value](/schema/Product#value)</code>. Overrides the <code>[defaultMethodClassification](/schema/Cycle#defaultMethodClassification)</code> specified in the [Cycle](/schema/Cycle). <code>methodClassification</code> should be specified separately for <code>[properties](/schema/Product#properties)</code> (see <code>[Property](/schema/Property#methodClassification)</code>) and <code>[transport](/schema/Product#transport)</code> (see <code>[Transport](/schema/Transport#methodClassification)</code>). <ul class="is-pl-3 is-list-style-disc"> <li> <code>physical measurement</code> means the amount is quantified using weighing, volume measurement, metering, chemical methods, or other physical approaches. </li> <li> <code>verified survey data</code> means the data are initially collected through surveys; all or a subset of the data are verified using physical methods; and erroneous survey data are discarded or corrected. </li> <li> <code>non-verified survey data</code> means the data are collected through surveys that have not been subjected to verification. </li> <li> <code>modelled</code> means a previously calibrated model is used to estimate this data point from other data points describing this Cycle. </li> <li> <code>estimated with assumptions</code> means a documented assumption is used to estimate this data point from other data points describing this Cycle. </li> <li> <code>consistent external sources</code> means the data are taken from external datasets referring to different producers/enterprises: <ul class="is-pl-4 is-list-style-disc"> <li> Using the same technology (defined as the same [System](/glossary?termType=system) or the same key [Practices](/schema/Practice) as those specified in the Cycle); </li> <li> At the same date (defined as occurring within the [startDate](/schema/Cycle#startDate) and [endDate](/schema/Cycle#endDate) of the Cycle); and </li> <li> In the same [region](/schema/Site#region) or [country](/schema/Site#country). </li> </ul> Modelling or assumptions may have also been used to transform these data. </li> <li> <code>inconsistent external sources</code> means the data are taken from external datasets referring to different producers/enterprises: <ul class="is-pl-4 is-list-style-disc"> <li> Using a different technology (defined as a different [System](/glossary?termType=system) or using different key [Practices](/schema/Practice) to those specified in the Cycle); </li> <li> At a different date (defined as occurring within the [startDate](/schema/Cycle#startDate) and [endDate](/schema/Cycle#endDate) of the Cycle); or </li> <li> In a different [region](/schema/Site#region) or [country](/schema/Site#country). </li> </ul> Modelling or assumptions may have also been used to transform these data. </li> <li> <code>expert opinion</code> means the data have been estimated by experts in the field. </li> <li> <code>unsourced assumption</code> means the data do not have a clear source and/or are based on assumptions only. </li> </ul> */ methodClassification?: ProductMethodClassification; /** * A justification of the <code>[methodClassification](/schema/Product#methodClassification)</code> used. If the data were <code>estimated with assumptions</code> this field should also describe the assumptions. This is a required field if <code>[methodClassification](/schema/Product#methodClassification)</code> is specified. */ methodClassificationDescription?: string; /** * A reference to the [Term](/schema/Term) describing the [model](/glossary?termType=model) used to estimate these data. */ model?: Term; /** * A free text field, describing the model used to estimate these data. */ modelDescription?: string; /** * The fate of the Product. Use [Transformations](./Transformation) where possible to represent the conversion of one Product into another. */ fate?: ProductFate; /** * The sale price of this Product. The price should be expressed per the units defined in the <code>[term](/schema/Product#term)</code>, for example per "kg liveweight". The <code>[currency](/schema/Product#currency)</code> must be specified. */ price?: number; /** * The standard deviation of <code>[price](/schema/Product#price)</code>. */ priceSd?: number; /** * The minimum of <code>[price](/schema/Product#price)</code>. */ priceMin?: number; /** * The maximum of <code>[price](/schema/Product#price)</code>. */ priceMax?: number; /** * What the descriptive statistics for <code>[price](/schema/Product#price)</code> are calculated across. */ priceStatsDefinition?: ProductPriceStatsDefinition; /** * The total revenue (<code>[price](/schema/Product#price) <code>x</code> [quantity](/schema/Product#value)</code>) of this Product. The <code>[currency](/schema/Product#currency)</code> must be specified. */ revenue?: number; /** * The standard deviation of <code>[revenue](/schema/Product#revenue)</code>. */ revenueSd?: number; /** * The minimum of <code>[revenue](/schema/Product#revenue)</code>. */ revenueMin?: number; /** * The maximum of <code>[revenue](/schema/Product#revenue)</code>. */ revenueMax?: number; /** * What the descriptive statistics for <code>[revenue](/schema/Product#revenue)</code> are calculated across. */ revenueStatsDefinition?: ProductRevenueStatsDefinition; /** * The three letter currency code in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. */ currency?: string; /** * The economic value (typically revenue) of this Product, divided by the total economic value of all Products, expressed as a percentage. */ economicValueShare?: number; /** * Where the are multiple products, whether this product is the primary product. Defaults to true if there is only one product or if <code>[economicValueShare](/schema/Product#economicValueShare) > 50</code>. */ primary?: boolean; /** * A reference to the [Source](/schema/Source) of these data, if different from the <code>[defaultSource](/schema/Cycle#defaultSource)</code> of the [Cycle](/schema/Cycle). */ source?: Source; /** * A list of references to any other [sources](/schema/Source) of these data. */ otherSources?: Source[]; /** * A list of [Properties](/schema/Property) of the Product, which would override any default properties specified in the <code>[term](/schema/Product#term)</code>. For crops, dry matter is a default property of the [Term](/schema/Term) and can be changed by adding [dry matter](/term/dryMatter) here. */ properties?: Property[]; /** * A list of [Transport](/schema/Transport) stages to take this Product to the final location within the [Site](/schema/Site). For example, the Transport required to take harvested crops from the field to the barn where they are stored before being sold. */ transport?: Transport[]; /** * The version of the schema when these data were created. */ schemaVersion?: string; /** * A list of fields that have been added to the original dataset. */ added?: (string)[]; /** * A list of versions of the model used to add these fields. */ addedVersion?: (string)[]; /** * A list of fields that have been updated on the original dataset. */ updated?: (string)[]; /** * A list of versions of the model used to update these fields. */ updatedVersion?: (string)[]; /** * A list of fields that have been 'aggregated' using data from multiple [Cycles](/schema/Cycle). */ aggregated?: (string)[]; /** * A list of versions of the aggregation engine corresponding to each aggregated field. */ aggregatedVersion?: (string)[]; /** * The ratio of the total revenue (adjusted price x <\code>[quantity](/schema/Product#value)</code>) of this Product compared to the Product that is the focus of the aggregation. The adjusted price is the <code>[price](/schema/Product#price) of the Product divided by the <code>[price](/schema/Product#price) of the Product that is the focus of an aggregation. */ revenueRatio?: number; }