6.4. aas.compliance_tool.compliance_check_json - Check JSON-File compliance

Module which offers functions to use in a confirmation tool related to json files

check_schema(): Checks if a json 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 json file can be deserialized

check_aas_example(): Checks if a json file consist the data of the example data defined in aas.examples.data.example_aas.py

check_json_files_equivalence(): Checks if two json 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_json.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 ComplianceToolStateManager

Calls 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_managerComplianceToolStateManager to log the steps

  • kwargs – Additional arguments to pass to AASDataChecker

basyx.aas.compliance_tool.compliance_check_json.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 JSON AAS file and reports any issues using the given ComplianceToolStateManager

Add the steps: Open {} file and Read {} file and check if it is conform to the json schema

Parameters
  • file_path – Given file which should be deserialized

  • state_managerComplianceToolStateManager to log the steps

  • file_info – Additional information about the file for name of the steps

Returns

The deserialized DictObjectStore

basyx.aas.compliance_tool.compliance_check_json.check_json_files_equivalence(file_path_1: str, file_path_2: str, state_manager: basyx.aas.compliance_tool.state_manager.ComplianceToolStateManager, **kwargs) None

Checks if two json files contain the same elements in any order and reports any issues using the given ComplianceToolStateManager

Calls the check_deserialization() for ech 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_managerComplianceToolStateManager to log the steps

  • kwargs – Additional arguments to pass to AASDataChecker

basyx.aas.compliance_tool.compliance_check_json.check_schema(file_path: str, state_manager: basyx.aas.compliance_tool.state_manager.ComplianceToolStateManager) None

Checks a given file against the official json schema and reports any issues using the given ComplianceToolStateManager

Add the steps: Open file, Read file and check if it is conform to the json syntax and Validate file against official json schema

Parameters
  • file_path – Path to the file which should be checked

  • state_managerComplianceToolStateManager to log the steps