otlmow-template 0.5__py3-none-any.whl → 0.6__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.
- otlmow_template/SubsetTemplateCreator.py +8 -3
- {otlmow_template-0.5.dist-info → otlmow_template-0.6.dist-info}/METADATA +1 -1
- {otlmow_template-0.5.dist-info → otlmow_template-0.6.dist-info}/RECORD +6 -6
- {otlmow_template-0.5.dist-info → otlmow_template-0.6.dist-info}/LICENSE +0 -0
- {otlmow_template-0.5.dist-info → otlmow_template-0.6.dist-info}/WHEEL +0 -0
- {otlmow_template-0.5.dist-info → otlmow_template-0.6.dist-info}/top_level.txt +0 -0
|
@@ -19,6 +19,7 @@ from otlmow_model.OtlmowModel.BaseClasses.KeuzelijstField import KeuzelijstField
|
|
|
19
19
|
from otlmow_model.OtlmowModel.BaseClasses.OTLObject import dynamic_create_instance_from_uri
|
|
20
20
|
from otlmow_model.OtlmowModel.Helpers.generated_lists import get_hardcoded_relation_dict
|
|
21
21
|
from otlmow_modelbuilder.OSLOCollector import OSLOCollector
|
|
22
|
+
from otlmow_modelbuilder.SQLDataClasses.OSLOClass import OSLOClass
|
|
22
23
|
|
|
23
24
|
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
|
24
25
|
|
|
@@ -64,7 +65,11 @@ class SubsetTemplateCreator:
|
|
|
64
65
|
|
|
65
66
|
def generate_basic_template(self, path_to_subset: Path, path_to_template_file_and_extension: Path,
|
|
66
67
|
temporary_path: Path, ignore_relations: bool = True, **kwargs):
|
|
67
|
-
|
|
68
|
+
list_of_otl_objectUri = None
|
|
69
|
+
if kwargs is not None:
|
|
70
|
+
list_of_otl_objectUri = kwargs.get('list_of_otl_objectUri', None)
|
|
71
|
+
filtered_class_list = self.filters_classes_by_subset(
|
|
72
|
+
path_to_subset=path_to_subset, list_of_otl_objectUri=list_of_otl_objectUri)
|
|
68
73
|
otl_objects = []
|
|
69
74
|
amount_of_examples = kwargs.get('amount_of_examples', 0)
|
|
70
75
|
model_directory = None
|
|
@@ -72,7 +77,7 @@ class SubsetTemplateCreator:
|
|
|
72
77
|
model_directory = kwargs.get('model_directory', None)
|
|
73
78
|
relation_dict = get_hardcoded_relation_dict(model_directory=model_directory)
|
|
74
79
|
|
|
75
|
-
for class_object in
|
|
80
|
+
for class_object in [cl for cl in filtered_class_list if cl.abstract == 0]:
|
|
76
81
|
if ignore_relations and class_object.objectUri in relation_dict:
|
|
77
82
|
continue
|
|
78
83
|
|
|
@@ -145,7 +150,7 @@ class SubsetTemplateCreator:
|
|
|
145
150
|
[f.unlink() for f in Path(file_location).glob("*") if f.is_file()]
|
|
146
151
|
|
|
147
152
|
@classmethod
|
|
148
|
-
def
|
|
153
|
+
def filters_classes_by_subset(cls, path_to_subset: Path, list_of_otl_objectUri: [str] = None) -> list[OSLOClass]:
|
|
149
154
|
if list_of_otl_objectUri is None:
|
|
150
155
|
list_of_otl_objectUri = []
|
|
151
156
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
otlmow_template/CsvTemplateCreator.py,sha256=PQq2zGmliWk0N9bhYNB7ZEa8PWV16OTbvoHh3--qCMs,7538
|
|
2
2
|
otlmow_template/ExcelTemplateCreator.py,sha256=wW-7Uq2Gzr1vHYMO1I7TtqZSBTVFFSWotHvjwzCelV4,10853
|
|
3
|
-
otlmow_template/SubsetTemplateCreator.py,sha256=
|
|
3
|
+
otlmow_template/SubsetTemplateCreator.py,sha256=VGpl6RWjSxi5t2HvaOCW5awgToP1lZErv4SsqSdI-FE,24731
|
|
4
4
|
otlmow_template/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
otlmow_template/Exceptions/MissingTypeUriException.py,sha256=DSKwywmP9Bq8n7rzBoDcEPlxvC1IChx18QIHFUCTtdA,51
|
|
6
|
-
otlmow_template-0.
|
|
7
|
-
otlmow_template-0.
|
|
8
|
-
otlmow_template-0.
|
|
9
|
-
otlmow_template-0.
|
|
10
|
-
otlmow_template-0.
|
|
6
|
+
otlmow_template-0.6.dist-info/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
|
7
|
+
otlmow_template-0.6.dist-info/METADATA,sha256=bdqoC44BK1kiQkExkqOFwj7uwk6tDqUzk2nlKSoevDI,44000
|
|
8
|
+
otlmow_template-0.6.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
9
|
+
otlmow_template-0.6.dist-info/top_level.txt,sha256=zPgBoaTLG-avoOLySlwOUEtHaFyA5Vc5wJqkSeX1l6A,16
|
|
10
|
+
otlmow_template-0.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|