Skip to content

[Task] Provide more context in case model validation fails #18

Open
@schabdo

Description

@schabdo

Given the following model, missing a dataType within characteristic Megabyte:

:Health a samm:Aspect ;
   samm:preferredName "Device Health "@en ;
   samm:description "Health of the Device"@en ;
   samm:properties ( :memory ) ;
   samm:operations ( ) ;
   samm:events ( ) .

:memory a samm:Property ;
   samm:description "Used Memory"@en ;
   samm:characteristic :Memory ;
   samm:exampleValue "5000" .

:Memory a samm-c:Measurement ;
   samm:preferredName "Megabyte"@en ;
   samm:description "Amount of memory"@en ;
   samm-c:unit :megabyte .

:megabyte a unit:Unit ;
   samm:commonCode "MB" ;
   samm:referenceUnit unit:byte ;
   samm:symbol "MB" .

Raises the following error, without any chance to figure out which node actually is affected:

File "/esmf_aspect_meta_model_python/loader/instantiator_base.py", line 77, in get_instance
    new_instance = self._create_instance(element_node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/esmf_aspect_meta_model_python/loader/instantiator/measurement_instantiator.py", line 28, i
    n _create_instance raise TypeError("Data type can't be None.")
TypeError: Data type can't be None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedHas been viewed by one of the maintainers and is ready for further work, discussion or other steps.enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions