linkml 1.8.7__py3-none-any.whl → 1.9.1__py3-none-any.whl
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.
- linkml/generators/common/build.py +1 -7
- linkml/generators/common/ifabsent_processor.py +20 -20
- linkml/generators/common/lifecycle.py +2 -1
- linkml/generators/common/naming.py +1 -1
- linkml/generators/common/template.py +5 -5
- linkml/generators/common/type_designators.py +1 -3
- linkml/generators/csvgen.py +3 -3
- linkml/generators/docgen/class.md.jinja2 +1 -1
- linkml/generators/docgen/enum.md.jinja2 +1 -1
- linkml/generators/docgen/schema.md.jinja2 +1 -1
- linkml/generators/docgen/slot.md.jinja2 +4 -1
- linkml/generators/docgen/subset.md.jinja2 +1 -1
- linkml/generators/docgen/type.md.jinja2 +1 -1
- linkml/generators/docgen.py +20 -25
- linkml/generators/dotgen.py +4 -4
- linkml/generators/erdiagramgen.py +7 -7
- linkml/generators/excelgen.py +2 -3
- linkml/generators/golanggen.py +2 -2
- linkml/generators/golrgen.py +3 -3
- linkml/generators/jsonldcontextgen.py +4 -4
- linkml/generators/jsonschemagen.py +5 -5
- linkml/generators/linkmlgen.py +10 -2
- linkml/generators/markdowngen.py +8 -10
- linkml/generators/mermaidclassdiagramgen.py +2 -2
- linkml/generators/oocodegen.py +10 -10
- linkml/generators/owlgen.py +19 -18
- linkml/generators/plantumlgen.py +15 -15
- linkml/generators/prefixmapgen.py +5 -5
- linkml/generators/projectgen.py +10 -10
- linkml/generators/pydanticgen/array.py +15 -21
- linkml/generators/pydanticgen/build.py +4 -4
- linkml/generators/pydanticgen/includes.py +1 -1
- linkml/generators/pydanticgen/pydanticgen.py +24 -28
- linkml/generators/pydanticgen/template.py +36 -36
- linkml/generators/pythongen.py +21 -29
- linkml/generators/rdfgen.py +2 -2
- linkml/generators/shaclgen.py +19 -10
- linkml/generators/shexgen.py +3 -3
- linkml/generators/sparqlgen.py +3 -3
- linkml/generators/sqlalchemygen.py +2 -2
- linkml/generators/terminusdbgen.py +2 -3
- linkml/generators/typescriptgen.py +3 -3
- linkml/generators/yumlgen.py +13 -13
- linkml/linter/cli.py +1 -1
- linkml/linter/config/datamodel/config.py +207 -213
- linkml/linter/config/datamodel/config.yaml +51 -3
- linkml/linter/config/default.yaml +3 -0
- linkml/linter/formatters/markdown_formatter.py +2 -2
- linkml/linter/linter.py +4 -3
- linkml/linter/rules.py +38 -19
- linkml/reporting/model.py +11 -15
- linkml/transformers/logical_model_transformer.py +9 -8
- linkml/transformers/relmodel_transformer.py +6 -6
- linkml/transformers/schema_renamer.py +2 -2
- linkml/utils/converter.py +1 -1
- linkml/utils/deprecation.py +3 -3
- linkml/utils/execute_tutorial.py +5 -6
- linkml/utils/generator.py +17 -16
- linkml/utils/helpers.py +2 -2
- linkml/utils/logictools.py +5 -4
- linkml/utils/mergeutils.py +51 -5
- linkml/utils/schema_builder.py +8 -8
- linkml/utils/schema_fixer.py +8 -8
- linkml/utils/schemaloader.py +16 -15
- linkml/utils/schemasynopsis.py +29 -29
- linkml/utils/sqlutils.py +5 -5
- linkml/utils/typereferences.py +5 -6
- linkml/utils/validation.py +2 -2
- linkml/validator/cli.py +7 -6
- linkml/validator/loaders/delimited_file_loader.py +2 -1
- linkml/validator/loaders/json_loader.py +2 -1
- linkml/validator/loaders/loader.py +2 -1
- linkml/validator/loaders/passthrough_loader.py +2 -1
- linkml/validator/loaders/yaml_loader.py +2 -1
- linkml/validator/plugins/jsonschema_validation_plugin.py +2 -1
- linkml/validator/plugins/pydantic_validation_plugin.py +2 -1
- linkml/validator/plugins/recommended_slots_plugin.py +3 -2
- linkml/validator/plugins/shacl_validation_plugin.py +2 -1
- linkml/validator/plugins/validation_plugin.py +1 -1
- linkml/validator/report.py +3 -3
- linkml/validator/validator.py +3 -2
- linkml/validators/jsonschemavalidator.py +6 -5
- linkml/workspaces/datamodel/workspaces.py +21 -26
- linkml/workspaces/example_runner.py +7 -6
- {linkml-1.8.7.dist-info → linkml-1.9.1.dist-info}/METADATA +6 -9
- linkml-1.9.1.dist-info/RECORD +162 -0
- {linkml-1.8.7.dist-info → linkml-1.9.1.dist-info}/WHEEL +1 -1
- linkml-1.8.7.dist-info/RECORD +0 -162
- {linkml-1.8.7.dist-info → linkml-1.9.1.dist-info}/LICENSE +0 -0
- {linkml-1.8.7.dist-info → linkml-1.9.1.dist-info}/entry_points.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
# Auto generated from config.yaml by pythongen.py version: 0.
|
2
|
-
# Generation date:
|
1
|
+
# Auto generated from config.yaml by pythongen.py version: 0.0.1
|
2
|
+
# Generation date: 2025-04-07T17:57:08
|
3
3
|
# Schema: linter-config
|
4
4
|
#
|
5
5
|
# id: https://w3id.org/linkml/linter/config
|
@@ -7,28 +7,64 @@
|
|
7
7
|
# license: https://creativecommons.org/publicdomain/zero/1.0/
|
8
8
|
|
9
9
|
import dataclasses
|
10
|
+
import re
|
10
11
|
from dataclasses import dataclass
|
11
|
-
from
|
12
|
+
from datetime import (
|
13
|
+
date,
|
14
|
+
datetime,
|
15
|
+
time
|
16
|
+
)
|
17
|
+
from typing import (
|
18
|
+
Any,
|
19
|
+
ClassVar,
|
20
|
+
|
21
|
+
Optional,
|
22
|
+
Union
|
23
|
+
)
|
12
24
|
|
13
|
-
from jsonasobj2 import
|
14
|
-
|
25
|
+
from jsonasobj2 import (
|
26
|
+
JsonObj,
|
27
|
+
as_dict
|
28
|
+
)
|
29
|
+
from linkml_runtime.linkml_model.meta import (
|
30
|
+
EnumDefinition,
|
31
|
+
PermissibleValue,
|
32
|
+
PvFormulaOptions
|
33
|
+
)
|
15
34
|
from linkml_runtime.utils.curienamespace import CurieNamespace
|
16
|
-
from linkml_runtime.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs
|
17
35
|
from linkml_runtime.utils.enumerations import EnumDefinitionImpl
|
18
|
-
from linkml_runtime.utils.
|
36
|
+
from linkml_runtime.utils.formatutils import (
|
37
|
+
camelcase,
|
38
|
+
sfx,
|
39
|
+
underscore
|
40
|
+
)
|
41
|
+
from linkml_runtime.utils.metamodelcore import (
|
42
|
+
bnode,
|
43
|
+
empty_dict,
|
44
|
+
empty_list
|
45
|
+
)
|
19
46
|
from linkml_runtime.utils.slot import Slot
|
20
|
-
from linkml_runtime.utils.yamlutils import
|
21
|
-
|
47
|
+
from linkml_runtime.utils.yamlutils import (
|
48
|
+
YAMLRoot,
|
49
|
+
extended_float,
|
50
|
+
extended_int,
|
51
|
+
extended_str
|
52
|
+
)
|
53
|
+
from rdflib import (
|
54
|
+
Namespace,
|
55
|
+
URIRef
|
56
|
+
)
|
57
|
+
|
58
|
+
from linkml_runtime.linkml_model.types import Boolean, String
|
59
|
+
from linkml_runtime.utils.metamodelcore import Bool
|
22
60
|
|
23
61
|
metamodel_version = "1.7.0"
|
24
62
|
version = None
|
25
63
|
|
26
|
-
# Overwrite dataclasses _init_fn to add **kwargs in __init__
|
27
|
-
dataclasses._init_fn = dataclasses_init_fn_with_kwargs
|
28
64
|
|
29
65
|
# Namespaces
|
30
|
-
LINKML = CurieNamespace(
|
31
|
-
LINTCFG = CurieNamespace(
|
66
|
+
LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/')
|
67
|
+
LINTCFG = CurieNamespace('lintcfg', 'https://w3id.org/linkml/linter/config')
|
32
68
|
DEFAULT_ = LINTCFG
|
33
69
|
|
34
70
|
|
@@ -37,16 +73,17 @@ DEFAULT_ = LINTCFG
|
|
37
73
|
# Class references
|
38
74
|
|
39
75
|
|
40
|
-
|
76
|
+
|
77
|
+
@dataclass(repr=False)
|
41
78
|
class Config(YAMLRoot):
|
42
79
|
"""
|
43
|
-
This is the top-level representation of a LinkML linter configuration file.
|
44
|
-
|
80
|
+
This is the top-level representation of a LinkML linter configuration file. It allows defining a set of rules
|
81
|
+
while also optionally extending a predefined set of rules.
|
45
82
|
"""
|
46
83
|
|
47
|
-
_inherited_slots: ClassVar[
|
84
|
+
_inherited_slots: ClassVar[list[str]] = []
|
48
85
|
|
49
|
-
class_class_uri: ClassVar[URIRef] = LINTCFG
|
86
|
+
class_class_uri: ClassVar[URIRef] = LINTCFG["Config"]
|
50
87
|
class_class_curie: ClassVar[str] = "lintcfg:Config"
|
51
88
|
class_name: ClassVar[str] = "Config"
|
52
89
|
class_model_uri: ClassVar[URIRef] = LINTCFG.Config
|
@@ -54,7 +91,7 @@ class Config(YAMLRoot):
|
|
54
91
|
extends: Optional[Union[str, "ExtendableConfigs"]] = None
|
55
92
|
rules: Optional[Union[dict, "Rules"]] = None
|
56
93
|
|
57
|
-
def __post_init__(self, *_:
|
94
|
+
def __post_init__(self, *_: list[str], **kwargs: dict[str, Any]):
|
58
95
|
if self.extends is not None and not isinstance(self.extends, ExtendableConfigs):
|
59
96
|
self.extends = ExtendableConfigs(self.extends)
|
60
97
|
|
@@ -64,16 +101,20 @@ class Config(YAMLRoot):
|
|
64
101
|
super().__post_init__(**kwargs)
|
65
102
|
|
66
103
|
|
67
|
-
@dataclass
|
104
|
+
@dataclass(repr=False)
|
68
105
|
class Rules(YAMLRoot):
|
69
|
-
|
106
|
+
"""
|
107
|
+
Each attribute of this class represents a rule that can be enabled and possibly configured by a configuration
|
108
|
+
file.
|
109
|
+
"""
|
110
|
+
_inherited_slots: ClassVar[list[str]] = []
|
70
111
|
|
71
|
-
class_class_uri: ClassVar[URIRef] = LINTCFG
|
112
|
+
class_class_uri: ClassVar[URIRef] = LINTCFG["Rules"]
|
72
113
|
class_class_curie: ClassVar[str] = "lintcfg:Rules"
|
73
114
|
class_name: ClassVar[str] = "Rules"
|
74
115
|
class_model_uri: ClassVar[URIRef] = LINTCFG.Rules
|
75
116
|
|
76
|
-
no_empty_title: Optional[Union[dict, "
|
117
|
+
no_empty_title: Optional[Union[dict, "NoEmptyTitleConfig"]] = None
|
77
118
|
permissible_values_format: Optional[Union[dict, "PermissibleValuesFormatRuleConfig"]] = None
|
78
119
|
tree_root_class: Optional[Union[dict, "TreeRootClassRuleConfig"]] = None
|
79
120
|
recommended: Optional[Union[dict, "RecommendedRuleConfig"]] = None
|
@@ -82,16 +123,12 @@ class Rules(YAMLRoot):
|
|
82
123
|
standard_naming: Optional[Union[dict, "StandardNamingConfig"]] = None
|
83
124
|
canonical_prefixes: Optional[Union[dict, "CanonicalPrefixesConfig"]] = None
|
84
125
|
|
85
|
-
def __post_init__(self, *_:
|
86
|
-
if self.no_empty_title is not None and not isinstance(self.no_empty_title,
|
87
|
-
self.no_empty_title =
|
126
|
+
def __post_init__(self, *_: list[str], **kwargs: dict[str, Any]):
|
127
|
+
if self.no_empty_title is not None and not isinstance(self.no_empty_title, NoEmptyTitleConfig):
|
128
|
+
self.no_empty_title = NoEmptyTitleConfig(**as_dict(self.no_empty_title))
|
88
129
|
|
89
|
-
if self.permissible_values_format is not None and not isinstance(
|
90
|
-
self.permissible_values_format
|
91
|
-
):
|
92
|
-
self.permissible_values_format = PermissibleValuesFormatRuleConfig(
|
93
|
-
**as_dict(self.permissible_values_format)
|
94
|
-
)
|
130
|
+
if self.permissible_values_format is not None and not isinstance(self.permissible_values_format, PermissibleValuesFormatRuleConfig):
|
131
|
+
self.permissible_values_format = PermissibleValuesFormatRuleConfig(**as_dict(self.permissible_values_format))
|
95
132
|
|
96
133
|
if self.tree_root_class is not None and not isinstance(self.tree_root_class, TreeRootClassRuleConfig):
|
97
134
|
self.tree_root_class = TreeRootClassRuleConfig(**as_dict(self.tree_root_class))
|
@@ -114,22 +151,22 @@ class Rules(YAMLRoot):
|
|
114
151
|
super().__post_init__(**kwargs)
|
115
152
|
|
116
153
|
|
117
|
-
@dataclass
|
154
|
+
@dataclass(repr=False)
|
118
155
|
class RuleConfig(YAMLRoot):
|
119
156
|
"""
|
120
157
|
This is the base class for linter rules. It contains configuration options that are common to all rules.
|
121
158
|
"""
|
122
159
|
|
123
|
-
_inherited_slots: ClassVar[
|
160
|
+
_inherited_slots: ClassVar[list[str]] = []
|
124
161
|
|
125
|
-
class_class_uri: ClassVar[URIRef] = LINTCFG
|
162
|
+
class_class_uri: ClassVar[URIRef] = LINTCFG["RuleConfig"]
|
126
163
|
class_class_curie: ClassVar[str] = "lintcfg:RuleConfig"
|
127
164
|
class_name: ClassVar[str] = "RuleConfig"
|
128
165
|
class_model_uri: ClassVar[URIRef] = LINTCFG.RuleConfig
|
129
166
|
|
130
167
|
level: Union[str, "RuleLevel"] = None
|
131
168
|
|
132
|
-
def __post_init__(self, *_:
|
169
|
+
def __post_init__(self, *_: list[str], **kwargs: dict[str, Any]):
|
133
170
|
if self._is_empty(self.level):
|
134
171
|
self.MissingRequiredField("level")
|
135
172
|
if not isinstance(self.level, RuleLevel):
|
@@ -138,15 +175,15 @@ class RuleConfig(YAMLRoot):
|
|
138
175
|
super().__post_init__(**kwargs)
|
139
176
|
|
140
177
|
|
141
|
-
@dataclass
|
178
|
+
@dataclass(repr=False)
|
142
179
|
class PermissibleValuesFormatRuleConfig(RuleConfig):
|
143
180
|
"""
|
144
181
|
Additional configuration options for the `permissible_values_format` rule
|
145
182
|
"""
|
146
183
|
|
147
|
-
_inherited_slots: ClassVar[
|
184
|
+
_inherited_slots: ClassVar[list[str]] = []
|
148
185
|
|
149
|
-
class_class_uri: ClassVar[URIRef] = LINTCFG
|
186
|
+
class_class_uri: ClassVar[URIRef] = LINTCFG["PermissibleValuesFormatRuleConfig"]
|
150
187
|
class_class_curie: ClassVar[str] = "lintcfg:PermissibleValuesFormatRuleConfig"
|
151
188
|
class_name: ClassVar[str] = "PermissibleValuesFormatRuleConfig"
|
152
189
|
class_model_uri: ClassVar[URIRef] = LINTCFG.PermissibleValuesFormatRuleConfig
|
@@ -154,22 +191,22 @@ class PermissibleValuesFormatRuleConfig(RuleConfig):
|
|
154
191
|
level: Union[str, "RuleLevel"] = None
|
155
192
|
format: Optional[str] = None
|
156
193
|
|
157
|
-
def __post_init__(self, *_:
|
194
|
+
def __post_init__(self, *_: list[str], **kwargs: dict[str, Any]):
|
158
195
|
if self.format is not None and not isinstance(self.format, str):
|
159
196
|
self.format = str(self.format)
|
160
197
|
|
161
198
|
super().__post_init__(**kwargs)
|
162
199
|
|
163
200
|
|
164
|
-
@dataclass
|
201
|
+
@dataclass(repr=False)
|
165
202
|
class TreeRootClassRuleConfig(RuleConfig):
|
166
203
|
"""
|
167
204
|
Additional configuration options for the `tree_root_class` rule
|
168
205
|
"""
|
169
206
|
|
170
|
-
_inherited_slots: ClassVar[
|
207
|
+
_inherited_slots: ClassVar[list[str]] = []
|
171
208
|
|
172
|
-
class_class_uri: ClassVar[URIRef] = LINTCFG
|
209
|
+
class_class_uri: ClassVar[URIRef] = LINTCFG["TreeRootClassRuleConfig"]
|
173
210
|
class_class_curie: ClassVar[str] = "lintcfg:TreeRootClassRuleConfig"
|
174
211
|
class_name: ClassVar[str] = "TreeRootClassRuleConfig"
|
175
212
|
class_model_uri: ClassVar[URIRef] = LINTCFG.TreeRootClassRuleConfig
|
@@ -178,7 +215,7 @@ class TreeRootClassRuleConfig(RuleConfig):
|
|
178
215
|
root_class_name: Optional[str] = None
|
179
216
|
validate_existing_class_name: Optional[Union[bool, Bool]] = None
|
180
217
|
|
181
|
-
def __post_init__(self, *_:
|
218
|
+
def __post_init__(self, *_: list[str], **kwargs: dict[str, Any]):
|
182
219
|
if self.root_class_name is not None and not isinstance(self.root_class_name, str):
|
183
220
|
self.root_class_name = str(self.root_class_name)
|
184
221
|
|
@@ -188,24 +225,25 @@ class TreeRootClassRuleConfig(RuleConfig):
|
|
188
225
|
super().__post_init__(**kwargs)
|
189
226
|
|
190
227
|
|
191
|
-
@dataclass
|
228
|
+
@dataclass(repr=False)
|
192
229
|
class RecommendedRuleConfig(RuleConfig):
|
193
230
|
"""
|
194
231
|
Additional configuration options for the `recommended` rule
|
195
232
|
"""
|
196
233
|
|
197
|
-
_inherited_slots: ClassVar[
|
234
|
+
_inherited_slots: ClassVar[list[str]] = []
|
198
235
|
|
199
|
-
class_class_uri: ClassVar[URIRef] = LINTCFG
|
236
|
+
class_class_uri: ClassVar[URIRef] = LINTCFG["RecommendedRuleConfig"]
|
200
237
|
class_class_curie: ClassVar[str] = "lintcfg:RecommendedRuleConfig"
|
201
238
|
class_name: ClassVar[str] = "RecommendedRuleConfig"
|
202
239
|
class_model_uri: ClassVar[URIRef] = LINTCFG.RecommendedRuleConfig
|
203
240
|
|
204
241
|
level: Union[str, "RuleLevel"] = None
|
205
|
-
include: Optional[Union[str,
|
206
|
-
exclude: Optional[Union[str,
|
242
|
+
include: Optional[Union[str, list[str]]] = empty_list()
|
243
|
+
exclude: Optional[Union[str, list[str]]] = empty_list()
|
244
|
+
exclude_type: Optional[Union[Union[str, "MetamodelElementTypeEnum"], list[Union[str, "MetamodelElementTypeEnum"]]]] = empty_list()
|
207
245
|
|
208
|
-
def __post_init__(self, *_:
|
246
|
+
def __post_init__(self, *_: list[str], **kwargs: dict[str, Any]):
|
209
247
|
if not isinstance(self.include, list):
|
210
248
|
self.include = [self.include] if self.include is not None else []
|
211
249
|
self.include = [v if isinstance(v, str) else str(v) for v in self.include]
|
@@ -214,31 +252,40 @@ class RecommendedRuleConfig(RuleConfig):
|
|
214
252
|
self.exclude = [self.exclude] if self.exclude is not None else []
|
215
253
|
self.exclude = [v if isinstance(v, str) else str(v) for v in self.exclude]
|
216
254
|
|
255
|
+
if not isinstance(self.exclude_type, list):
|
256
|
+
self.exclude_type = [self.exclude_type] if self.exclude_type is not None else []
|
257
|
+
self.exclude_type = [v if isinstance(v, MetamodelElementTypeEnum) else MetamodelElementTypeEnum(v) for v in self.exclude_type]
|
258
|
+
|
217
259
|
super().__post_init__(**kwargs)
|
218
260
|
|
219
261
|
|
220
|
-
@dataclass
|
262
|
+
@dataclass(repr=False)
|
221
263
|
class StandardNamingConfig(RuleConfig):
|
222
264
|
"""
|
223
265
|
Additional configuration options for the `standard_naming` rule
|
224
266
|
"""
|
225
267
|
|
226
|
-
_inherited_slots: ClassVar[
|
268
|
+
_inherited_slots: ClassVar[list[str]] = []
|
227
269
|
|
228
|
-
class_class_uri: ClassVar[URIRef] = LINTCFG
|
270
|
+
class_class_uri: ClassVar[URIRef] = LINTCFG["StandardNamingConfig"]
|
229
271
|
class_class_curie: ClassVar[str] = "lintcfg:StandardNamingConfig"
|
230
272
|
class_name: ClassVar[str] = "StandardNamingConfig"
|
231
273
|
class_model_uri: ClassVar[URIRef] = LINTCFG.StandardNamingConfig
|
232
274
|
|
233
275
|
level: Union[str, "RuleLevel"] = None
|
234
276
|
permissible_values_upper_case: Optional[Union[bool, Bool]] = None
|
235
|
-
|
277
|
+
exclude_type: Optional[Union[Union[str, "MetamodelElementTypeEnum"], list[Union[str, "MetamodelElementTypeEnum"]]]] = empty_list()
|
236
278
|
class_pattern: Optional[str] = None
|
279
|
+
slot_pattern: Optional[str] = None
|
237
280
|
|
238
|
-
def __post_init__(self, *_:
|
281
|
+
def __post_init__(self, *_: list[str], **kwargs: dict[str, Any]):
|
239
282
|
if self.permissible_values_upper_case is not None and not isinstance(self.permissible_values_upper_case, Bool):
|
240
283
|
self.permissible_values_upper_case = Bool(self.permissible_values_upper_case)
|
241
284
|
|
285
|
+
if not isinstance(self.exclude_type, list):
|
286
|
+
self.exclude_type = [self.exclude_type] if self.exclude_type is not None else []
|
287
|
+
self.exclude_type = [v if isinstance(v, MetamodelElementTypeEnum) else MetamodelElementTypeEnum(v) for v in self.exclude_type]
|
288
|
+
|
242
289
|
if self.class_pattern is not None and not isinstance(self.class_pattern, str):
|
243
290
|
self.class_pattern = str(self.class_pattern)
|
244
291
|
|
@@ -248,23 +295,23 @@ class StandardNamingConfig(RuleConfig):
|
|
248
295
|
super().__post_init__(**kwargs)
|
249
296
|
|
250
297
|
|
251
|
-
@dataclass
|
298
|
+
@dataclass(repr=False)
|
252
299
|
class CanonicalPrefixesConfig(RuleConfig):
|
253
300
|
"""
|
254
301
|
Additional configuration options for the canonical_prefixes rule
|
255
302
|
"""
|
256
303
|
|
257
|
-
_inherited_slots: ClassVar[
|
304
|
+
_inherited_slots: ClassVar[list[str]] = []
|
258
305
|
|
259
|
-
class_class_uri: ClassVar[URIRef] = LINTCFG
|
306
|
+
class_class_uri: ClassVar[URIRef] = LINTCFG["CanonicalPrefixesConfig"]
|
260
307
|
class_class_curie: ClassVar[str] = "lintcfg:CanonicalPrefixesConfig"
|
261
308
|
class_name: ClassVar[str] = "CanonicalPrefixesConfig"
|
262
309
|
class_model_uri: ClassVar[URIRef] = LINTCFG.CanonicalPrefixesConfig
|
263
310
|
|
264
311
|
level: Union[str, "RuleLevel"] = None
|
265
|
-
prefixmaps_contexts: Optional[Union[str,
|
312
|
+
prefixmaps_contexts: Optional[Union[str, list[str]]] = empty_list()
|
266
313
|
|
267
|
-
def __post_init__(self, *_:
|
314
|
+
def __post_init__(self, *_: list[str], **kwargs: dict[str, Any]):
|
268
315
|
if not isinstance(self.prefixmaps_contexts, list):
|
269
316
|
self.prefixmaps_contexts = [self.prefixmaps_contexts] if self.prefixmaps_contexts is not None else []
|
270
317
|
self.prefixmaps_contexts = [v if isinstance(v, str) else str(v) for v in self.prefixmaps_contexts]
|
@@ -272,204 +319,151 @@ class CanonicalPrefixesConfig(RuleConfig):
|
|
272
319
|
super().__post_init__(**kwargs)
|
273
320
|
|
274
321
|
|
322
|
+
@dataclass(repr=False)
|
323
|
+
class NoEmptyTitleConfig(RuleConfig):
|
324
|
+
"""
|
325
|
+
Additional configuration options for the no_empty_title rule
|
326
|
+
"""
|
327
|
+
_inherited_slots: ClassVar[list[str]] = []
|
328
|
+
|
329
|
+
class_class_uri: ClassVar[URIRef] = LINTCFG["NoEmptyTitleConfig"]
|
330
|
+
class_class_curie: ClassVar[str] = "lintcfg:NoEmptyTitleConfig"
|
331
|
+
class_name: ClassVar[str] = "NoEmptyTitleConfig"
|
332
|
+
class_model_uri: ClassVar[URIRef] = LINTCFG.NoEmptyTitleConfig
|
333
|
+
|
334
|
+
level: Union[str, "RuleLevel"] = None
|
335
|
+
exclude_type: Optional[Union[Union[str, "MetamodelElementTypeEnum"], list[Union[str, "MetamodelElementTypeEnum"]]]] = empty_list()
|
336
|
+
|
337
|
+
def __post_init__(self, *_: list[str], **kwargs: dict[str, Any]):
|
338
|
+
if not isinstance(self.exclude_type, list):
|
339
|
+
self.exclude_type = [self.exclude_type] if self.exclude_type is not None else []
|
340
|
+
self.exclude_type = [v if isinstance(v, MetamodelElementTypeEnum) else MetamodelElementTypeEnum(v) for v in self.exclude_type]
|
341
|
+
|
342
|
+
super().__post_init__(**kwargs)
|
343
|
+
|
344
|
+
|
275
345
|
# Enumerations
|
276
346
|
class ExtendableConfigs(EnumDefinitionImpl):
|
277
347
|
"""
|
278
348
|
The permissible values for the `extends` field of a config file
|
279
349
|
"""
|
280
|
-
|
281
|
-
|
350
|
+
recommended = PermissibleValue(
|
351
|
+
text="recommended",
|
352
|
+
description="Extend the recommended rule set")
|
282
353
|
|
283
354
|
_defn = EnumDefinition(
|
284
355
|
name="ExtendableConfigs",
|
285
356
|
description="The permissible values for the `extends` field of a config file",
|
286
357
|
)
|
287
358
|
|
288
|
-
|
289
359
|
class RuleLevel(EnumDefinitionImpl):
|
290
360
|
"""
|
291
361
|
The permissible values for the `level` option of all rules
|
292
362
|
"""
|
293
|
-
|
294
|
-
|
363
|
+
disabled = PermissibleValue(
|
364
|
+
text="disabled",
|
365
|
+
description="The rule will not be checked")
|
295
366
|
warning = PermissibleValue(
|
296
367
|
text="warning",
|
297
|
-
description="A violation of a rule at this level is a minor issue that should be fixed"
|
298
|
-
)
|
368
|
+
description="A violation of a rule at this level is a minor issue that should be fixed")
|
299
369
|
error = PermissibleValue(
|
300
370
|
text="error",
|
301
|
-
description="A violation of a rule at this level is a major issue that must be fixed"
|
302
|
-
)
|
371
|
+
description="A violation of a rule at this level is a major issue that must be fixed")
|
303
372
|
|
304
373
|
_defn = EnumDefinition(
|
305
374
|
name="RuleLevel",
|
306
375
|
description="The permissible values for the `level` option of all rules",
|
307
376
|
)
|
308
377
|
|
378
|
+
class MetamodelElementTypeEnum(EnumDefinitionImpl):
|
379
|
+
"""
|
380
|
+
The permissible values for the exclude_type slot
|
381
|
+
"""
|
382
|
+
class_definition = PermissibleValue(
|
383
|
+
text="class_definition",
|
384
|
+
meaning=LINKML["ClassDefinition"])
|
385
|
+
enum_definition = PermissibleValue(
|
386
|
+
text="enum_definition",
|
387
|
+
meaning=LINKML["EnumDefinition"])
|
388
|
+
permissible_value = PermissibleValue(
|
389
|
+
text="permissible_value",
|
390
|
+
meaning=LINKML["PermissibleValue"])
|
391
|
+
slot_definition = PermissibleValue(text="slot_definition")
|
392
|
+
|
393
|
+
_defn = EnumDefinition(
|
394
|
+
name="MetamodelElementTypeEnum",
|
395
|
+
description="The permissible values for the exclude_type slot",
|
396
|
+
)
|
309
397
|
|
310
398
|
# Slots
|
311
399
|
class slots:
|
312
400
|
pass
|
313
401
|
|
402
|
+
slots.config__extends = Slot(uri=LINTCFG.extends, name="config__extends", curie=LINTCFG.curie('extends'),
|
403
|
+
model_uri=LINTCFG.config__extends, domain=None, range=Optional[Union[str, "ExtendableConfigs"]])
|
314
404
|
|
315
|
-
slots.
|
316
|
-
|
317
|
-
name="config__extends",
|
318
|
-
curie=LINTCFG.curie("extends"),
|
319
|
-
model_uri=LINTCFG.config__extends,
|
320
|
-
domain=None,
|
321
|
-
range=Optional[Union[str, "ExtendableConfigs"]],
|
322
|
-
)
|
405
|
+
slots.config__rules = Slot(uri=LINTCFG.rules, name="config__rules", curie=LINTCFG.curie('rules'),
|
406
|
+
model_uri=LINTCFG.config__rules, domain=None, range=Optional[Union[dict, Rules]])
|
323
407
|
|
324
|
-
slots.
|
325
|
-
|
326
|
-
name="config__rules",
|
327
|
-
curie=LINTCFG.curie("rules"),
|
328
|
-
model_uri=LINTCFG.config__rules,
|
329
|
-
domain=None,
|
330
|
-
range=Optional[Union[dict, Rules]],
|
331
|
-
)
|
408
|
+
slots.rules__no_empty_title = Slot(uri=LINTCFG.no_empty_title, name="rules__no_empty_title", curie=LINTCFG.curie('no_empty_title'),
|
409
|
+
model_uri=LINTCFG.rules__no_empty_title, domain=None, range=Optional[Union[dict, NoEmptyTitleConfig]])
|
332
410
|
|
333
|
-
slots.
|
334
|
-
|
335
|
-
name="rules__no_empty_title",
|
336
|
-
curie=LINTCFG.curie("no_empty_title"),
|
337
|
-
model_uri=LINTCFG.rules__no_empty_title,
|
338
|
-
domain=None,
|
339
|
-
range=Optional[Union[dict, RuleConfig]],
|
340
|
-
)
|
411
|
+
slots.rules__permissible_values_format = Slot(uri=LINTCFG.permissible_values_format, name="rules__permissible_values_format", curie=LINTCFG.curie('permissible_values_format'),
|
412
|
+
model_uri=LINTCFG.rules__permissible_values_format, domain=None, range=Optional[Union[dict, PermissibleValuesFormatRuleConfig]])
|
341
413
|
|
342
|
-
slots.
|
343
|
-
|
344
|
-
name="rules__permissible_values_format",
|
345
|
-
curie=LINTCFG.curie("permissible_values_format"),
|
346
|
-
model_uri=LINTCFG.rules__permissible_values_format,
|
347
|
-
domain=None,
|
348
|
-
range=Optional[Union[dict, PermissibleValuesFormatRuleConfig]],
|
349
|
-
)
|
414
|
+
slots.rules__tree_root_class = Slot(uri=LINTCFG.tree_root_class, name="rules__tree_root_class", curie=LINTCFG.curie('tree_root_class'),
|
415
|
+
model_uri=LINTCFG.rules__tree_root_class, domain=None, range=Optional[Union[dict, TreeRootClassRuleConfig]])
|
350
416
|
|
351
|
-
slots.
|
352
|
-
|
353
|
-
name="rules__tree_root_class",
|
354
|
-
curie=LINTCFG.curie("tree_root_class"),
|
355
|
-
model_uri=LINTCFG.rules__tree_root_class,
|
356
|
-
domain=None,
|
357
|
-
range=Optional[Union[dict, TreeRootClassRuleConfig]],
|
358
|
-
)
|
417
|
+
slots.rules__recommended = Slot(uri=LINTCFG.recommended, name="rules__recommended", curie=LINTCFG.curie('recommended'),
|
418
|
+
model_uri=LINTCFG.rules__recommended, domain=None, range=Optional[Union[dict, RecommendedRuleConfig]])
|
359
419
|
|
360
|
-
slots.
|
361
|
-
|
362
|
-
name="rules__recommended",
|
363
|
-
curie=LINTCFG.curie("recommended"),
|
364
|
-
model_uri=LINTCFG.rules__recommended,
|
365
|
-
domain=None,
|
366
|
-
range=Optional[Union[dict, RecommendedRuleConfig]],
|
367
|
-
)
|
420
|
+
slots.rules__no_xsd_int_type = Slot(uri=LINTCFG.no_xsd_int_type, name="rules__no_xsd_int_type", curie=LINTCFG.curie('no_xsd_int_type'),
|
421
|
+
model_uri=LINTCFG.rules__no_xsd_int_type, domain=None, range=Optional[Union[dict, RuleConfig]])
|
368
422
|
|
369
|
-
slots.
|
370
|
-
|
371
|
-
name="rules__no_xsd_int_type",
|
372
|
-
curie=LINTCFG.curie("no_xsd_int_type"),
|
373
|
-
model_uri=LINTCFG.rules__no_xsd_int_type,
|
374
|
-
domain=None,
|
375
|
-
range=Optional[Union[dict, RuleConfig]],
|
376
|
-
)
|
423
|
+
slots.rules__no_invalid_slot_usage = Slot(uri=LINTCFG.no_invalid_slot_usage, name="rules__no_invalid_slot_usage", curie=LINTCFG.curie('no_invalid_slot_usage'),
|
424
|
+
model_uri=LINTCFG.rules__no_invalid_slot_usage, domain=None, range=Optional[Union[dict, RuleConfig]])
|
377
425
|
|
378
|
-
slots.
|
379
|
-
|
380
|
-
name="rules__no_invalid_slot_usage",
|
381
|
-
curie=LINTCFG.curie("no_invalid_slot_usage"),
|
382
|
-
model_uri=LINTCFG.rules__no_invalid_slot_usage,
|
383
|
-
domain=None,
|
384
|
-
range=Optional[Union[dict, RuleConfig]],
|
385
|
-
)
|
426
|
+
slots.rules__standard_naming = Slot(uri=LINTCFG.standard_naming, name="rules__standard_naming", curie=LINTCFG.curie('standard_naming'),
|
427
|
+
model_uri=LINTCFG.rules__standard_naming, domain=None, range=Optional[Union[dict, StandardNamingConfig]])
|
386
428
|
|
387
|
-
slots.
|
388
|
-
|
389
|
-
name="rules__standard_naming",
|
390
|
-
curie=LINTCFG.curie("standard_naming"),
|
391
|
-
model_uri=LINTCFG.rules__standard_naming,
|
392
|
-
domain=None,
|
393
|
-
range=Optional[Union[dict, StandardNamingConfig]],
|
394
|
-
)
|
429
|
+
slots.rules__canonical_prefixes = Slot(uri=LINTCFG.canonical_prefixes, name="rules__canonical_prefixes", curie=LINTCFG.curie('canonical_prefixes'),
|
430
|
+
model_uri=LINTCFG.rules__canonical_prefixes, domain=None, range=Optional[Union[dict, CanonicalPrefixesConfig]])
|
395
431
|
|
396
|
-
slots.
|
397
|
-
|
398
|
-
name="rules__canonical_prefixes",
|
399
|
-
curie=LINTCFG.curie("canonical_prefixes"),
|
400
|
-
model_uri=LINTCFG.rules__canonical_prefixes,
|
401
|
-
domain=None,
|
402
|
-
range=Optional[Union[dict, CanonicalPrefixesConfig]],
|
403
|
-
)
|
432
|
+
slots.ruleConfig__level = Slot(uri=LINTCFG.level, name="ruleConfig__level", curie=LINTCFG.curie('level'),
|
433
|
+
model_uri=LINTCFG.ruleConfig__level, domain=None, range=Union[str, "RuleLevel"])
|
404
434
|
|
405
|
-
slots.
|
406
|
-
|
407
|
-
name="ruleConfig__level",
|
408
|
-
curie=LINTCFG.curie("level"),
|
409
|
-
model_uri=LINTCFG.ruleConfig__level,
|
410
|
-
domain=None,
|
411
|
-
range=Union[str, "RuleLevel"],
|
412
|
-
)
|
435
|
+
slots.permissibleValuesFormatRuleConfig__format = Slot(uri=LINTCFG.format, name="permissibleValuesFormatRuleConfig__format", curie=LINTCFG.curie('format'),
|
436
|
+
model_uri=LINTCFG.permissibleValuesFormatRuleConfig__format, domain=None, range=Optional[str])
|
413
437
|
|
414
|
-
slots.
|
415
|
-
|
416
|
-
name="permissibleValuesFormatRuleConfig__format",
|
417
|
-
curie=LINTCFG.curie("format"),
|
418
|
-
model_uri=LINTCFG.permissibleValuesFormatRuleConfig__format,
|
419
|
-
domain=None,
|
420
|
-
range=Optional[str],
|
421
|
-
)
|
438
|
+
slots.treeRootClassRuleConfig__root_class_name = Slot(uri=LINTCFG.root_class_name, name="treeRootClassRuleConfig__root_class_name", curie=LINTCFG.curie('root_class_name'),
|
439
|
+
model_uri=LINTCFG.treeRootClassRuleConfig__root_class_name, domain=None, range=Optional[str])
|
422
440
|
|
423
|
-
slots.
|
424
|
-
|
425
|
-
name="treeRootClassRuleConfig__root_class_name",
|
426
|
-
curie=LINTCFG.curie("root_class_name"),
|
427
|
-
model_uri=LINTCFG.treeRootClassRuleConfig__root_class_name,
|
428
|
-
domain=None,
|
429
|
-
range=Optional[str],
|
430
|
-
)
|
441
|
+
slots.treeRootClassRuleConfig__validate_existing_class_name = Slot(uri=LINTCFG.validate_existing_class_name, name="treeRootClassRuleConfig__validate_existing_class_name", curie=LINTCFG.curie('validate_existing_class_name'),
|
442
|
+
model_uri=LINTCFG.treeRootClassRuleConfig__validate_existing_class_name, domain=None, range=Optional[Union[bool, Bool]])
|
431
443
|
|
432
|
-
slots.
|
433
|
-
|
434
|
-
name="treeRootClassRuleConfig__validate_existing_class_name",
|
435
|
-
curie=LINTCFG.curie("validate_existing_class_name"),
|
436
|
-
model_uri=LINTCFG.treeRootClassRuleConfig__validate_existing_class_name,
|
437
|
-
domain=None,
|
438
|
-
range=Optional[Union[bool, Bool]],
|
439
|
-
)
|
444
|
+
slots.recommendedRuleConfig__include = Slot(uri=LINTCFG.include, name="recommendedRuleConfig__include", curie=LINTCFG.curie('include'),
|
445
|
+
model_uri=LINTCFG.recommendedRuleConfig__include, domain=None, range=Optional[Union[str, list[str]]])
|
440
446
|
|
441
|
-
slots.
|
442
|
-
|
443
|
-
name="recommendedRuleConfig__include",
|
444
|
-
curie=LINTCFG.curie("include"),
|
445
|
-
model_uri=LINTCFG.recommendedRuleConfig__include,
|
446
|
-
domain=None,
|
447
|
-
range=Optional[Union[str, List[str]]],
|
448
|
-
)
|
447
|
+
slots.recommendedRuleConfig__exclude = Slot(uri=LINTCFG.exclude, name="recommendedRuleConfig__exclude", curie=LINTCFG.curie('exclude'),
|
448
|
+
model_uri=LINTCFG.recommendedRuleConfig__exclude, domain=None, range=Optional[Union[str, list[str]]])
|
449
449
|
|
450
|
-
slots.
|
451
|
-
|
452
|
-
name="recommendedRuleConfig__exclude",
|
453
|
-
curie=LINTCFG.curie("exclude"),
|
454
|
-
model_uri=LINTCFG.recommendedRuleConfig__exclude,
|
455
|
-
domain=None,
|
456
|
-
range=Optional[Union[str, List[str]]],
|
457
|
-
)
|
450
|
+
slots.recommendedRuleConfig__exclude_type = Slot(uri=LINTCFG.exclude_type, name="recommendedRuleConfig__exclude_type", curie=LINTCFG.curie('exclude_type'),
|
451
|
+
model_uri=LINTCFG.recommendedRuleConfig__exclude_type, domain=None, range=Optional[Union[Union[str, "MetamodelElementTypeEnum"], list[Union[str, "MetamodelElementTypeEnum"]]]])
|
458
452
|
|
459
|
-
slots.standardNamingConfig__permissible_values_upper_case = Slot(
|
460
|
-
|
461
|
-
name="standardNamingConfig__permissible_values_upper_case",
|
462
|
-
curie=LINTCFG.curie("permissible_values_upper_case"),
|
463
|
-
model_uri=LINTCFG.standardNamingConfig__permissible_values_upper_case,
|
464
|
-
domain=None,
|
465
|
-
range=Optional[Union[bool, Bool]],
|
466
|
-
)
|
453
|
+
slots.standardNamingConfig__permissible_values_upper_case = Slot(uri=LINTCFG.permissible_values_upper_case, name="standardNamingConfig__permissible_values_upper_case", curie=LINTCFG.curie('permissible_values_upper_case'),
|
454
|
+
model_uri=LINTCFG.standardNamingConfig__permissible_values_upper_case, domain=None, range=Optional[Union[bool, Bool]])
|
467
455
|
|
468
|
-
slots.
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
)
|
456
|
+
slots.standardNamingConfig__exclude_type = Slot(uri=LINTCFG.exclude_type, name="standardNamingConfig__exclude_type", curie=LINTCFG.curie('exclude_type'),
|
457
|
+
model_uri=LINTCFG.standardNamingConfig__exclude_type, domain=None, range=Optional[Union[Union[str, "MetamodelElementTypeEnum"], list[Union[str, "MetamodelElementTypeEnum"]]]])
|
458
|
+
|
459
|
+
slots.standardNamingConfig__class_pattern = Slot(uri=LINTCFG.class_pattern, name="standardNamingConfig__class_pattern", curie=LINTCFG.curie('class_pattern'),
|
460
|
+
model_uri=LINTCFG.standardNamingConfig__class_pattern, domain=None, range=Optional[str])
|
461
|
+
|
462
|
+
slots.standardNamingConfig__slot_pattern = Slot(uri=LINTCFG.slot_pattern, name="standardNamingConfig__slot_pattern", curie=LINTCFG.curie('slot_pattern'),
|
463
|
+
model_uri=LINTCFG.standardNamingConfig__slot_pattern, domain=None, range=Optional[str])
|
464
|
+
|
465
|
+
slots.canonicalPrefixesConfig__prefixmaps_contexts = Slot(uri=LINTCFG.prefixmaps_contexts, name="canonicalPrefixesConfig__prefixmaps_contexts", curie=LINTCFG.curie('prefixmaps_contexts'),
|
466
|
+
model_uri=LINTCFG.canonicalPrefixesConfig__prefixmaps_contexts, domain=None, range=Optional[Union[str, list[str]]])
|
467
|
+
|
468
|
+
slots.noEmptyTitleConfig__exclude_type = Slot(uri=LINTCFG.exclude_type, name="noEmptyTitleConfig__exclude_type", curie=LINTCFG.curie('exclude_type'),
|
469
|
+
model_uri=LINTCFG.noEmptyTitleConfig__exclude_type, domain=None, range=Optional[Union[Union[str, "MetamodelElementTypeEnum"], list[Union[str, "MetamodelElementTypeEnum"]]]])
|