|
84 | 84 |
|
85 | 85 | # Extend the class with additional attributes: |
86 | 86 | # * subsets |
87 | | - # * broad_synonyms |
88 | | - # * exact_synonyms |
89 | | - # * narrow_synonyms |
90 | | - # * related_synonyms |
| 87 | + # * broad_synonym |
| 88 | + # * exact_synonym |
| 89 | + # * narrow_synonym |
| 90 | + # * related_synonym |
91 | 91 | class NodeClass(base_class): |
92 | 92 | """Node class with additional attributes for subsets and synonyms.""" |
93 | 93 |
|
94 | 94 | subsets: Optional[List[str]] = Field( |
95 | 95 | default=None, description="""Subsets the node belongs to, defined by its source""") |
96 | | - broad_synonyms: Optional[List[str]] = Field( |
| 96 | + broad_synonym: Optional[List[str]] = Field( |
97 | 97 | default=None, |
98 | 98 | description="""Broad synonyms for the node, defined by its source""", |
99 | 99 | ) |
100 | | - exact_synonyms: Optional[List[str]] = Field( |
| 100 | + exact_synonym: Optional[List[str]] = Field( |
101 | 101 | default=None, |
102 | 102 | description="""Exact synonyms for the node, defined by its source""", |
103 | 103 | ) |
104 | | - narrow_synonyms: Optional[List[str]] = Field( |
| 104 | + narrow_synonym: Optional[List[str]] = Field( |
105 | 105 | default=None, |
106 | 106 | description="""Narrow synonyms for the node, defined by its source""", |
107 | 107 | ) |
108 | | - related_synonyms: Optional[List[str]] = Field( |
| 108 | + related_synonym: Optional[List[str]] = Field( |
109 | 109 | default=None, |
110 | 110 | description="""Related synonyms for the node, defined by its source""", |
111 | 111 | ) |
@@ -140,15 +140,15 @@ class NodeClass(base_class): |
140 | 140 | node.xref = xrefs |
141 | 141 |
|
142 | 142 | for synonym_type in ["broad", "exact", "narrow", "related"]: |
143 | | - if row[f"{synonym_type}_synonyms"]: |
144 | | - these_synonyms = (row[f"{synonym_type}_synonyms"]).split("|") |
| 143 | + if row[f"{synonym_type}_synonym"]: |
| 144 | + these_synonyms = (row[f"{synonym_type}_synonym"]).split("|") |
145 | 145 | if synonym_type == "broad": |
146 | | - node.broad_synonyms = these_synonyms |
| 146 | + node.broad_synonym = these_synonyms |
147 | 147 | elif synonym_type == "exact": |
148 | | - node.exact_synonyms = these_synonyms |
| 148 | + node.exact_synonym = these_synonyms |
149 | 149 | elif synonym_type == "narrow": |
150 | | - node.narrow_synonyms = these_synonyms |
| 150 | + node.narrow_synonym = these_synonyms |
151 | 151 | elif synonym_type == "related": |
152 | | - node.related_synonyms = these_synonyms |
| 152 | + node.related_synonym = these_synonyms |
153 | 153 |
|
154 | 154 | koza_app.write(node) |
0 commit comments