|
15 | 15 |
|
16 | 16 |
|
17 | 17 | terms_as_enums = True
|
| 18 | +licenses_as_enums = True |
| 19 | +content_types_as_enums = True |
| 20 | +graph_structures_as_enums = True |
18 | 21 |
|
19 | 22 | print("********************************************************")
|
20 | 23 | print(f"Triggering the generation of LinkML models for openMINDS")
|
|
69 | 72 | )
|
70 | 73 | module = relative_path.split(os.path.sep)[0]
|
71 | 74 | instances_for_version = instances.get(schema_version, None)
|
72 |
| - if ( |
73 |
| - terms_as_enums |
74 |
| - and instances_for_version |
75 |
| - and "controlled" in schema_file_path |
| 75 | + if instances_for_version and any( |
| 76 | + [ |
| 77 | + terms_as_enums and "controlled" in schema_file_path, |
| 78 | + licenses_as_enums and "license" in schema_file_path, |
| 79 | + content_types_as_enums and "contentType" in schema_file_path, |
| 80 | + graph_structures_as_enums |
| 81 | + and ( |
| 82 | + "parcellationEntity" in schema_file_path |
| 83 | + or "commonCoordinateSpace" in schema_file_path |
| 84 | + ), |
| 85 | + ] |
76 | 86 | ):
|
77 | 87 | LinkMLEnumBuilder(
|
78 | 88 | schema_file_path,
|
|
144 | 154 | },
|
145 | 155 | "default_prefix": "omi",
|
146 | 156 | "imports": ["linkml:types"],
|
147 |
| - "slots": slots |
| 157 | + "slots": slots, |
148 | 158 | }
|
149 | 159 | with open(
|
150 | 160 | os.path.join("target", "schemas", schema_version, f"slots.yaml"),
|
|
172 | 182 | "repr": "str",
|
173 | 183 | "base": "str",
|
174 | 184 | "description": "A correctly formatted e-mail address",
|
175 |
| - "exact_mappings": ["schema:email"] |
| 185 | + "exact_mappings": ["schema:email"], |
176 | 186 | },
|
177 | 187 | "ECMA262": {
|
178 | 188 | "uri": "linkml:ECMA262",
|
179 | 189 | "repr": "str",
|
180 | 190 | "base": "str",
|
181 |
| - "description": "Text which is syntactically valid ECMAScript code" |
182 |
| - } |
183 |
| - |
184 |
| - } |
| 191 | + "description": "Text which is syntactically valid ECMAScript code", |
| 192 | + }, |
| 193 | + }, |
185 | 194 | }
|
186 | 195 | with open(
|
187 |
| - os.path.join( |
188 |
| - "target", "schemas", schema_version, f"types.yaml" |
189 |
| - ), |
| 196 | + os.path.join("target", "schemas", schema_version, f"types.yaml"), |
190 | 197 | "w",
|
191 | 198 | ) as fp:
|
192 | 199 | yaml.dump(types_metadata, fp, sort_keys=False)
|
|
0 commit comments