cognite-neat 0.75.8__py3-none-any.whl → 0.75.9__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.

Potentially problematic release.


This version of cognite-neat might be problematic. Click here for more details.

Files changed (88) hide show
  1. cognite/neat/_version.py +1 -1
  2. cognite/neat/app/api/configuration.py +4 -9
  3. cognite/neat/app/api/routers/configuration.py +2 -1
  4. cognite/neat/app/api/routers/crud.py +5 -5
  5. cognite/neat/app/api/routers/data_exploration.py +3 -1
  6. cognite/neat/app/api/routers/rules.py +3 -3
  7. cognite/neat/app/api/routers/workflows.py +3 -3
  8. cognite/neat/app/ui/neat-app/build/asset-manifest.json +3 -3
  9. cognite/neat/app/ui/neat-app/build/index.html +1 -1
  10. cognite/neat/app/ui/neat-app/build/static/js/{main.4345d42f.js → main.ec7f72e2.js} +3 -3
  11. cognite/neat/app/ui/neat-app/build/static/js/{main.4345d42f.js.map → main.ec7f72e2.js.map} +1 -1
  12. cognite/neat/config.py +147 -12
  13. cognite/neat/constants.py +1 -0
  14. cognite/neat/graph/exceptions.py +1 -2
  15. cognite/neat/legacy/graph/exceptions.py +1 -2
  16. cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +1 -2
  17. cognite/neat/legacy/graph/loaders/_asset_loader.py +8 -13
  18. cognite/neat/legacy/graph/loaders/_base.py +2 -4
  19. cognite/neat/legacy/graph/loaders/_exceptions.py +1 -3
  20. cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +4 -8
  21. cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +2 -4
  22. cognite/neat/legacy/graph/loaders/rdf_to_dms.py +2 -4
  23. cognite/neat/legacy/graph/loaders/validator.py +1 -1
  24. cognite/neat/legacy/graph/transformations/transformer.py +1 -2
  25. cognite/neat/legacy/rules/exporters/_rules2dms.py +1 -2
  26. cognite/neat/legacy/rules/exporters/_validation.py +4 -8
  27. cognite/neat/legacy/rules/importers/_base.py +0 -4
  28. cognite/neat/legacy/rules/importers/_dms2rules.py +0 -2
  29. cognite/neat/legacy/rules/models/rdfpath.py +1 -2
  30. cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +89 -0
  31. cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +152 -0
  32. cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +139 -0
  33. cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +270 -0
  34. cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +65 -0
  35. cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +116 -0
  36. cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +67 -0
  37. cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +64 -0
  38. cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +95 -0
  39. cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +111 -0
  40. cognite/neat/rules/exporters/_rules2excel.py +2 -2
  41. cognite/neat/rules/exporters/_validation.py +6 -8
  42. cognite/neat/rules/importers/_base.py +2 -4
  43. cognite/neat/rules/importers/_dms2rules.py +2 -4
  44. cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +2 -4
  45. cognite/neat/rules/importers/_dtdl2rules/spec.py +2 -4
  46. cognite/neat/rules/importers/_owl2rules/_owl2rules.py +2 -4
  47. cognite/neat/rules/importers/_spreadsheet2rules.py +4 -8
  48. cognite/neat/rules/importers/_yaml2rules.py +2 -4
  49. cognite/neat/rules/issues/dms.py +2 -4
  50. cognite/neat/rules/issues/formatters.py +3 -1
  51. cognite/neat/rules/models/entities.py +1 -2
  52. cognite/neat/rules/models/rdfpath.py +1 -2
  53. cognite/neat/rules/models/rules/_dms_architect_rules.py +2 -1
  54. cognite/neat/rules/models/rules/_dms_rules_write.py +11 -22
  55. cognite/neat/utils/cdf_loaders/_data_modeling.py +3 -1
  56. cognite/neat/utils/cdf_loaders/_ingestion.py +2 -4
  57. cognite/neat/utils/spreadsheet.py +2 -4
  58. cognite/neat/utils/utils.py +2 -4
  59. cognite/neat/workflows/base.py +5 -5
  60. cognite/neat/workflows/manager.py +32 -22
  61. cognite/neat/workflows/model.py +3 -3
  62. cognite/neat/workflows/steps/lib/__init__.py +0 -7
  63. cognite/neat/workflows/steps/lib/current/__init__.py +6 -0
  64. cognite/neat/workflows/steps/lib/{rules_exporter.py → current/rules_exporter.py} +8 -8
  65. cognite/neat/workflows/steps/lib/{rules_importer.py → current/rules_importer.py} +4 -4
  66. cognite/neat/workflows/steps/lib/io/__init__.py +1 -0
  67. cognite/neat/workflows/steps/lib/{v1 → legacy}/graph_contextualization.py +2 -2
  68. cognite/neat/workflows/steps/lib/{v1 → legacy}/graph_extractor.py +9 -9
  69. cognite/neat/workflows/steps/lib/{v1 → legacy}/graph_loader.py +9 -9
  70. cognite/neat/workflows/steps/lib/{v1 → legacy}/graph_store.py +4 -4
  71. cognite/neat/workflows/steps/lib/{v1 → legacy}/graph_transformer.py +2 -2
  72. cognite/neat/workflows/steps/lib/{v1 → legacy}/rules_exporter.py +15 -17
  73. cognite/neat/workflows/steps/lib/{v1 → legacy}/rules_importer.py +7 -7
  74. cognite/neat/workflows/steps/step_model.py +5 -9
  75. cognite/neat/workflows/steps_registry.py +20 -11
  76. {cognite_neat-0.75.8.dist-info → cognite_neat-0.75.9.dist-info}/METADATA +1 -1
  77. {cognite_neat-0.75.8.dist-info → cognite_neat-0.75.9.dist-info}/RECORD +87 -76
  78. cognite/neat/app/api/data_classes/configuration.py +0 -121
  79. /cognite/neat/app/ui/neat-app/build/static/js/{main.4345d42f.js.LICENSE.txt → main.ec7f72e2.js.LICENSE.txt} +0 -0
  80. /cognite/neat/workflows/steps/lib/{graph_extractor.py → current/graph_extractor.py} +0 -0
  81. /cognite/neat/workflows/steps/lib/{graph_loader.py → current/graph_loader.py} +0 -0
  82. /cognite/neat/workflows/steps/lib/{graph_store.py → current/graph_store.py} +0 -0
  83. /cognite/neat/workflows/steps/lib/{rules_validator.py → current/rules_validator.py} +0 -0
  84. /cognite/neat/workflows/steps/lib/{io_steps.py → io/io_steps.py} +0 -0
  85. /cognite/neat/workflows/steps/lib/{v1 → legacy}/__init__.py +0 -0
  86. {cognite_neat-0.75.8.dist-info → cognite_neat-0.75.9.dist-info}/LICENSE +0 -0
  87. {cognite_neat-0.75.8.dist-info → cognite_neat-0.75.9.dist-info}/WHEEL +0 -0
  88. {cognite_neat-0.75.8.dist-info → cognite_neat-0.75.9.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,116 @@
1
+ configs: []
2
+ description: null
3
+ implementation_module: null
4
+ name: Ontology to Data Model
5
+ steps:
6
+ - complex_configs: {}
7
+ configs: {}
8
+ description: null
9
+ enabled: true
10
+ id: step_trigger
11
+ label: Trigger
12
+ max_retries: 0
13
+ method: null
14
+ params: {}
15
+ retry_delay: 3
16
+ stype: http_trigger
17
+ system_component_id: null
18
+ transition_to:
19
+ - step_128344
20
+ - dowload_ontology
21
+ trigger: true
22
+ ui_config:
23
+ pos_x: 524
24
+ pos_y: 259
25
+ - complex_configs: {}
26
+ configs:
27
+ excel_file_path: rules/LIS-14-rules.xlsx
28
+ make_compliant: "True"
29
+ ontology_file_path: staging/LIS-14.ttl
30
+ description: null
31
+ enabled: true
32
+ id: onotology2rules
33
+ label: Import Ontology to Rules
34
+ max_retries: 0
35
+ method: ImportOntologyToRules
36
+ params: {}
37
+ retry_delay: 3
38
+ stype: stdstep
39
+ system_component_id: null
40
+ transition_to:
41
+ - load_generated_rules
42
+ - import_generated_rules
43
+ trigger: false
44
+ ui_config:
45
+ pos_x: 524
46
+ pos_y: 403
47
+ - complex_configs: {}
48
+ configs:
49
+ file_name: LIS-14-rules.xlsx
50
+ validation_report_file: rules_validation_report.txt
51
+ validation_report_storage_dir: rules_validation_report
52
+ version: ""
53
+ description: null
54
+ enabled: true
55
+ id: import_generated_rules
56
+ label: Import Generated Rules
57
+ max_retries: 0
58
+ method: ImportExcelToRules
59
+ params: {}
60
+ retry_delay: 3
61
+ stype: stdstep
62
+ system_component_id: null
63
+ transition_to:
64
+ - step_59017
65
+ - step_829062
66
+ - export_rules_to_graphql_schema
67
+ trigger: false
68
+ ui_config:
69
+ pos_x: 524
70
+ pos_y: 490
71
+ - complex_configs: {}
72
+ configs:
73
+ api_url: https://rds.posccaesar.org/ontology/lis14/ont/core/2.0/LIS-14.ttl
74
+ auth_mode: none
75
+ http_method: GET
76
+ output_file_path: staging/LIS-14.ttl
77
+ password: ""
78
+ response_destination: file
79
+ token: ""
80
+ username: ""
81
+ description: null
82
+ enabled: true
83
+ id: dowload_ontology
84
+ label: Download Ontology
85
+ max_retries: 0
86
+ method: DownloadDataFromRestApiToFile
87
+ params: {}
88
+ retry_delay: 3
89
+ stype: stdstep
90
+ system_component_id: null
91
+ transition_to:
92
+ - onotology2rules
93
+ trigger: false
94
+ ui_config:
95
+ pos_x: 524
96
+ pos_y: 333
97
+ - complex_configs: {}
98
+ configs:
99
+ file_name: ""
100
+ storage_dir: staging
101
+ description: null
102
+ enabled: true
103
+ id: export_rules_to_graphql_schema
104
+ label: Export Rules to GraphQL Schema
105
+ max_retries: 0
106
+ method: ExportRulesToGraphQLSchema
107
+ params: {}
108
+ retry_delay: 3
109
+ stype: stdstep
110
+ system_component_id: null
111
+ transition_to: []
112
+ trigger: false
113
+ ui_config:
114
+ pos_x: 525
115
+ pos_y: 577
116
+ system_components: []
@@ -0,0 +1,67 @@
1
+ configs: []
2
+ description: null
3
+ implementation_module: null
4
+ name: Validate Rules
5
+ steps:
6
+ - complex_configs: {}
7
+ configs:
8
+ File name: ''
9
+ Report formatter: BasicHTML
10
+ Role: infer
11
+ description: null
12
+ enabled: true
13
+ id: step_validate_rules
14
+ label: Validate Rules
15
+ max_retries: 0
16
+ method: ExcelToRules
17
+ params: {}
18
+ retry_delay: 3
19
+ stype: stdstep
20
+ system_component_id: null
21
+ transition_to:
22
+ - step_942973
23
+ - step_715590
24
+ trigger: false
25
+ ui_config:
26
+ pos_x: 558
27
+ pos_y: 97
28
+ - complex_configs: {}
29
+ configs: {}
30
+ description: null
31
+ enabled: true
32
+ id: step_upload_rules
33
+ label: Upload Rules Spreadsheets
34
+ max_retries: 0
35
+ method: null
36
+ params:
37
+ file_type: rules
38
+ retry_delay: 3
39
+ stype: file_uploader
40
+ system_component_id: null
41
+ transition_to:
42
+ - step_31642
43
+ - step_validate_rules
44
+ trigger: true
45
+ ui_config:
46
+ pos_x: 558
47
+ pos_y: -14
48
+ - complex_configs: {}
49
+ configs:
50
+ Output role format: input
51
+ Styling: default
52
+ description: null
53
+ enabled: true
54
+ id: step_715590
55
+ label: Convert Rules
56
+ max_retries: 0
57
+ method: RulesToExcel
58
+ params: {}
59
+ retry_delay: 3
60
+ stype: stdstep
61
+ system_component_id: null
62
+ transition_to: []
63
+ trigger: false
64
+ ui_config:
65
+ pos_x: 558
66
+ pos_y: 217
67
+ system_components: []
@@ -0,0 +1,64 @@
1
+ configs: []
2
+ description: null
3
+ implementation_module: null
4
+ name: Validate Solution Model
5
+ steps:
6
+ - complex_configs: {}
7
+ configs: {}
8
+ description: null
9
+ enabled: true
10
+ id: step_769298
11
+ label: Upload File
12
+ max_retries: 0
13
+ method: null
14
+ params:
15
+ file_type: rules
16
+ retry_delay: 3
17
+ stype: file_uploader
18
+ system_component_id: null
19
+ transition_to:
20
+ - step_399494
21
+ trigger: true
22
+ ui_config:
23
+ pos_x: 627
24
+ pos_y: -19
25
+ - complex_configs: {}
26
+ configs:
27
+ File name: ''
28
+ Report formatter: BasicHTML
29
+ Role: infer
30
+ description: null
31
+ enabled: true
32
+ id: step_399494
33
+ label: Import Excel
34
+ max_retries: 0
35
+ method: ExcelToRules
36
+ params: {}
37
+ retry_delay: 3
38
+ stype: stdstep
39
+ system_component_id: null
40
+ transition_to:
41
+ - step_273233
42
+ trigger: false
43
+ ui_config:
44
+ pos_x: 627
45
+ pos_y: 66
46
+ - complex_configs: {}
47
+ configs:
48
+ Report Formatter: BasicHTML
49
+ description: null
50
+ enabled: true
51
+ id: step_273233
52
+ label: Validate Against CDF
53
+ max_retries: 0
54
+ method: ValidateRulesAgainstCDF
55
+ params: {}
56
+ retry_delay: 3
57
+ stype: stdstep
58
+ system_component_id: null
59
+ transition_to: []
60
+ trigger: false
61
+ ui_config:
62
+ pos_x: 627
63
+ pos_y: 154
64
+ system_components: []
@@ -0,0 +1,95 @@
1
+ configs: []
2
+ description: null
3
+ implementation_module: null
4
+ name: Visualize Data Model Using Mock Graph
5
+ steps:
6
+ - complex_configs: {}
7
+ configs:
8
+ File name: information-architect-david.xlsx
9
+ Report formatter: BasicHTML
10
+ Role: infer
11
+ description: null
12
+ enabled: true
13
+ id: step_verify_rules
14
+ label: Verify Rules
15
+ max_retries: 0
16
+ method: ExcelToRules
17
+ params: {}
18
+ retry_delay: 3
19
+ stype: stdstep
20
+ system_component_id: null
21
+ transition_to:
22
+ - step_configure_graph_store
23
+ trigger: false
24
+ ui_config:
25
+ pos_x: 507
26
+ pos_y: 250
27
+ - complex_configs: {}
28
+ configs:
29
+ Disk storage directory: mock-graph-store
30
+ Graph: source
31
+ Graph store type: oxigraph
32
+ GraphDB API root URL: ""
33
+ Init procedure: reset
34
+ Query URL: ""
35
+ Update URL: ""
36
+ description: null
37
+ enabled: true
38
+ id: step_configure_graph_store
39
+ label: Configure Graph Store
40
+ max_retries: 0
41
+ method: GraphStoreConfiguration
42
+ params: {}
43
+ retry_delay: 3
44
+ stype: stdstep
45
+ system_component_id: null
46
+ transition_to:
47
+ - step_166101
48
+ - step_mock_graph_generation
49
+ trigger: false
50
+ ui_config:
51
+ pos_x: 506
52
+ pos_y: 314
53
+ - complex_configs: {}
54
+ configs:
55
+ Class count:
56
+ '{"WindTurbine" : 1, "WindFarm" : 1, "OffshoreSubstation" : 1,
57
+ "DistributionSubstation" : 1, "OnshoreSubstation" : 1, "ArrayCable" :
58
+ 1, "ExportCable" : 1, "Transmission" : 1, "DistributionLine" : 1, "Meter"
59
+ : 1, "ElectricCarCharger" : 1}'
60
+ Graph: source
61
+ description: null
62
+ enabled: true
63
+ id: step_mock_graph_generation
64
+ label: Generate Mock Graph
65
+ max_retries: 0
66
+ method: GraphFromMockData
67
+ params: {}
68
+ retry_delay: 3
69
+ stype: stdstep
70
+ system_component_id: null
71
+ transition_to: []
72
+ trigger: false
73
+ ui_config:
74
+ pos_x: 506
75
+ pos_y: 390
76
+ - complex_configs: {}
77
+ configs: {}
78
+ description: null
79
+ enabled: true
80
+ id: step_upload_rules
81
+ label: Upload Rules
82
+ max_retries: 0
83
+ method: null
84
+ params:
85
+ file_type: rules
86
+ retry_delay: 3
87
+ stype: file_uploader
88
+ system_component_id: null
89
+ transition_to:
90
+ - step_verify_rules
91
+ trigger: true
92
+ ui_config:
93
+ pos_x: 507
94
+ pos_y: 177
95
+ system_components: []
@@ -0,0 +1,111 @@
1
+ configs: []
2
+ description: null
3
+ implementation_module: null
4
+ name: Visualize Semantic Data Model
5
+ steps:
6
+ - complex_configs: {}
7
+ configs: {}
8
+ description: null
9
+ enabled: true
10
+ id: step_upload_excel_rules
11
+ label: Upload Excel Rules
12
+ max_retries: 0
13
+ method: null
14
+ params:
15
+ file_type: rules
16
+ retry_delay: 3
17
+ stype: file_uploader
18
+ system_component_id: null
19
+ transition_to:
20
+ - step_421523
21
+ - step_excel_to_rules
22
+ trigger: true
23
+ ui_config:
24
+ pos_x: 498
25
+ pos_y: 149
26
+ - complex_configs: {}
27
+ configs:
28
+ File name: ''
29
+ Report formatter: BasicHTML
30
+ Role: infer
31
+ description: null
32
+ enabled: true
33
+ id: step_excel_to_rules
34
+ label: Import and Validate Rules
35
+ max_retries: 0
36
+ method: ExcelToRules
37
+ params: {}
38
+ retry_delay: 3
39
+ stype: stdstep
40
+ system_component_id: null
41
+ transition_to:
42
+ - step_rules_to_ontology
43
+ trigger: false
44
+ ui_config:
45
+ pos_x: 497
46
+ pos_y: 234
47
+ - complex_configs: {}
48
+ configs:
49
+ File path: staging/semantic-data-model.ttl
50
+ description: null
51
+ enabled: true
52
+ id: step_rules_to_ontology
53
+ label: Rules to Ontology
54
+ max_retries: 0
55
+ method: RulesToSemanticDataModel
56
+ params: {}
57
+ retry_delay: 3
58
+ stype: stdstep
59
+ system_component_id: null
60
+ transition_to:
61
+ - step_configure_graph_store
62
+ trigger: false
63
+ ui_config:
64
+ pos_x: 497
65
+ pos_y: 323
66
+ - complex_configs: {}
67
+ configs:
68
+ Disk storage directory: semantic-data-model
69
+ Graph: source
70
+ Graph store type: oxigraph
71
+ GraphDB API root URL: ''
72
+ Init procedure: reset
73
+ Query URL: ''
74
+ Update URL: ''
75
+ description: null
76
+ enabled: true
77
+ id: step_configure_graph_store
78
+ label: Configure Graph Store
79
+ max_retries: 0
80
+ method: GraphStoreConfiguration
81
+ params: {}
82
+ retry_delay: 3
83
+ stype: stdstep
84
+ system_component_id: null
85
+ transition_to:
86
+ - step_load_semantic_data_model
87
+ trigger: false
88
+ ui_config:
89
+ pos_x: 495
90
+ pos_y: 399
91
+ - complex_configs: {}
92
+ configs:
93
+ Add base URI: 'False'
94
+ File path: staging/semantic-data-model.ttl
95
+ MIME type: text/turtle
96
+ description: null
97
+ enabled: true
98
+ id: step_load_semantic_data_model
99
+ label: Load Semantic Data Model
100
+ max_retries: 0
101
+ method: GraphFromRdfFile
102
+ params: {}
103
+ retry_delay: 3
104
+ stype: stdstep
105
+ system_component_id: null
106
+ transition_to: []
107
+ trigger: false
108
+ ui_config:
109
+ pos_x: 495
110
+ pos_y: 476
111
+ system_components: []
@@ -205,8 +205,8 @@ class ExcelExporter(BaseExporter[Workbook]):
205
205
 
206
206
  @classmethod
207
207
  def _adjust_column_widths(cls, workbook: Workbook) -> None:
208
- for sheet in workbook:
209
- sheet = cast(Worksheet, sheet)
208
+ for sheet_ in workbook:
209
+ sheet = cast(Worksheet, sheet_)
210
210
  for column_cells in sheet.columns:
211
211
  try:
212
212
  max_length = max(len(str(cell.value)) for cell in column_cells if cell.value is not None)
@@ -9,13 +9,13 @@ from cognite.neat.rules.models.rules._types._base import DMS_PROPERTY_ID_COMPLIA
9
9
 
10
10
 
11
11
  @overload
12
- def are_entity_names_dms_compliant(rules: InformationRules, return_report: Literal[True]) -> tuple[bool, list[dict]]:
13
- ...
12
+ def are_entity_names_dms_compliant(
13
+ rules: InformationRules, return_report: Literal[True]
14
+ ) -> tuple[bool, list[dict]]: ...
14
15
 
15
16
 
16
17
  @overload
17
- def are_entity_names_dms_compliant(rules: InformationRules, return_report: Literal[False] = False) -> bool:
18
- ...
18
+ def are_entity_names_dms_compliant(rules: InformationRules, return_report: Literal[False] = False) -> bool: ...
19
19
 
20
20
 
21
21
  def are_entity_names_dms_compliant(
@@ -66,13 +66,11 @@ def are_entity_names_dms_compliant(
66
66
 
67
67
 
68
68
  @overload
69
- def are_properties_redefined(rules: InformationRules, return_report: Literal[True]) -> tuple[bool, list[dict]]:
70
- ...
69
+ def are_properties_redefined(rules: InformationRules, return_report: Literal[True]) -> tuple[bool, list[dict]]: ...
71
70
 
72
71
 
73
72
  @overload
74
- def are_properties_redefined(rules: InformationRules, return_report: Literal[False] = False) -> bool:
75
- ...
73
+ def are_properties_redefined(rules: InformationRules, return_report: Literal[False] = False) -> bool: ...
76
74
 
77
75
 
78
76
  def are_properties_redefined(rules: InformationRules, return_report: bool = False) -> bool | tuple[bool, list[dict]]:
@@ -20,14 +20,12 @@ class BaseImporter(ABC):
20
20
  """
21
21
 
22
22
  @overload
23
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
24
- ...
23
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules: ...
25
24
 
26
25
  @overload
27
26
  def to_rules(
28
27
  self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
29
- ) -> tuple[Rules | None, IssueList]:
30
- ...
28
+ ) -> tuple[Rules | None, IssueList]: ...
31
29
 
32
30
  @abstractmethod
33
31
  def to_rules(
@@ -81,14 +81,12 @@ class DMSImporter(BaseImporter):
81
81
  return cls(DMSSchema.from_zip(zip_file))
82
82
 
83
83
  @overload
84
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
85
- ...
84
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules: ...
86
85
 
87
86
  @overload
88
87
  def to_rules(
89
88
  self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
90
- ) -> tuple[Rules | None, IssueList]:
91
- ...
89
+ ) -> tuple[Rules | None, IssueList]: ...
92
90
 
93
91
  def to_rules(
94
92
  self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
@@ -119,14 +119,12 @@ class DTDLImporter(BaseImporter):
119
119
  return cls(items, zip_file.stem, read_issues=issues)
120
120
 
121
121
  @overload
122
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
123
- ...
122
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules: ...
124
123
 
125
124
  @overload
126
125
  def to_rules(
127
126
  self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
128
- ) -> tuple[Rules | None, IssueList]:
129
- ...
127
+ ) -> tuple[Rules | None, IssueList]: ...
130
128
 
131
129
  def to_rules(
132
130
  self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
@@ -72,8 +72,7 @@ class DTMI(BaseModel):
72
72
  exclude_none: bool = False,
73
73
  round_trip: bool = False,
74
74
  warnings: bool = True,
75
- ) -> str:
76
- ...
75
+ ) -> str: ...
77
76
 
78
77
 
79
78
  IRI: TypeAlias = str
@@ -124,8 +123,7 @@ class Unit(BaseModel, ABC):
124
123
  exclude_none: bool = False,
125
124
  round_trip: bool = False,
126
125
  warnings: bool = True,
127
- ) -> str:
128
- ...
126
+ ) -> str: ...
129
127
 
130
128
 
131
129
  class DTDLBase(BaseModel, ABC):
@@ -43,14 +43,12 @@ class OWLImporter(BaseImporter):
43
43
  self.make_compliant = make_compliant
44
44
 
45
45
  @overload
46
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
47
- ...
46
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules: ...
48
47
 
49
48
  @overload
50
49
  def to_rules(
51
50
  self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
52
- ) -> tuple[Rules | None, IssueList]:
53
- ...
51
+ ) -> tuple[Rules | None, IssueList]: ...
54
52
 
55
53
  def to_rules(
56
54
  self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
@@ -153,16 +153,14 @@ class ExcelImporter(BaseImporter):
153
153
  self.filepath = filepath
154
154
 
155
155
  @overload
156
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
157
- ...
156
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules: ...
158
157
 
159
158
  @overload
160
159
  def to_rules(
161
160
  self,
162
161
  errors: Literal["continue"] = "continue",
163
162
  role: RoleTypes | None = None,
164
- ) -> tuple[Rules | None, IssueList]:
165
- ...
163
+ ) -> tuple[Rules | None, IssueList]: ...
166
164
 
167
165
  def to_rules(
168
166
  self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
@@ -244,14 +242,12 @@ class GoogleSheetImporter(BaseImporter):
244
242
  self.skiprows = skiprows
245
243
 
246
244
  @overload
247
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
248
- ...
245
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules: ...
249
246
 
250
247
  @overload
251
248
  def to_rules(
252
249
  self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
253
- ) -> tuple[Rules | None, IssueList]:
254
- ...
250
+ ) -> tuple[Rules | None, IssueList]: ...
255
251
 
256
252
  def to_rules(
257
253
  self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
@@ -46,14 +46,12 @@ class YAMLImporter(BaseImporter):
46
46
  return cls(yaml.safe_load(filepath.read_text()), filepaths=[filepath])
47
47
 
48
48
  @overload
49
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
50
- ...
49
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules: ...
51
50
 
52
51
  @overload
53
52
  def to_rules(
54
53
  self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
55
- ) -> tuple[Rules | None, IssueList]:
56
- ...
54
+ ) -> tuple[Rules | None, IssueList]: ...
57
55
 
58
56
  def to_rules(
59
57
  self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
@@ -32,13 +32,11 @@ __all__ = [
32
32
 
33
33
 
34
34
  @dataclass(frozen=True)
35
- class DMSSchemaError(NeatValidationError, ABC):
36
- ...
35
+ class DMSSchemaError(NeatValidationError, ABC): ...
37
36
 
38
37
 
39
38
  @dataclass(frozen=True)
40
- class DMSSchemaWarning(ValidationWarning, ABC):
41
- ...
39
+ class DMSSchemaWarning(ValidationWarning, ABC): ...
42
40
 
43
41
 
44
42
  @dataclass(frozen=True)
@@ -79,5 +79,7 @@ class BasicHTML(Formatter):
79
79
 
80
80
 
81
81
  FORMATTER_BY_NAME: dict[str, type[Formatter]] = {
82
- subclass.__name__: subclass for subclass in Formatter.__subclasses__() if ABC not in subclass.__bases__ # type: ignore[type-abstract]
82
+ subclass.__name__: subclass # type: ignore[type-abstract]
83
+ for subclass in Formatter.__subclasses__()
84
+ if ABC not in subclass.__bases__ # type: ignore[type-abstract]
83
85
  }
@@ -57,8 +57,7 @@ _PROPERTY_ID_REGEX = rf"\((?P<{EntityTypes.property_}>{_ENTITY_ID_REGEX})\)"
57
57
  _ENTITY_PATTERN = re.compile(r"^(?P<prefix>.*?):?(?P<suffix>[^(:]*)(\((?P<content>[^)]+)\))?$")
58
58
 
59
59
 
60
- class _UndefinedType(BaseModel):
61
- ...
60
+ class _UndefinedType(BaseModel): ...
62
61
 
63
62
 
64
63
  class _UnknownType(BaseModel):
@@ -1,5 +1,4 @@
1
- """
2
- """
1
+ """ """
3
2
 
4
3
  import re
5
4
  import sys