mivot_validator.instance_checking package
Subpackages
- mivot_validator.instance_checking.builder package
- mivot_validator.instance_checking.xml_interpreter package
- Submodules
- mivot_validator.instance_checking.xml_interpreter.annotation_seeker module
AnnotationSeekerAnnotationSeeker.get_collection_item_by_primarykey()AnnotationSeeker.get_globals()AnnotationSeeker.get_globals_collection()AnnotationSeeker.get_globals_collection_dmids()AnnotationSeeker.get_globals_collection_dmtypes()AnnotationSeeker.get_globals_collections()AnnotationSeeker.get_globals_instance_by_dmid()AnnotationSeeker.get_globals_instance_dmids()AnnotationSeeker.get_globals_instance_dmtypes()AnnotationSeeker.get_globals_instance_from_collection()AnnotationSeeker.get_globals_instances()AnnotationSeeker.get_instance_by_dmtype()AnnotationSeeker.get_instance_dmtypes()AnnotationSeeker.get_tablerefs()AnnotationSeeker.get_templates_block()AnnotationSeeker.get_templates_instance_by_dmid()
- mivot_validator.instance_checking.xml_interpreter.att_utils module
- mivot_validator.instance_checking.xml_interpreter.dynamic_reference module
- mivot_validator.instance_checking.xml_interpreter.exceptions module
- mivot_validator.instance_checking.xml_interpreter.join_operator module
- mivot_validator.instance_checking.xml_interpreter.model_viewer module
ModelViewerModelViewer.annotation_seekerModelViewer.connect_table()ModelViewer.connected_tableModelViewer.connected_table_refModelViewer.current_data_rowModelViewer.get_declared_models()ModelViewer.get_globals_instance()ModelViewer.get_globals_models()ModelViewer.get_model_component_by_role()ModelViewer.get_model_component_by_type()ModelViewer.get_model_view()ModelViewer.get_next_row()ModelViewer.get_table_ids()ModelViewer.get_templates_models()ModelViewer.resource_seekerModelViewer.rewind()
- mivot_validator.instance_checking.xml_interpreter.resource_seeker module
- mivot_validator.instance_checking.xml_interpreter.static_reference_resolver module
- mivot_validator.instance_checking.xml_interpreter.table_iterator module
- mivot_validator.instance_checking.xml_interpreter.vocabulary module
- Module contents
Submodules
mivot_validator.instance_checking.inheritance_checker module
Created on 30 May 2023
@author: julien abid
mivot_validator.instance_checking.instance_checker module
Created on 21 Feb 2023
@author: laurentmichel
- exception mivot_validator.instance_checking.instance_checker.CheckFailedException[source]
Bases:
Exception
- class mivot_validator.instance_checking.instance_checker.InstanceChecker[source]
Bases:
objectAPI operating the validation of mapped instances against the VODML definition
all ATTRIBUTE/COLLECTION/INSTANCE children of the mapped instance must be referenced in the VODML with the same dmrole and the same dmtype.
The dmtype checking takes into account the inheritance
The mapped instances must not necessary host all the components declared in the VODML
All the components hosted by the mapped instances must be compliant with the VODML
The VODML files are stored locally for the moment
- static check_instance_validity(instance_etree, session)[source]
Public method. The only one meant to be used from from outside Checks that instance_etree is compliant with the model it refers to
- Parameters:
instance_etree (etree) – MIVOT instance to be checked
- Return type:
a documented exception ins case of failure
- inheritence_tree = {}
mivot_validator.instance_checking.instance_snippet_builder module
Created on 21 Apr 2023
use the snippet_builder to build a concrete MIVOT view of the class model_name:class_name of the model serialized in provided generic MIVOT snippet
@author: julien abid
- class mivot_validator.instance_checking.instance_snippet_builder.BColors[source]
Bases:
objectColor codes for terminal output
- BOLD = '\x1b[1m'
- ENDC = '\x1b[0m'
- GRAY = '\x1b[37m'
- OKBLUE = '\x1b[94m'
- OKCYAN = '\x1b[96m'
- OKGREEN = '\x1b[92m'
- RED = '\x1b[31m'
- UNDERLINE = '\x1b[4m'
- WARNING = '\x1b[93m'
- class mivot_validator.instance_checking.instance_snippet_builder.InstanceSnippetBuilder(vodmlid, output_name, session, concrete_list=None)[source]
Bases:
objectBuild a concrete MIVOT view of the class model_name:class_name of the model serialized in provided generic MIVOT snippet
- ask_for_collection(actual_collection, instance_count, parent_key)[source]
Ask the user if he wants to add another property in the collection
- Parameters:
actual_collection – the context of the property
instance_count – the number of instance in the collection
parent_key – the parent key of the property
- mivot_validator.instance_checking.instance_snippet_builder.add_value(dict_obj, key, value)[source]
Adds a key-value pair to the dictionary. If the key already exists in the dictionary, it will associate multiple values with that key instead of overwritting its value
mivot_validator.instance_checking.model_snippets_builder module
Created on 19 Apr 2023
use a modified version of the snippet builder to generate snippets for all the objectTypes of a VODML model
@author: julien abid
- class mivot_validator.instance_checking.model_snippets_builder.ModelBuilder(vodml_path, session)[source]
Bases:
BuilderClass to generate snippets for all the objectTypes and dataTypes of a VODML model
- Parameters:
vodml_path – path to the VODML model
output_dir – path to the output directory
- build()[source]
Build one snippet for all the dataType/objectType which are not abstract, found in the VODML model
- build_object(ele, role, root, aggregate)[source]
Build a MIVOT instance from a VOMDL element
- Ele:
VODML representation of the class to be mapped
- Role:
VODML role to be affected to the built instance
- Aggregate:
If False, all components found out in the VODML element are added to the enclosing instance (in that case of inheritance reconstruction) . Otherwise, those components are enclosed in an INSTANCE (composition case)
mivot_validator.instance_checking.snippet_builder module
Created on 22 Dec 2022
@author: laurentmichel
- class mivot_validator.instance_checking.snippet_builder.Builder(model_name, class_name, session, verbose=False)[source]
Bases:
objectBuild a MIVOT view of the class model_name:class_name of the model serialized in the provided VOMDL file
- CACHE = {}
- RECORD = ''
- RECORD_ON = True
- addAttribute(ele)[source]
add one attribute to the current snippet (can a complex data type or not) if the multiplicity is one:one attribute is added, a COLLECTION otherwise :ele: ATTRIBUTE VODML element
- addComposition(ele)[source]
insert in the current snippet the VOMDL element matching the VODML composition element :ele: VODML element of the composition
- addExtend(ele)[source]
add to the current snippet the super class components :ele: EXTEND VODML element
- addReference(ele)[source]
insert in the current snippet the VOMDL element matching the VODML reference element :ele: VODML element of the reference
- build()[source]
Build one snippet for the dataType/objectType found in the VODML block and matching the searched class
- build_object(ele, role, root, aggregate)[source]
Build a MIVOT instance from a VOMDL element
- Ele:
VODML representation of the class to be mapped
- Role:
VODML role to be affected to the built instance
- Root:
If true the INSTANCE is not a component of an enclosing object. The snippet file must be initialized
- Aggregate:
If False, all components found out in the VODML element are added to the enclosing instance (in that case of inheritance reconstruction). Otherwise, those components are enclosed in an INSTANCE (composition case)