json2graph.decoder.decode_obj_diagram

Functions to decode specificities of the object Diagram.

Function’s nomenclatures:
  • Functions that set one property are named: set_<subject>_<predicate>_<object>.

  • Functions that set multiple object properties are named: set_<subject>_relations.

  • Functions that set multiple data properties are named: set_<subject>_attributes.

  • Functions that set both object and data properties are named: set_<subject>_properties.

  • Functions that set default values: set_<subject>_defaults.

Module Contents

Functions

set_diagram_owner_modelelement(diagram_dict, ontouml_graph)

Set the ontouml:owner property between an ontouml:Diagram and its related ontouml:Package.

set_diagram_containsview_elementview(diagram_dict, ...)

Set the ontouml:containsView property between an ontouml:Diagram and its related ontouml:ElementView.

create_diagram_properties(json_data, ontouml_graph, ...)

Decode objects of type 'Diagram'.

json2graph.decoder.decode_obj_diagram.set_diagram_owner_modelelement(diagram_dict, ontouml_graph)

Set the ontouml:owner property between an ontouml:Diagram and its related ontouml:Package.

Parameters:
  • diagram_dict (dict) – Diagram object loaded as a dictionary.

  • ontouml_graph (Graph) – Knowledge graph that complies with the OntoUML Vocabulary.

Return type:

None

json2graph.decoder.decode_obj_diagram.set_diagram_containsview_elementview(diagram_dict, ontouml_graph)

Set the ontouml:containsView property between an ontouml:Diagram and its related ontouml:ElementView.

Parameters:
  • diagram_dict (dict) – Diagram object loaded as a dictionary.

  • ontouml_graph (Graph) – Knowledge graph that complies with the OntoUML Vocabulary.

Return type:

None

json2graph.decoder.decode_obj_diagram.create_diagram_properties(json_data, ontouml_graph, element_counting)

Decode objects of type ‘Diagram’.

Receives the whole JSON loaded data as a dictionary and manipulates it to create all properties in which the object’s type is domain of.

Created object properties:
  • ontouml:owner (range ontouml:ModelElement)

  • ontouml:containsView (range ontouml:ElementView)

Parameters:
  • json_data (dict) – JSON’s data to have its fields decoded loaded into a dictionary.

  • ontouml_graph (Graph) – Knowledge graph that complies with the OntoUML Vocabulary.

  • element_counting (dict) – Dictionary with types and respective quantities present on graph.

Return type:

None