@bradtech/ontologies 1.1.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.
Files changed (69) hide show
  1. package/LICENSE +620 -0
  2. package/README.md +66 -0
  3. package/data/crop-covers/bare-soil.md +23 -0
  4. package/data/crop-covers/index.md +21 -0
  5. package/data/crop-covers/permanent-sod.md +23 -0
  6. package/data/crop-covers/sown-legume.md +23 -0
  7. package/data/crop-covers/spontaneous-grass.md +23 -0
  8. package/data/crops/index.md +23 -0
  9. package/data/crops/lavandula-angustifolia.md +30 -0
  10. package/data/crops/malus-domestica.md +30 -0
  11. package/data/crops/prunus-persica.md +30 -0
  12. package/data/crops/triticum-aestivum.md +30 -0
  13. package/data/crops/vitis-vinifera.md +30 -0
  14. package/data/crops/zea-mays.md +30 -0
  15. package/data/index.md +22 -0
  16. package/data/irrigations/drip.md +24 -0
  17. package/data/irrigations/gravity.md +24 -0
  18. package/data/irrigations/index.md +21 -0
  19. package/data/irrigations/none.md +24 -0
  20. package/data/irrigations/sprinkler.md +24 -0
  21. package/data/soils/clay-loam.md +29 -0
  22. package/data/soils/clay.md +29 -0
  23. package/data/soils/index.md +26 -0
  24. package/data/soils/loam.md +29 -0
  25. package/data/soils/sand.md +29 -0
  26. package/data/soils/sandy-clay-loam.md +29 -0
  27. package/data/soils/sandy-clay.md +29 -0
  28. package/data/soils/sandy-loam.md +29 -0
  29. package/data/soils/silt-loam.md +29 -0
  30. package/data/soils/silt.md +29 -0
  31. package/data/soils/silty-clay-loam.md +29 -0
  32. package/dist/build.d.ts +5 -0
  33. package/dist/build.d.ts.map +1 -0
  34. package/dist/build.js +61 -0
  35. package/dist/build.js.map +1 -0
  36. package/dist/catalog.json +1623 -0
  37. package/dist/embeddedData.d.ts +6 -0
  38. package/dist/embeddedData.d.ts.map +1 -0
  39. package/dist/embeddedData.js +906 -0
  40. package/dist/embeddedData.js.map +1 -0
  41. package/dist/extractor.d.ts +31 -0
  42. package/dist/extractor.d.ts.map +1 -0
  43. package/dist/extractor.js +161 -0
  44. package/dist/extractor.js.map +1 -0
  45. package/dist/index.d.ts +24 -0
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +44 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/loader.d.ts +25 -0
  50. package/dist/loader.d.ts.map +1 -0
  51. package/dist/loader.js +104 -0
  52. package/dist/loader.js.map +1 -0
  53. package/dist/opendata.jsonld +268 -0
  54. package/dist/parser.d.ts +14 -0
  55. package/dist/parser.d.ts.map +1 -0
  56. package/dist/parser.js +124 -0
  57. package/dist/parser.js.map +1 -0
  58. package/dist/types.d.ts +89 -0
  59. package/dist/types.d.ts.map +1 -0
  60. package/dist/types.js +5 -0
  61. package/dist/types.js.map +1 -0
  62. package/package.json +42 -0
  63. package/src/build.ts +71 -0
  64. package/src/embeddedData.ts +910 -0
  65. package/src/extractor.ts +207 -0
  66. package/src/index.ts +98 -0
  67. package/src/loader.ts +126 -0
  68. package/src/parser.ts +137 -0
  69. package/src/types.ts +110 -0
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: soil
3
+ id: sand
4
+ title: Sol Sableux
5
+ description: Sol très filtrant composé de plus de 85% de particules de sable, très faible réserve utile, réchauffement quasi immédiat.
6
+ tags: [soil, texture, inrae, usda, draining]
7
+ translations:
8
+ fr: Sol Sableux
9
+ en: Sandy Soil
10
+ es: Suelo Arenoso
11
+ it: Suolo Sabbioso
12
+ de: Sandboden
13
+ standards:
14
+ inrae: S
15
+ usda: Sand
16
+ wrb: Arenosol
17
+ physics:
18
+ fieldCapacityPoint: 12.0
19
+ temporaryWiltingPoint: 6.0
20
+ permanentWiltingPoint: 4.0
21
+ bulkDensityKgM3: 1550
22
+ clayPercentageApprox: 5
23
+ sandPercentageApprox: 90
24
+ siltPercentageApprox: 5
25
+ ---
26
+
27
+ # Sol Sableux (Sand)
28
+
29
+ Sol très drainant nécessitant des apports d'eau fréquents et fractionnés (goutte à goutte).
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: soil
3
+ id: sandy-clay-loam
4
+ title: Sol Sablo-Argilo-Limoneux
5
+ description: Sol contenant 20-35% d'argile, 45-80% de sable et moins de 28% de limon, sol d'arboriculture et de vigne très répandu.
6
+ tags: [soil, texture, inrae, usda]
7
+ translations:
8
+ fr: Sol Sablo-Argilo-Limoneux
9
+ en: Sandy Clay Loam
10
+ es: Suelo Franco Arcillo Arenoso
11
+ it: Suolo Franco Argilloso Sabbioso
12
+ de: Sandig-toniger Lehmboden
13
+ standards:
14
+ inrae: SAL
15
+ usda: Sandy Clay Loam
16
+ wrb: Calcisol
17
+ physics:
18
+ fieldCapacityPoint: 29.0
19
+ temporaryWiltingPoint: 15.0
20
+ permanentWiltingPoint: 12.0
21
+ bulkDensityKgM3: 1420
22
+ clayPercentageApprox: 27
23
+ sandPercentageApprox: 53
24
+ siltPercentageApprox: 20
25
+ ---
26
+
27
+ # Sol Sablo-Argilo-Limoneux (Sandy Clay Loam)
28
+
29
+ Sol chaud de printemps, drainant et bien pourvu en réserves.
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: soil
3
+ id: sandy-clay
4
+ title: Sol Sablo-Argileux
5
+ description: Sol contenant 35-55% d'argile et 45-65% de sable, combinant plasticité et drainage granulaire.
6
+ tags: [soil, texture, inrae, usda]
7
+ translations:
8
+ fr: Sol Sablo-Argileux
9
+ en: Sandy Clay
10
+ es: Suelo Arcillo Arenoso
11
+ it: Suolo Argilloso Sabbioso
12
+ de: Sandiger Tonboden
13
+ standards:
14
+ inrae: SA
15
+ usda: Sandy Clay
16
+ wrb: Acrisol
17
+ physics:
18
+ fieldCapacityPoint: 32.0
19
+ temporaryWiltingPoint: 18.0
20
+ permanentWiltingPoint: 14.0
21
+ bulkDensityKgM3: 1400
22
+ clayPercentageApprox: 40
23
+ sandPercentageApprox: 50
24
+ siltPercentageApprox: 10
25
+ ---
26
+
27
+ # Sol Sablo-Argileux (Sandy Clay)
28
+
29
+ Texture combinant argile active et squelette sableux aéré.
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: soil
3
+ id: sandy-loam
4
+ title: Sol Sablo-Limoneux
5
+ description: Sol contenant plus de 50% de sable et moins de 20% d'argile, réchauffement très rapide, réserve utile modérée.
6
+ tags: [soil, texture, inrae, usda, warm]
7
+ translations:
8
+ fr: Sol Sablo-Limoneux
9
+ en: Sandy Loam
10
+ es: Suelo Franco Arenoso
11
+ it: Suolo Franco Sabbioso
12
+ de: Sandiger Lehmboden
13
+ standards:
14
+ inrae: SL
15
+ usda: Sandy Loam
16
+ wrb: Arenosol
17
+ physics:
18
+ fieldCapacityPoint: 22.0
19
+ temporaryWiltingPoint: 11.0
20
+ permanentWiltingPoint: 8.0
21
+ bulkDensityKgM3: 1450
22
+ clayPercentageApprox: 12
23
+ sandPercentageApprox: 68
24
+ siltPercentageApprox: 20
25
+ ---
26
+
27
+ # Sol Sablo-Limoneux (Sandy Loam)
28
+
29
+ Sol aéré favorisant l'enracinement rapide des cultures maraîchères et pérennes.
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: soil
3
+ id: silt-loam
4
+ title: Sol Limono-Sableux / Limon Fin
5
+ description: Sol composé de plus de 50% de limons, doux au toucher, très filtrant et sensible à l'érosion éolienne et hydrique.
6
+ tags: [soil, texture, inrae, usda, light]
7
+ translations:
8
+ fr: Sol Limono-Sableux / Limon Fin
9
+ en: Silt Loam
10
+ es: Suelo Franco Limoso
11
+ it: Suolo Franco Limoso
12
+ de: Schluffiger Lehmboden
13
+ standards:
14
+ inrae: LS
15
+ usda: Silt Loam
16
+ wrb: Luvisol
17
+ physics:
18
+ fieldCapacityPoint: 28.0
19
+ temporaryWiltingPoint: 13.0
20
+ permanentWiltingPoint: 10.0
21
+ bulkDensityKgM3: 1380
22
+ clayPercentageApprox: 12
23
+ sandPercentageApprox: 28
24
+ siltPercentageApprox: 60
25
+ ---
26
+
27
+ # Sol Limono-Sableux (Silt Loam)
28
+
29
+ Sol léger et facile à travailler.
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: soil
3
+ id: silt
4
+ title: Sol Limoneux Pur
5
+ description: Sol composé de plus de 80% de limon et moins de 12% d'argile, très soyeux, très sensible à la battance et au compactage superficiel.
6
+ tags: [soil, texture, inrae, usda]
7
+ translations:
8
+ fr: Sol Limoneux Pur
9
+ en: Silt Soil
10
+ es: Suelo Limoso
11
+ it: Suolo Limoso
12
+ de: Schluffboden
13
+ standards:
14
+ inrae: LL
15
+ usda: Silt
16
+ wrb: Fluvisol
17
+ physics:
18
+ fieldCapacityPoint: 31.0
19
+ temporaryWiltingPoint: 15.0
20
+ permanentWiltingPoint: 11.0
21
+ bulkDensityKgM3: 1360
22
+ clayPercentageApprox: 8
23
+ sandPercentageApprox: 7
24
+ siltPercentageApprox: 85
25
+ ---
26
+
27
+ # Sol Limoneux Pur (Silt)
28
+
29
+ Sol riche mais exigeant une vigilance sur la structure et le travail du sol.
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: soil
3
+ id: silty-clay-loam
4
+ title: Sol Limono-Argileux
5
+ description: Sol composé de 27-40% d'argile et > 40% de limons, très riche chimiquement, sensible à la battance.
6
+ tags: [soil, texture, inrae, usda]
7
+ translations:
8
+ fr: Sol Limono-Argileux
9
+ en: Silty Clay Loam
10
+ es: Suelo Franco Arcillo Limoso
11
+ it: Suolo Franco Argilloso Limoso
12
+ de: Schluffig-toniger Lehmboden
13
+ standards:
14
+ inrae: LA
15
+ usda: Silty Clay Loam
16
+ wrb: Cambisol
17
+ physics:
18
+ fieldCapacityPoint: 36.0
19
+ temporaryWiltingPoint: 21.0
20
+ permanentWiltingPoint: 17.0
21
+ bulkDensityKgM3: 1320
22
+ clayPercentageApprox: 34
23
+ sandPercentageApprox: 15
24
+ siltPercentageApprox: 51
25
+ ---
26
+
27
+ # Sol Limono-Argileux (Silty Clay Loam)
28
+
29
+ Sol profond à forte capacité hydrique, typique des plaines alluviales fertiles.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Static JSON Catalog & Embedded TypeScript Data Compiler for @bradtech/ontologies.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/dist/build.js ADDED
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Static JSON Catalog & Embedded TypeScript Data Compiler for @bradtech/ontologies.
3
+ */
4
+ import { mkdirSync, writeFileSync } from 'node:fs';
5
+ import { resolve } from 'node:path';
6
+ import { loadOntologyCatalog, scanMarkdownFiles } from './loader';
7
+ import { parseOkfDocument } from './parser';
8
+ import { readFileSync } from 'node:fs';
9
+ import { toOpenDataJsonLd } from './extractor';
10
+ function build() {
11
+ const dataDir = resolve(__dirname, '../data');
12
+ const distDir = resolve(__dirname, '../dist');
13
+ const srcDir = resolve(__dirname, '../src');
14
+ console.log('Compiling OKF Agricultural Ontologies...');
15
+ const files = scanMarkdownFiles(dataDir);
16
+ const allItems = [];
17
+ for (const file of files) {
18
+ const content = readFileSync(file, 'utf-8');
19
+ try {
20
+ const doc = parseOkfDocument(content);
21
+ allItems.push(doc);
22
+ }
23
+ catch (err) {
24
+ // Skip non-concept files
25
+ }
26
+ }
27
+ const catalog = loadOntologyCatalog(dataDir);
28
+ mkdirSync(distDir, { recursive: true });
29
+ // 1. Write src/embeddedData.ts
30
+ const embeddedTsContent = `/**
31
+ * Auto-generated by build.ts. Do not edit manually.
32
+ */
33
+ import type { AnyOntologyItem } from './types'
34
+
35
+ export const EMBEDDED_ONTOLOGY_ITEMS: AnyOntologyItem[] = ${JSON.stringify(allItems, null, 2)}
36
+ `;
37
+ const embeddedPath = resolve(srcDir, 'embeddedData.ts');
38
+ writeFileSync(embeddedPath, embeddedTsContent, 'utf-8');
39
+ console.log(` -> Generated static embedded data at ${embeddedPath}`);
40
+ // 2. Write dist/catalog.json
41
+ const compiledCatalog = {
42
+ version: '0.1.0',
43
+ timestamp: new Date().toISOString(),
44
+ itemCount: catalog.items.length,
45
+ items: catalog.items,
46
+ soils: catalog.byDomain.get('soils') || [],
47
+ irrigations: catalog.byDomain.get('irrigations') || [],
48
+ crops: catalog.byDomain.get('crops') || [],
49
+ cropCovers: catalog.byDomain.get('crop-covers') || [],
50
+ };
51
+ const catalogJsonPath = resolve(distDir, 'catalog.json');
52
+ writeFileSync(catalogJsonPath, JSON.stringify(compiledCatalog, null, 2), 'utf-8');
53
+ console.log(` -> Written compiled catalog (${catalog.items.length} concepts) to ${catalogJsonPath}`);
54
+ // 3. Write dist/opendata.jsonld
55
+ const openDataPath = resolve(distDir, 'opendata.jsonld');
56
+ const openData = toOpenDataJsonLd(catalog);
57
+ writeFileSync(openDataPath, JSON.stringify(openData, null, 2), 'utf-8');
58
+ console.log(` -> Written Open Data JSON-LD to ${openDataPath}`);
59
+ }
60
+ build();
61
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,SAAS,KAAK;IACX,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAE3C,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,C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