gcn_knowledge/
taxonomy.rs1use serde::{Deserialize, Serialize};
2use std::collections::HashMap;
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct Taxonomy {
6 pub taxonomy: String,
7 pub version: String,
8 pub description: String,
9 pub classes: HashMap<String, TaxonomyClass>,
10 #[serde(default)]
11 pub compositional_rules: Option<Vec<CompositionalRule>>,
12}
13
14#[derive(Debug, Clone, Serialize, Deserialize)]
15pub struct TaxonomyClass {
16 #[serde(default)]
17 pub description: Option<String>,
18 #[serde(default)]
19 pub role: Option<String>,
20 #[serde(default)]
22 pub causal_direction: Option<String>,
23 #[serde(default)]
24 pub causal_effect: Option<String>,
25 #[serde(default)]
26 pub dimension: Option<String>,
27 #[serde(default)]
28 pub relation_type: Option<String>,
29 #[serde(default)]
30 pub signals_gap: Option<bool>,
31 #[serde(default)]
32 pub scope: Option<String>,
33 #[serde(default)]
34 pub formal: Option<String>,
35 #[serde(default)]
36 pub position: Option<String>,
37 #[serde(default)]
38 pub examples_fr: Option<Vec<LexicalEntry>>,
39 #[serde(default)]
41 pub examples: Option<Vec<LexicalEntry>>,
42 #[serde(default)]
43 pub subtypes: Option<HashMap<String, SubType>>,
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
47pub struct LexicalEntry {
48 pub lemma: String,
49 #[serde(default)]
50 pub note: Option<String>,
51 #[serde(default)]
52 pub value: Option<f32>,
53 #[serde(default)]
54 pub kind: Option<String>,
55 #[serde(default)]
56 pub anchor: Option<String>,
57 #[serde(default)]
58 pub scope: Option<String>,
59 #[serde(default)]
60 pub total: Option<bool>,
61}
62
63#[derive(Debug, Clone, Serialize, Deserialize)]
64pub struct SubType {
65 pub description: String,
66 #[serde(default)]
67 pub examples_fr: Option<Vec<String>>,
68}
69
70#[derive(Debug, Clone, Serialize, Deserialize)]
71pub struct CompositionalRule {
72 pub pattern: String,
73 pub result: String,
74 pub description: String,
75}