mapping-suite-sdk 0.1.0__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 mapping-suite-sdk might be problematic. Click here for more details.

File without changes
File without changes
@@ -0,0 +1,141 @@
1
+ import tempfile
2
+ import zipfile
3
+ from contextlib import contextmanager
4
+ from pathlib import Path
5
+ from typing import Generator, Protocol
6
+
7
+
8
+ class Extractor(Protocol):
9
+ """Protocol defining the interface for file extract operations.
10
+
11
+ This protocol establishes a contract for classes that provide temporary file
12
+ extraction capabilities with automatic cleanup. Implementations must provide
13
+ a context manager that handles the extraction process and cleanup.
14
+ """
15
+
16
+ @staticmethod
17
+ @contextmanager
18
+ def extract_temporary(source_path: Path) -> Generator[Path, None, None]:
19
+ """Extract content to a temporary directory and yield its path.
20
+
21
+ This context manager should handle the extraction of files to a temporary
22
+ location and ensure proper cleanup after use.
23
+
24
+ Args:
25
+ source_path: Path to the source file to extract
26
+
27
+ Yields:
28
+ Path: Path to the temporary directory containing the extracted contents
29
+
30
+ Raises:
31
+ NotImplementedError: When the method is not implemented by a concrete class
32
+ """
33
+ raise NotImplementedError
34
+
35
+
36
+ class ArchiveExtractor(Extractor):
37
+ """Implementation of Extractor protocol for ZIP file operations.
38
+
39
+ This class provides functionality to:
40
+ - Extract ZIP files to a temporary directory with automatic cleanup
41
+ - Pack directories into ZIP files without including the root directory name
42
+ """
43
+
44
+ @staticmethod
45
+ @contextmanager
46
+ def extract_temporary(archive_path: Path) -> Generator[Path, None, None]:
47
+ """Extract a ZIP archive to a temporary directory and yield its path.
48
+
49
+ This context manager handles the extraction of ZIP files to a temporary
50
+ location and ensures proper cleanup after use.
51
+
52
+ Args:
53
+ archive_path: Path to the ZIP file to extract
54
+
55
+ Yields:
56
+ Path: Path to the temporary directory containing the extracted contents
57
+
58
+ Raises:
59
+ FileNotFoundError: If the archive file doesn't exist
60
+ ValueError: If the path is not a file
61
+ zipfile.BadZipFile: If the file is not a valid ZIP archive
62
+
63
+ Example:
64
+ >>> from pathlib import Path
65
+ >>> archive_path = Path("example.zip")
66
+ >>> with ArchiveExtractor.extract_temporary(archive_path) as temp_path:
67
+ ... # Work with extracted files in temp_path
68
+ ... pass # Cleanup is automatic after the with block
69
+ """
70
+ if not archive_path.exists():
71
+ raise FileNotFoundError(f"ZIP file not found: {archive_path}")
72
+
73
+ if not archive_path.is_file():
74
+ raise ValueError(f"Specified path is not a file: {archive_path}")
75
+
76
+ with tempfile.TemporaryDirectory() as temp_dir:
77
+ temp_dir_path = Path(temp_dir)
78
+
79
+ try:
80
+ with zipfile.ZipFile(archive_path) as zip_ref:
81
+ zip_ref.extractall(temp_dir_path)
82
+ yield temp_dir_path
83
+
84
+ except Exception as e:
85
+ raise ValueError(f"Failed to extract ZIP file: {e}")
86
+
87
+ @staticmethod
88
+ def pack_directory(source_dir: Path, output_path: Path) -> Path:
89
+ """Pack a directory's contents into a ZIP file without including the root directory name.
90
+
91
+ Creates a ZIP file containing the contents of the specified directory.
92
+ Files and subdirectories will be packed without the root directory name.
93
+ For example, if packing a directory 'my_folder' containing 'file1.txt' and
94
+ 'subfolder/file2.txt', the ZIP will contain 'file1.txt' and 'subfolder/file2.txt'
95
+ directly, without 'my_folder' at the start.
96
+
97
+ Args:
98
+ source_dir: Path to the directory to pack
99
+ output_path: Path where the ZIP file should be created.
100
+ If it doesn't end with '.zip', the extension will be added.
101
+
102
+ Returns:
103
+ Path: Path to the created ZIP file
104
+
105
+ Raises:
106
+ FileNotFoundError: If the source directory doesn't exist
107
+ ValueError: If the source is not a directory or if ZIP creation fails
108
+
109
+ Example:
110
+ >>> from pathlib import Path
111
+ >>> source_dir = Path("folder_to_archive")
112
+ >>> output_path = Path("output/archive")
113
+ >>> zip_path = ArchiveExtractor.pack_directory(source_dir, output_path)
114
+ """
115
+ if not source_dir.exists():
116
+ raise FileNotFoundError(f"Source directory not found: {source_dir}")
117
+
118
+ if not source_dir.is_dir():
119
+ raise ValueError(f"Specified path is not a directory: {source_dir}")
120
+
121
+ # Ensure the output directory exists
122
+ output_path.parent.mkdir(parents=True, exist_ok=True)
123
+
124
+ # Ensure the output path has .zip extension
125
+ if not str(output_path).endswith('.zip'):
126
+ output_path = output_path.with_suffix('.zip')
127
+
128
+ try:
129
+ with zipfile.ZipFile(output_path, 'w', zipfile.ZIP_DEFLATED) as zip_ref:
130
+ # Get all files in the directory
131
+ for file_path in source_dir.rglob('*'):
132
+ if file_path.is_file(): # Skip directories, they're created automatically
133
+ # Calculate the path relative to the source directory
134
+ relative_path = file_path.relative_to(source_dir)
135
+ # Add the file to the ZIP with the relative path as its name
136
+ zip_ref.write(file_path, relative_path)
137
+
138
+ return output_path
139
+
140
+ except Exception as e:
141
+ raise ValueError(f"Failed to create ZIP file: {e}")
@@ -0,0 +1,296 @@
1
+ from pathlib import Path
2
+ from typing import Any, List, Protocol
3
+
4
+ from pydantic import TypeAdapter
5
+
6
+ from mapping_suite_sdk.models.asset import TechnicalMappingSuite, VocabularyMappingSuite, TestDataSuite, \
7
+ SAPRQLTestSuite, SHACLTestSuite, TestResultSuite, RMLMappingAsset, \
8
+ ConceptualMappingPackageAsset, VocabularyMappingAsset, TestDataAsset, SPARQLQueryAsset, SHACLShapesAsset
9
+ from mapping_suite_sdk.models.mapping_package import MappingPackage, MappingPackageMetadata, MappingPackageIndex
10
+
11
+ ### Paths relative to mapping package
12
+ RELATIVE_TECHNICAL_MAPPING_SUITE_PATH = Path("transformation/mappings")
13
+ RELATIVE_VOCABULARY_MAPPING_SUITE_PATH = Path("transformation/resources")
14
+ RELATIVE_TEST_DATA_PATH = Path("test_data")
15
+ RELATIVE_SPARQL_SUITE_PATH = Path("validation/sparql")
16
+ RELATIVE_SHACL_SUITE_PATH = Path("validation/shacl")
17
+ RELATIVE_SUITE_METADATA_PATH = Path("metadata.json")
18
+ RELATIVE_CONCEPTUAL_MAPPING_PATH = Path("transformation/conceptual_mappings.xlsx")
19
+
20
+
21
+ class MappingPackageAssetLoader(Protocol):
22
+ """Protocol defining the interface for mapping package asset loaders.
23
+
24
+ This protocol ensures that all asset loaders implement a consistent interface
25
+ for loading different components of a mapping package.
26
+ """
27
+
28
+ def load(self, package_folder_path: Path) -> Any:
29
+ """Load an asset from the specified package folder path.
30
+
31
+ Args:
32
+ package_folder_path (Path): Path to the mapping package folder.
33
+
34
+ Returns:
35
+ Any: The loaded asset.
36
+
37
+ Raises:
38
+ NotImplementedError: When the method is not implemented by a concrete class.
39
+ """
40
+ raise NotImplementedError
41
+
42
+
43
+ class TechnicalMappingSuiteLoader(MappingPackageAssetLoader):
44
+ """Loader for technical mapping suite files.
45
+
46
+ Handles loading of RML and YARRRML mapping files from the technical mapping suite directory.
47
+ """
48
+
49
+ def load(self, package_folder_path: Path) -> TechnicalMappingSuite:
50
+ """Load technical mapping files from the package.
51
+
52
+ Args:
53
+ package_folder_path (Path): Path to the mapping package folder.
54
+
55
+ Returns:
56
+ TechnicalMappingSuite: Collection of loaded RML and YARRRML mapping files.
57
+ """
58
+ tm_files: List[RMLMappingAsset] = []
59
+
60
+ for tm_file in (package_folder_path / RELATIVE_TECHNICAL_MAPPING_SUITE_PATH).iterdir():
61
+ if tm_file.is_file():
62
+ tm_files.append(
63
+ RMLMappingAsset(path=tm_file.relative_to(package_folder_path), content=tm_file.read_text()))
64
+
65
+ return TechnicalMappingSuite(path=RELATIVE_TECHNICAL_MAPPING_SUITE_PATH, files=tm_files)
66
+
67
+
68
+ class VocabularyMappingSuiteLoader(MappingPackageAssetLoader):
69
+ """Loader for vocabulary mapping suite files.
70
+
71
+ Loads vocabulary mapping files that define term mappings and transformations.
72
+ """
73
+
74
+ def load(self, package_folder_path: Path) -> VocabularyMappingSuite:
75
+ """Load vocabulary mapping files from the package.
76
+
77
+ Args:
78
+ package_folder_path (Path): Path to the mapping package folder.
79
+
80
+ Returns:
81
+ VocabularyMappingSuite: Collection of loaded vocabulary mapping files.
82
+ """
83
+ files: List[VocabularyMappingAsset] = []
84
+
85
+ for file in (package_folder_path / RELATIVE_VOCABULARY_MAPPING_SUITE_PATH).iterdir():
86
+ if file.is_file():
87
+ files.append(
88
+ VocabularyMappingAsset(path=file.relative_to(package_folder_path), content=file.read_text()))
89
+
90
+ return VocabularyMappingSuite(path=RELATIVE_VOCABULARY_MAPPING_SUITE_PATH, files=files)
91
+
92
+
93
+ class TestDataSuitesLoader(MappingPackageAssetLoader):
94
+ """Loader for test data suites.
95
+
96
+ Handles loading of test data files organized in test suites.
97
+ """
98
+
99
+ def load(self, package_folder_path: Path) -> List[TestDataSuite]:
100
+ """Load test data suites from the package.
101
+
102
+ Args:
103
+ package_folder_path (Path): Path to the mapping package folder.
104
+
105
+ Returns:
106
+ List[TestDataSuite]: List of test data suites, each containing test files.
107
+ """
108
+ test_data_suites: List[TestDataSuite] = []
109
+ for ts_suite in (package_folder_path / RELATIVE_TEST_DATA_PATH).iterdir():
110
+ if ts_suite.is_dir():
111
+ test_data_suites.append(TestDataSuite(path=ts_suite.relative_to(package_folder_path),
112
+ files=[TestDataAsset(path=ts_file.relative_to(package_folder_path),
113
+ content=ts_file.read_text()) for ts_file in
114
+ ts_suite.iterdir() if ts_file.is_file()]))
115
+ return test_data_suites
116
+
117
+
118
+ class SPARQLTestSuitesLoader(MappingPackageAssetLoader):
119
+ """Loader for SPARQL test suites.
120
+
121
+ Handles loading of SPARQL query files organized in validation suites.
122
+ """
123
+
124
+ def load(self, package_folder_path: Path) -> List[SAPRQLTestSuite]:
125
+ """Load SPARQL validation suites from the package.
126
+
127
+ Args:
128
+ package_folder_path (Path): Path to the mapping package folder.
129
+
130
+ Returns:
131
+ List[SAPRQLTestSuite]: List of SPARQL validation suites.
132
+ """
133
+ sparql_validation_suites: List[SAPRQLTestSuite] = []
134
+ for sparql_suite in (package_folder_path / RELATIVE_SPARQL_SUITE_PATH).iterdir():
135
+ if sparql_suite.is_dir():
136
+ sparql_validation_suites.append(SAPRQLTestSuite(path=sparql_suite.relative_to(package_folder_path),
137
+ files=[SPARQLQueryAsset(
138
+ path=ts_file.relative_to(package_folder_path),
139
+ content=ts_file.read_text()) for ts_file
140
+ in
141
+ sparql_suite.iterdir() if ts_file.is_file()]))
142
+ return sparql_validation_suites
143
+
144
+
145
+ class SHACLTestSuitesLoader(MappingPackageAssetLoader):
146
+ """Loader for SHACL test suites.
147
+
148
+ Handles loading of SHACL shape files organized in validation suites.
149
+ """
150
+
151
+ def load(self, package_folder_path: Path) -> List[SHACLTestSuite]:
152
+ """Load SHACL validation suites from the package.
153
+
154
+ Args:
155
+ package_folder_path (Path): Path to the mapping package folder.
156
+
157
+ Returns:
158
+ List[SHACLTestSuite]: List of SHACL validation suites.
159
+ """
160
+ shacl_validation_suites: List[SHACLTestSuite] = []
161
+ for shacl_suite in (package_folder_path / RELATIVE_SHACL_SUITE_PATH).iterdir():
162
+ if shacl_suite.is_dir():
163
+ shacl_validation_suites.append(SHACLTestSuite(path=shacl_suite.relative_to(package_folder_path),
164
+ files=[SHACLShapesAsset(
165
+ path=ts_file.relative_to(package_folder_path),
166
+ content=ts_file.read_text()) for ts_file
167
+ in
168
+ shacl_suite.iterdir() if ts_file.is_file()]))
169
+ return shacl_validation_suites
170
+
171
+
172
+ class MappingPackageMetadataLoader(MappingPackageAssetLoader):
173
+ """Loader for mapping package metadata.
174
+
175
+ Handles loading and parsing of the package metadata JSON file.
176
+ """
177
+
178
+ def load(self, package_folder_path: Path) -> MappingPackageMetadata:
179
+ """Load metadata from the package's metadata.json file.
180
+
181
+ Args:
182
+ package_folder_path (Path): Path to the mapping package folder.
183
+
184
+ Returns:
185
+ MappingPackageMetadata: Parsed metadata object.
186
+ """
187
+ metadata_file_path: Path = package_folder_path / RELATIVE_SUITE_METADATA_PATH
188
+ return TypeAdapter(MappingPackageMetadata).validate_json(metadata_file_path.read_text())
189
+
190
+
191
+ class MappingPackageIndexLoader(MappingPackageAssetLoader):
192
+ """Loader for mapping package index.
193
+
194
+ [Not implemented] Handles loading of package index information.
195
+ """
196
+
197
+ def load(self, package_folder_path: Path) -> MappingPackageIndex:
198
+ """Load the mapping package index.
199
+
200
+ Args:
201
+ package_folder_path (Path): Path to the mapping package folder.
202
+
203
+ Returns:
204
+ MappingPackageIndex: The loaded package index.
205
+
206
+ Raises:
207
+ NotImplementedError: This loader is not yet implemented.
208
+ """
209
+ raise NotImplementedError
210
+
211
+
212
+ class TestResultSuiteLoader(MappingPackageAssetLoader):
213
+ """Loader for test result suite.
214
+
215
+ [Not implemented] Handles loading of test execution results.
216
+ """
217
+
218
+ def load(self, package_folder_path: Path) -> TestResultSuite:
219
+ """Load test result suite.
220
+
221
+ Args:
222
+ package_folder_path (Path): Path to the mapping package folder.
223
+
224
+ Returns:
225
+ TestResultSuite: The loaded test results.
226
+
227
+ Raises:
228
+ NotImplementedError: This loader is not yet implemented.
229
+ """
230
+ raise NotImplementedError
231
+
232
+
233
+ class ConceptualMappingFileLoader(MappingPackageAssetLoader):
234
+ """Loader for conceptual mapping files.
235
+
236
+ Handles loading of conceptual mapping Excel files.
237
+ """
238
+
239
+ def load(self, package_folder_path: Path) -> ConceptualMappingPackageAsset:
240
+ """Load the conceptual mapping Excel file.
241
+
242
+ Args:
243
+ package_folder_path (Path): Path to the mapping package folder.
244
+
245
+ Returns:
246
+ ConceptualMappingPackageAsset: The loaded conceptual mapping file.
247
+ """
248
+ cm_file_path: Path = package_folder_path / RELATIVE_CONCEPTUAL_MAPPING_PATH
249
+
250
+ return ConceptualMappingPackageAsset(
251
+ path=RELATIVE_CONCEPTUAL_MAPPING_PATH,
252
+ content=cm_file_path.read_bytes()
253
+ )
254
+
255
+
256
+ class MappingPackageLoader(MappingPackageAssetLoader):
257
+ """Main loader for complete mapping packages.
258
+
259
+ Coordinates the loading of all components of a mapping package using specialized loaders.
260
+ """
261
+
262
+ def load(self, package_folder_path: Path) -> MappingPackage:
263
+ """Load all components of a mapping package.
264
+
265
+ This method orchestrates the loading of:
266
+ - Package metadata
267
+ - Conceptual mapping file
268
+ - Technical mapping suite
269
+ - Vocabulary mapping suite
270
+ - Test data suites
271
+ - SPARQL test suites
272
+ - SHACL test suites
273
+
274
+ Args:
275
+ package_folder_path (Path): Path to the mapping package folder.
276
+
277
+ Returns:
278
+ MappingPackage: Complete mapping package with all loaded components.
279
+ """
280
+ metadata = MappingPackageMetadataLoader().load(package_folder_path)
281
+ conceptual_mapping_file = ConceptualMappingFileLoader().load(package_folder_path)
282
+ technical_mapping_suite = TechnicalMappingSuiteLoader().load(package_folder_path)
283
+ vocabulary_mapping_suite = VocabularyMappingSuiteLoader().load(package_folder_path)
284
+ test_data_suites = TestDataSuitesLoader().load(package_folder_path)
285
+ test_suites_sparql = SPARQLTestSuitesLoader().load(package_folder_path)
286
+ test_suites_shacl = SHACLTestSuitesLoader().load(package_folder_path)
287
+
288
+ return MappingPackage(
289
+ metadata=metadata,
290
+ conceptual_mapping_file=conceptual_mapping_file,
291
+ technical_mapping_suite=technical_mapping_suite,
292
+ vocabulary_mapping_suite=vocabulary_mapping_suite,
293
+ test_data_suites=test_data_suites,
294
+ test_suites_sparql=test_suites_sparql,
295
+ test_suites_shacl=test_suites_shacl
296
+ )
@@ -0,0 +1,146 @@
1
+ from pathlib import Path
2
+ from typing import Any, List, Protocol
3
+
4
+ from mapping_suite_sdk.adapters.loader import RELATIVE_TECHNICAL_MAPPING_SUITE_PATH, RELATIVE_VOCABULARY_MAPPING_SUITE_PATH, \
5
+ RELATIVE_SUITE_METADATA_PATH, RELATIVE_CONCEPTUAL_MAPPING_PATH
6
+ from mapping_suite_sdk.models.asset import (
7
+ TechnicalMappingSuite, VocabularyMappingSuite, TestDataSuite,
8
+ SAPRQLTestSuite, SHACLTestSuite, ConceptualMappingPackageAsset
9
+ )
10
+ from mapping_suite_sdk.models.mapping_package import MappingPackage, MappingPackageMetadata
11
+
12
+
13
+ class MappingPackageAssetSerialiser(Protocol):
14
+ """Protocol defining the interface for mapping package asset serialisers.
15
+
16
+ This protocol ensures that all asset serialisers implement a consistent interface
17
+ for serializing different components of a mapping package.
18
+ """
19
+
20
+ def serialize(self, package_folder_path: Path, asset: Any) -> None:
21
+ """Serialize an asset to the specified package folder path.
22
+
23
+ Args:
24
+ package_folder_path (Path): Path to the mapping package folder.
25
+ asset (Any): The asset to serialize.
26
+
27
+ Raises:
28
+ NotImplementedError: When the method is not implemented by a concrete class.
29
+ """
30
+ raise NotImplementedError
31
+
32
+
33
+ class TechnicalMappingSuiteSerialiser(MappingPackageAssetSerialiser):
34
+ """Serialiser for technical mapping suite files."""
35
+
36
+ def serialize(self, package_folder_path: Path, asset: TechnicalMappingSuite) -> None:
37
+ suite_path = package_folder_path / RELATIVE_TECHNICAL_MAPPING_SUITE_PATH
38
+ suite_path.mkdir(parents=True, exist_ok=True)
39
+
40
+ for tm_file in asset.files:
41
+ file_path = package_folder_path / tm_file.path
42
+ file_path.parent.mkdir(parents=True, exist_ok=True)
43
+ file_path.write_text(tm_file.content)
44
+
45
+
46
+ class VocabularyMappingSuiteSerialiser(MappingPackageAssetSerialiser):
47
+ """Serialiser for vocabulary mapping suite files."""
48
+
49
+ def serialize(self, package_folder_path: Path, asset: VocabularyMappingSuite) -> None:
50
+ suite_path = package_folder_path / RELATIVE_VOCABULARY_MAPPING_SUITE_PATH
51
+ suite_path.mkdir(parents=True, exist_ok=True)
52
+
53
+ for vm_file in asset.files:
54
+ file_path = package_folder_path / vm_file.path
55
+ file_path.parent.mkdir(parents=True, exist_ok=True)
56
+ file_path.write_text(vm_file.content)
57
+
58
+
59
+ class TestDataSuitesSerialiser(MappingPackageAssetSerialiser):
60
+ """Serialiser for test data suites."""
61
+
62
+ def serialize(self, package_folder_path: Path, asset: List[TestDataSuite]) -> None:
63
+ for suite in asset:
64
+ suite_path = package_folder_path / suite.path
65
+ suite_path.mkdir(parents=True, exist_ok=True)
66
+
67
+ for test_file in suite.files:
68
+ file_path = package_folder_path / test_file.path
69
+ file_path.parent.mkdir(parents=True, exist_ok=True)
70
+ file_path.write_text(test_file.content)
71
+
72
+
73
+ class SPARQLTestSuitesSerialiser(MappingPackageAssetSerialiser):
74
+ """Serialiser for SPARQL test suites."""
75
+
76
+ def serialize(self, package_folder_path: Path, asset: List[SAPRQLTestSuite]) -> None:
77
+ for suite in asset:
78
+ suite_path = package_folder_path / suite.path
79
+ suite_path.mkdir(parents=True, exist_ok=True)
80
+
81
+ for query_file in suite.files:
82
+ file_path = package_folder_path / query_file.path
83
+ file_path.parent.mkdir(parents=True, exist_ok=True)
84
+ file_path.write_text(query_file.content)
85
+
86
+
87
+ class SHACLTestSuitesSerialiser(MappingPackageAssetSerialiser):
88
+ """Serialiser for SHACL test suites."""
89
+
90
+ def serialize(self, package_folder_path: Path, asset: List[SHACLTestSuite]) -> None:
91
+ for suite in asset:
92
+ suite_path = package_folder_path / suite.path
93
+ suite_path.mkdir(parents=True, exist_ok=True)
94
+
95
+ for shape_file in suite.files:
96
+ file_path = package_folder_path / shape_file.path
97
+ file_path.parent.mkdir(parents=True, exist_ok=True)
98
+ file_path.write_text(shape_file.content)
99
+
100
+
101
+ class MappingPackageMetadataSerialiser(MappingPackageAssetSerialiser):
102
+ """Serialiser for mapping package metadata."""
103
+
104
+ def serialize(self, package_folder_path: Path, asset: MappingPackageMetadata) -> None:
105
+ metadata_path = package_folder_path / RELATIVE_SUITE_METADATA_PATH
106
+ metadata_path.parent.mkdir(parents=True, exist_ok=True)
107
+ metadata_path.write_text(asset.model_dump_json(by_alias=True))
108
+
109
+
110
+ class ConceptualMappingFileSerialiser(MappingPackageAssetSerialiser):
111
+ """Serialiser for conceptual mapping files."""
112
+
113
+ def serialize(self, package_folder_path: Path, asset: ConceptualMappingPackageAsset) -> None:
114
+ file_path = package_folder_path / RELATIVE_CONCEPTUAL_MAPPING_PATH
115
+ file_path.parent.mkdir(parents=True, exist_ok=True)
116
+ file_path.write_bytes(asset.content)
117
+
118
+
119
+ class MappingPackageSerialiser(MappingPackageAssetSerialiser):
120
+ """Main serialiser for complete mapping packages."""
121
+
122
+ def serialize(self, package_folder_path: Path, asset: MappingPackage) -> None:
123
+ """Serialize all components of a mapping package.
124
+
125
+ This method orchestrates the serialization of:
126
+ - Package metadata
127
+ - Conceptual mapping file
128
+ - Technical mapping suite
129
+ - Vocabulary mapping suite
130
+ - Test data suites
131
+ - SPARQL test suites
132
+ - SHACL test suites
133
+
134
+ Args:
135
+ package_folder_path (Path): Path to the mapping package folder.
136
+ asset (MappingPackage): Complete mapping package to serialize.
137
+ """
138
+
139
+ # Serialize each component
140
+ MappingPackageMetadataSerialiser().serialize(package_folder_path, asset.metadata)
141
+ ConceptualMappingFileSerialiser().serialize(package_folder_path, asset.conceptual_mapping_file)
142
+ TechnicalMappingSuiteSerialiser().serialize(package_folder_path, asset.technical_mapping_suite)
143
+ VocabularyMappingSuiteSerialiser().serialize(package_folder_path, asset.vocabulary_mapping_suite)
144
+ TestDataSuitesSerialiser().serialize(package_folder_path, asset.test_data_suites)
145
+ SPARQLTestSuitesSerialiser().serialize(package_folder_path, asset.test_suites_sparql)
146
+ SHACLTestSuitesSerialiser().serialize(package_folder_path, asset.test_suites_shacl)
File without changes