@hestia-earth/glossary 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,45 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [0.7.0](https://gitlab.com/hestia-earth/hestia-glossary/compare/v0.6.1...v0.7.0) (2022-08-15)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * **property:** new term `name` and `@id` for all `Digestible energy content` terms
11
+
12
+ ### Features
13
+
14
+ * **animalManagement:** add `animal growth rate` ([8562a91](https://gitlab.com/hestia-earth/hestia-glossary/commit/8562a9126fe7147c507bc2e3f398d9d0d37ee3e7))
15
+ * **animalManagement:** add `culling rate` terms ([320fbca](https://gitlab.com/hestia-earth/hestia-glossary/commit/320fbcab013ca678e8fafd8925dbd9785680ac7d))
16
+ * **animalManagement:** add new pig management terms ([2e55c90](https://gitlab.com/hestia-earth/hestia-glossary/commit/2e55c90bd519dc8a74c3f311a2d85296dcf1cd12))
17
+ * **animalManagement:** rename `animal growth rate` to `growth rate`, better define `units` ([0920f7e](https://gitlab.com/hestia-earth/hestia-glossary/commit/0920f7e54fee3fdf061e3fd0242f5aab9c67d2d7))
18
+ * **animalManagement:** rename `mortality` terms and extend to more animal types ([fae8299](https://gitlab.com/hestia-earth/hestia-glossary/commit/fae8299d197109e6edf8aaea9b9e0c3d835ea4eb))
19
+ * **animalManagement:** rename boolean terms and add `units` ([35f6c14](https://gitlab.com/hestia-earth/hestia-glossary/commit/35f6c1476a61c5eb1b42926880de1def43c1bb34))
20
+ * **animalManagement:** update pig mortality terms to match recent changes ([b7c20c8](https://gitlab.com/hestia-earth/hestia-glossary/commit/b7c20c8724e0c8d4aa2823bbd54c2e6dfdc20ab9))
21
+ * **crop:** gap-fill property values ([203ee6f](https://gitlab.com/hestia-earth/hestia-glossary/commit/203ee6f19c489f93246e28bdb3235b5603587916))
22
+ * **crop:** update property lookups ([d31997f](https://gitlab.com/hestia-earth/hestia-glossary/commit/d31997f951c8c371444f0b76189c5ed3a328372c))
23
+ * **grass:** add `signal grass` terms ([9e83467](https://gitlab.com/hestia-earth/hestia-glossary/commit/9e834675c82e218352dd8153c842ba5ed8114ba9))
24
+ * **grass:** gap-fill property values ([ac24be6](https://gitlab.com/hestia-earth/hestia-glossary/commit/ac24be6350f25e195fea2b416408121cd8ca4fda))
25
+ * **grass:** update property lookups ([fcc788f](https://gitlab.com/hestia-earth/hestia-glossary/commit/fcc788faa8fcf554b62ab846aba196dbf771102f))
26
+ * **landUseManagement:** add `continuous grazing` and `rotational grazing` ([29bfe17](https://gitlab.com/hestia-earth/hestia-glossary/commit/29bfe1798baa246593ef0c1569eb5e2e03fe348a)), closes [#186](https://gitlab.com/hestia-earth/hestia-glossary/issues/186)
27
+ * **landUseManagement:** add `pasture grasses` ([fc0d7e4](https://gitlab.com/hestia-earth/hestia-glossary/commit/fc0d7e4aa2a33badcd101c9e1cb169cab3a50f7b)), closes [#474](https://gitlab.com/hestia-earth/hestia-glossary/issues/474)
28
+ * **landUseManagement:** add grassland management related terms from IPCC (2006) ([200060c](https://gitlab.com/hestia-earth/hestia-glossary/commit/200060c12f9af243d301e67ec41ae9b762b8666a)), closes [#186](https://gitlab.com/hestia-earth/hestia-glossary/issues/186)
29
+ * **liveAnimal:** add `animalProductId` lookup ([bcca008](https://gitlab.com/hestia-earth/hestia-glossary/commit/bcca008742868da7b6eaaf10155a0efa69ac45fe)), closes [#229](https://gitlab.com/hestia-earth/hestia-glossary/issues/229)
30
+ * **liveAnimal:** rework terms for describing pigs ([bcdf90e](https://gitlab.com/hestia-earth/hestia-glossary/commit/bcdf90ef465396b56a69b322cdb0f5720f0a4d7b))
31
+ * **material:** add `density` to concrete terms ([ae5b025](https://gitlab.com/hestia-earth/hestia-glossary/commit/ae5b02512b61a4d987cb03693165922516211440)), closes [#482](https://gitlab.com/hestia-earth/hestia-glossary/issues/482)
32
+ * **property:** rename `Digestible energy content` to `Digestible energy` for clarity ([55366ad](https://gitlab.com/hestia-earth/hestia-glossary/commit/55366ad709491c541ca520f2b0f4a349a38d3f77))
33
+ * **scripts:** add method `getDefaultModels` to retrieve list of default models ([86fd8ad](https://gitlab.com/hestia-earth/hestia-glossary/commit/86fd8ad5b7714487a6a1609ab7f9af10eb682c90))
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * **animalManagement:** fix typos in `description` and `units` ([842ad70](https://gitlab.com/hestia-earth/hestia-glossary/commit/842ad707d17d605dba6541e92bb0da04c0e7a4e4))
39
+ * **animalManagement:** use `/` rather than `-1` for `units` ([d6e79c2](https://gitlab.com/hestia-earth/hestia-glossary/commit/d6e79c2f7f45f4f987eb890d93fc6aa141f939d8))
40
+ * **liveAnimal:** corrects errors in cattle definitions ([9b3e475](https://gitlab.com/hestia-earth/hestia-glossary/commit/9b3e475b0933a161d6c9576df13ff9d97c0a747c))
41
+ * **property:** error in `feedipediaName` lookup for `digestible energy` terms ([81c8477](https://gitlab.com/hestia-earth/hestia-glossary/commit/81c8477721ac2c58ac27eeba2b9e46672b4ceea7))
42
+ * **property:** errors in feedipedia links for digestible energy ([6316922](https://gitlab.com/hestia-earth/hestia-glossary/commit/631692202d2f2dfe25a23f62aecb58378c718b32))
43
+
5
44
  ### [0.6.1](https://gitlab.com/hestia-earth/hestia-glossary/compare/v0.6.0...v0.6.1) (2022-08-10)
6
45
 
7
46
 
package/index.js CHANGED
@@ -39,7 +39,7 @@ const idToIso31662 = (id = '') => loadResourceKey('id-to-iso3166-2.json', id.toU
39
39
  * @param {string} id The Hestia term [id](https://hestia.earth/schema/Term#id).
40
40
  * @returns {string} Possible values are: `mean`, `mode` and `sum`.
41
41
  */
42
- const getArrayTreatment = (id) => loadResource('arrayTreatment.json')[id] || 'sum';
42
+ const getArrayTreatment = (id) => loadResourceKey('arrayTreatment.json', id) || 'sum';
43
43
 
44
44
  /**
45
45
  * Returns the `@id` of the default model that should be used for display of this Term.
@@ -47,7 +47,15 @@ const getArrayTreatment = (id) => loadResource('arrayTreatment.json')[id] || 'su
47
47
  * @param {string} id The Hestia term [id](https://hestia.earth/schema/Term#id).
48
48
  * @returns {string} The `@id` of the model if set.
49
49
  */
50
- const getDefaultModelId = (id) => loadResource('defaultModelId.json')[id];
50
+ const getDefaultModelId = (id) => loadResourceKey('defaultModelId.json', id);
51
+
52
+ /**
53
+ * Returns the list of `@id` of the default models that should be used for display.
54
+ *
55
+ * @param {string} id The Hestia term [id](https://hestia.earth/schema/Term#id).
56
+ * @returns {string[]} The list of default `@id`.
57
+ */
58
+ const getDefaultModels = () => Object.entries(loadResource('defaultModelId.json')).filter(([key, value]) => !!value).map(([key]) => key);
51
59
 
52
60
  /**
53
61
  * Returns the list of restrictions of the Term.
@@ -55,7 +63,7 @@ const getDefaultModelId = (id) => loadResource('defaultModelId.json')[id];
55
63
  * @param {string} id The Hestia term [id](https://hestia.earth/schema/Term#id).
56
64
  * @returns A list of restrictions as an object.
57
65
  */
58
- const getTermRestrictions = (id) => loadResource('term-restrictions.json')[id];
66
+ const getTermRestrictions = (id) => loadResourceKey('term-restrictions.json', id);
59
67
 
60
68
  /**
61
69
  * Returns the list of restrictions of the Term/Model mapping.
@@ -64,7 +72,7 @@ const getTermRestrictions = (id) => loadResource('term-restrictions.json')[id];
64
72
  * @param {string} modelId The Hestia term [id](https://hestia.earth/schema/Term#id).
65
73
  * @returns A list of restrictions as an object.
66
74
  */
67
- const getTermModelRestrictions = (id, modelId) => (loadResource('term-restrictions.json')[id] || {})[modelId];
75
+ const getTermModelRestrictions = (id, modelId) => (loadResourceKey('term-restrictions.json', id) || {})[modelId];
68
76
 
69
77
  module.exports = {
70
78
  loadResourceKey,
@@ -72,8 +80,8 @@ module.exports = {
72
80
  iso31662ToId,
73
81
  idToIso31662,
74
82
  getArrayTreatment,
75
- getDefaultModeId: getDefaultModelId, // backwards compatibility
76
83
  getDefaultModelId,
84
+ getDefaultModels,
77
85
  getTermRestrictions,
78
86
  getTermModelRestrictions
79
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/glossary",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Hestia Earth Glossary library",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,54 +1,82 @@
1
1
  {
2
- "adultMortality": {
2
+ "ageAtFirstCalving": {
3
3
  "siteTypesAllowed": [
4
4
  "cropland",
5
5
  "permanent pasture",
6
6
  "animal housing"
7
7
  ]
8
8
  },
9
- "ageAtFirstCalving": {
9
+ "artificialInseminationUsed": {
10
10
  "siteTypesAllowed": [
11
11
  "cropland",
12
12
  "permanent pasture",
13
13
  "animal housing"
14
14
  ]
15
15
  },
16
- "artificialInsemination": {
16
+ "calvesPerLife": {
17
17
  "siteTypesAllowed": [
18
18
  "cropland",
19
19
  "permanent pasture",
20
20
  "animal housing"
21
21
  ]
22
22
  },
23
- "batchesPerYear": {
23
+ "calvingInterval": {
24
24
  "siteTypesAllowed": [
25
25
  "cropland",
26
26
  "permanent pasture",
27
27
  "animal housing"
28
28
  ]
29
29
  },
30
- "calvesPerLife": {
30
+ "conceptionRate": {
31
31
  "siteTypesAllowed": [
32
32
  "cropland",
33
33
  "permanent pasture",
34
34
  "animal housing"
35
35
  ]
36
36
  },
37
- "calvingInterval": {
37
+ "crossBreedingUsed": {
38
38
  "siteTypesAllowed": [
39
39
  "cropland",
40
40
  "permanent pasture",
41
41
  "animal housing"
42
42
  ]
43
43
  },
44
- "conceptionRate": {
44
+ "cullingRate": {
45
45
  "siteTypesAllowed": [
46
46
  "cropland",
47
47
  "permanent pasture",
48
48
  "animal housing"
49
49
  ]
50
50
  },
51
- "crossBreeding": {
51
+ "cullingRateFemale": {
52
+ "siteTypesAllowed": [
53
+ "cropland",
54
+ "permanent pasture",
55
+ "animal housing"
56
+ ]
57
+ },
58
+ "cullingRateMale": {
59
+ "siteTypesAllowed": [
60
+ "cropland",
61
+ "permanent pasture",
62
+ "animal housing"
63
+ ]
64
+ },
65
+ "cullingRateSow": {
66
+ "siteTypesAllowed": [
67
+ "cropland",
68
+ "permanent pasture",
69
+ "animal housing"
70
+ ]
71
+ },
72
+ "farrowingIndex": {
73
+ "siteTypesAllowed": [
74
+ "cropland",
75
+ "permanent pasture",
76
+ "animal housing"
77
+ ]
78
+ },
79
+ "farrowingRate": {
52
80
  "siteTypesAllowed": [
53
81
  "cropland",
54
82
  "permanent pasture",
@@ -90,6 +118,28 @@
90
118
  "animal housing"
91
119
  ]
92
120
  },
121
+ "growthRateCarcassWeight": {
122
+ "siteTypesAllowed": [
123
+ "cropland",
124
+ "permanent pasture",
125
+ "animal housing",
126
+ "pond",
127
+ "river or stream",
128
+ "lake",
129
+ "sea or ocean"
130
+ ]
131
+ },
132
+ "growthRateLiveweight": {
133
+ "siteTypesAllowed": [
134
+ "cropland",
135
+ "permanent pasture",
136
+ "animal housing",
137
+ "pond",
138
+ "river or stream",
139
+ "lake",
140
+ "sea or ocean"
141
+ ]
142
+ },
93
143
  "herdComposition": {
94
144
  "siteTypesAllowed": [
95
145
  "cropland",
@@ -104,7 +154,7 @@
104
154
  "animal housing"
105
155
  ]
106
156
  },
107
- "juvenileMortality": {
157
+ "liveAnimalsPerBirth": {
108
158
  "siteTypesAllowed": [
109
159
  "cropland",
110
160
  "permanent pasture",
@@ -118,7 +168,7 @@
118
168
  "animal housing"
119
169
  ]
120
170
  },
121
- "markerAssistedSelection": {
171
+ "markerAssistedSelectionUsed": {
122
172
  "siteTypesAllowed": [
123
173
  "cropland",
124
174
  "permanent pasture",
@@ -146,6 +196,90 @@
146
196
  "animal housing"
147
197
  ]
148
198
  },
199
+ "mortalityAdult": {
200
+ "siteTypesAllowed": [
201
+ "cropland",
202
+ "permanent pasture",
203
+ "animal housing"
204
+ ]
205
+ },
206
+ "mortalityBarrow": {
207
+ "siteTypesAllowed": [
208
+ "cropland",
209
+ "permanent pasture",
210
+ "animal housing"
211
+ ]
212
+ },
213
+ "mortalityBoar": {
214
+ "siteTypesAllowed": [
215
+ "cropland",
216
+ "permanent pasture",
217
+ "animal housing"
218
+ ]
219
+ },
220
+ "mortalityBull": {
221
+ "siteTypesAllowed": [
222
+ "cropland",
223
+ "permanent pasture",
224
+ "animal housing"
225
+ ]
226
+ },
227
+ "mortalityFemale": {
228
+ "siteTypesAllowed": [
229
+ "cropland",
230
+ "permanent pasture",
231
+ "animal housing"
232
+ ]
233
+ },
234
+ "mortalityGilt": {
235
+ "siteTypesAllowed": [
236
+ "cropland",
237
+ "permanent pasture",
238
+ "animal housing"
239
+ ]
240
+ },
241
+ "mortalityJuvenile": {
242
+ "siteTypesAllowed": [
243
+ "cropland",
244
+ "permanent pasture",
245
+ "animal housing"
246
+ ]
247
+ },
248
+ "mortalityLactatingCow": {
249
+ "siteTypesAllowed": [
250
+ "cropland",
251
+ "permanent pasture",
252
+ "animal housing"
253
+ ]
254
+ },
255
+ "mortalityMale": {
256
+ "siteTypesAllowed": [
257
+ "cropland",
258
+ "permanent pasture",
259
+ "animal housing"
260
+ ]
261
+ },
262
+ "mortalityNonLactatingCow": {
263
+ "siteTypesAllowed": [
264
+ "cropland",
265
+ "permanent pasture",
266
+ "animal housing"
267
+ ]
268
+ },
269
+ "mortalitySow": {
270
+ "siteTypesAllowed": [
271
+ "cropland",
272
+ "permanent pasture",
273
+ "animal housing"
274
+ ]
275
+ },
276
+ "mortalitySteer": {
277
+ "siteTypesAllowed": [
278
+ "cropland",
279
+ "permanent pasture",
280
+ "animal housing"
281
+ ]
282
+ },
149
283
  "nonLactatingCowsPerLactatingCow": {
150
284
  "siteTypesAllowed": [
151
285
  "cropland",
@@ -174,6 +308,13 @@
174
308
  "animal housing"
175
309
  ]
176
310
  },
311
+ "weanedAnimalsPerMotherPerYear": {
312
+ "siteTypesAllowed": [
313
+ "cropland",
314
+ "permanent pasture",
315
+ "animal housing"
316
+ ]
317
+ },
177
318
  "weaningTime": {
178
319
  "siteTypesAllowed": [
179
320
  "cropland",
@@ -3944,6 +4085,46 @@
3944
4085
  "permanent pasture"
3945
4086
  ]
3946
4087
  },
4088
+ "pastureGrasses": {
4089
+ "siteTypesAllowed": [
4090
+ "permanent pasture"
4091
+ ]
4092
+ },
4093
+ "continuousGrazing": {
4094
+ "siteTypesAllowed": [
4095
+ "permanent pasture"
4096
+ ]
4097
+ },
4098
+ "rotationalGrazing": {
4099
+ "siteTypesAllowed": [
4100
+ "permanent pasture"
4101
+ ]
4102
+ },
4103
+ "nativePasture": {
4104
+ "siteTypesAllowed": [
4105
+ "permanent pasture"
4106
+ ]
4107
+ },
4108
+ "improvedPasture": {
4109
+ "siteTypesAllowed": [
4110
+ "permanent pasture"
4111
+ ]
4112
+ },
4113
+ "nominallyManagedPasture": {
4114
+ "siteTypesAllowed": [
4115
+ "permanent pasture"
4116
+ ]
4117
+ },
4118
+ "highIntensityGrazingPasture": {
4119
+ "siteTypesAllowed": [
4120
+ "permanent pasture"
4121
+ ]
4122
+ },
4123
+ "severelyDegradedPasture": {
4124
+ "siteTypesAllowed": [
4125
+ "permanent pasture"
4126
+ ]
4127
+ },
3947
4128
  "altitude": {
3948
4129
  "siteTypesAllowed": [
3949
4130
  "forest",
@@ -8942,37 +9123,37 @@
8942
9123
  "all"
8943
9124
  ]
8944
9125
  },
8945
- "digestibleEnergyContentAquaticSpecies": {
9126
+ "digestibleEnergyAquaticSpecies": {
8946
9127
  "siteTypesAllowed": [
8947
9128
  "all"
8948
9129
  ]
8949
9130
  },
8950
- "digestibleEnergyContentOtherAnimals": {
9131
+ "digestibleEnergyOtherAnimals": {
8951
9132
  "siteTypesAllowed": [
8952
9133
  "all"
8953
9134
  ]
8954
9135
  },
8955
- "digestibleEnergyContentPigs": {
9136
+ "digestibleEnergyPigs": {
8956
9137
  "siteTypesAllowed": [
8957
9138
  "all"
8958
9139
  ]
8959
9140
  },
8960
- "digestibleEnergyContentPoultry": {
9141
+ "digestibleEnergyPoultry": {
8961
9142
  "siteTypesAllowed": [
8962
9143
  "all"
8963
9144
  ]
8964
9145
  },
8965
- "digestibleEnergyContentRabbits": {
9146
+ "digestibleEnergyRabbits": {
8966
9147
  "siteTypesAllowed": [
8967
9148
  "all"
8968
9149
  ]
8969
9150
  },
8970
- "digestibleEnergyContentRuminants": {
9151
+ "digestibleEnergyRuminants": {
8971
9152
  "siteTypesAllowed": [
8972
9153
  "all"
8973
9154
  ]
8974
9155
  },
8975
- "digestibleEnergyContentSalmonids": {
9156
+ "digestibleEnergySalmonids": {
8976
9157
  "siteTypesAllowed": [
8977
9158
  "all"
8978
9159
  ]