admin-shell-io / aas-test-engines

Official test tooling for the Asset Administration Shell
https://certification.admin-shell-io.com
Apache License 2.0
5 stars 2 forks source link

How can I get the result of the validation compliance test? #3

Closed lenaxus closed 5 months ago

lenaxus commented 7 months ago

Expected Behavior

I want to check my AAS to prove if it is Metamodel Version 3 confirm. I have choosen the variant to check json data directly.

Actual Behavior

The script is running but I never got any result information. I tried valid AASes and non-valid AASes.

Steps to Reproduce the Problem

  1. Here is my script to check a non-valid AAS:
    
    from aas_test_engines import file

print('I am in')

Or check data directly

aas = { 'assetAdministrationShells': [ { "extension": [ { "semanticId": { "type": "ExternalReference", "keys": [ { "type": "GlobalReference", "value": "" } ] }, "name": "MaterialNumber", "valueType": "xs:string", "value": "" }, { "semanticId": { "type": "ExternalReference", "keys": [ { "type": "GlobalReference", "value": "" } ] }, "name": "Author", "valueType": "xs:string", "value": "" }, { "semanticId": { "type": "ExternalReference", "keys": [ { "type": "GlobalReference", "value": "" } ] }, "name": "CreationDate", "valueType": "xs:dateTime", "value": "" } ], "administration": { "version": "1", "revision": "0" } } ], 'submodels': [], 'conceptDescriptions': [] } file.check_json_data(aas)

print('I am finished')


The output is the following: 

I am in I am finished



Here you can see that the one AAS which is included only has the 'extension' prop and because should not be valid at all? Can anybody help me here?
otto-ifak commented 7 months ago

Hi @lenaxus, thanks for your comment. The check_... functions return an object which has an ok() method. I updated the README accordingly, for example:

from aas_test_engines import file

aas = {
    'assetAdministrationShells': [],
    'submodels': [],
    'conceptDescriptions': []
}
result = file.check_json_data(aas)
# result.ok() == True

result.dump()
lenaxus commented 7 months ago

Hi @otto-ifak, thank you for your reply. It works now, I got the result :)

I am getting now the output:

   Does not match all sub-schemas
      Reference #/$defs/Environment is invalid
         Property assetAdministrationShells is invalid
            item 0 is invalid
         Property submodels is invalid
            Array is shorter than 1
         Property conceptDescriptions is invalid
            Array is shorter than

So it seems that my inserted AAS which should be valid (it is a different one from above) is invalid. Is it possible that you can give here more insights why it is invalid? That would be very helpful!

otto-ifak commented 5 months ago

The arrays 'assetAdministrationShells', submodels and conceptDescriptions are not allowed to be empty: https://github.com/admin-shell-io/aas-specs/blob/f4662a61cb7cdb180a779da38b409e7ead749628/schemas/json/aas.json#L582

Additionally: we planned to address https://github.com/admin-shell-io/aas-test-engines/issues/4 next week, this will provide you with more details when a file is rejected.

otto-ifak commented 5 months ago

Marking this as closed, please continue discussion in https://github.com/admin-shell-io/aas-test-engines/issues/6