6.5. aas.compliance_tool.compliance_check_xml - Check XML-File compliance
Module which offers functions to use in a confirmation tool related to xml files
check_schema(): Checks if a xml file is conform to official JSON schema
as defined in the ‘Details of the Asset Administration Shell’ specification of Plattform Industrie 4.0
check_deserialization(): Checks if a xml file can be deserialized
check_aas_example(): Checks if a xml file consist the data of the
example data defined in aas.examples.data.example_aas.py
check_xml_files_equivalence(): Checks if two xml files have the same
data regardless of their order
All functions reports any issues using the given ComplianceToolStateManager
by adding new steps and associated LogRecords
- basyx.aas.compliance_tool.compliance_check_xml.check_aas_example(file_path: str, state_manager: basyx.aas.compliance_tool.state_manager.ComplianceToolStateManager, **kwargs) None
Checks if a file contains all elements of the aas example and reports any issues using the given
ComplianceToolStateManagerCalls the
check_deserialization()and add the steps: Check if data is equal to example data- Parameters
file_path – Given file which should be checked
state_manager –
ComplianceToolStateManagerto log the stepskwargs – Additional arguments to pass to
AASDataChecker
- basyx.aas.compliance_tool.compliance_check_xml.check_deserialization(file_path: str, state_manager: basyx.aas.compliance_tool.state_manager.ComplianceToolStateManager, file_info: Optional[str] = None) basyx.aas.model.provider.DictObjectStore
Deserializes a XML AAS file and reports any issues using the given
ComplianceToolStateManagerAdd the steps: Open {} file and Read {} file and Check if it is conform to the xml schema
- Parameters
file_path – Given file which should be deserialized
state_manager –
ComplianceToolStateManagerto log the stepsfile_info – Additional information about the file for name of the steps
- Returns
The deserialized object store
- basyx.aas.compliance_tool.compliance_check_xml.check_schema(file_path: str, state_manager: basyx.aas.compliance_tool.state_manager.ComplianceToolStateManager) None
Checks a given file against the official xml schema and reports any issues using the given
ComplianceToolStateManagerAdd the steps: Open file, Read file, Check if it is conform to the xml syntax and Validate file against official xml schema
- Parameters
file_path – Path to the file which should be checked
state_manager –
ComplianceToolStateManagerto log the steps
- basyx.aas.compliance_tool.compliance_check_xml.check_xml_files_equivalence(file_path_1: str, file_path_2: str, state_manager: basyx.aas.compliance_tool.state_manager.ComplianceToolStateManager, **kwargs) None
Checks if two xml files contain the same elements in any order and reports any issues using the given
ComplianceToolStateManagerCalls the
check_deserialization()for each file and add the steps: Check if data in files are equal- Parameters
file_path_1 – Given first file which should be checked
file_path_2 – Given second file which should be checked
state_manager –
ComplianceToolStateManagerto log the stepskwargs – Additional arguments to pass to
AASDataChecker