6. aas.compliance_tool - Tool for Creating and Checking JSON, XML and AASX Files’ compliance

Compliance tool for creating and checking json and xml files in compliance with “Details of the Asset Administration Shell” specification of Plattform Industrie 4.0.

This tool has five features: 1. create a xml or json file or an AASX file using xml or json files with example aas elements 2. check if a given xml or json file is compliant with the official json or xml aas schema and is deserializable 3. check if the data in a given xml, json or aasx file is the same as the example data 4. check if two given xml, json or aasx files contain the same aas elements in any order

As a first argument, the feature must be specified (create, schema, deserialization, example, files) or in short (c, s, d, e or f). Depending the chosen feature, different additional arguments must be specified: create or c: path to the file which shall be created (file_1) deseriable or d: file to be checked (file_1) example or e: file to be checked (file_1) file_compare or f: files to compare (file_1, file_2) ,In any case, it must be specified whether the (given or created) files are json (–json) or xml (–xml). All features except “schema” support reading/writing AASX packages instead of plain XML or JSON files via the –aasx option.

Additionally, the tool offers some extra features for more convenient usage:

  1. Different levels of verbosity: Default output is just the status for each step performed. With -v or –verbose, additional information in case of status = FAILED will be provided. With one more -v or –verbose, additional information even in case of status = SUCCESS or WARNINGS will be provided.

  2. Suppressing output on success: With -q or –quite no output will be generated if the status = SUCCESS.

  3. Save log additionally in a logfile: With -l or –logfile, a path to the file where the logfiles shall be created can be specified.

usage: cli [-h] [-v] [-q] (--json | --xml) [-l LOGFILE] [--aasx]
           [--dont-check-extensions]
           {create,c,schema,s,deserialization,d,example,e,files,f} file_1
           [file_2]

6.1. Positional Arguments

action

Possible choices: create, c, schema, s, deserialization, d, example, e, files, f

c or create: creates a file with example data d or deserialization: checks if a given file is compliance with the official schema and is deserializable e or example: checks if a given file contains the example aas elements f or file_compare: checks if two given files contain the same aas elements in any order

file_1

path to file 1

file_2

path to file 2: is required if action f or files is choosen

6.2. Named Arguments

-v, --verbose

Print detailed information for each check. Multiple -v options increase the verbosity. 1: Detailed error information, 2: Additional detailed success information

Default: 0

-q, --quite

no information output if successful

Default: False

--json

Use AAS json format when checking or creating files

Default: False

--xml

Use AAS xml format when checking or creating files

Default: False

-l, --logfile

Log file to be created in addition to output to stdout

--aasx

Create or read AASX files

Default: False

--dont-check-extensions

Don’t compare Extensions

Default: True