json2graph.decoder.decode_obj_project

Functions to decode specificities of the object Project.

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_ontoumlelement_project_project(project_dict, ...)

Set the ontouml:project object property between an ontouml:Project (obj) and all its related entities (subj).

set_project_model_package(project_dict, ontouml_graph)

Set ontouml:model relation between an ontouml:Project and its related model.

set_project_diagram_diagram(project_dict, ontouml_graph)

Set the ontouml:diagram object property between an ontouml:Project and its related ontouml:Diagram entities.

create_project_properties(json_data, ontouml_graph, ...)

Decode objects of type 'Project'.

json2graph.decoder.decode_obj_project.set_ontoumlelement_project_project(project_dict, ontouml_graph, element_counting)

Set the ontouml:project object property between an ontouml:Project (obj) and all its related entities (subj).

Parameters:
  • project_dict (dict) – Project’s data to have its fields decoded.

  • 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

json2graph.decoder.decode_obj_project.set_project_model_package(project_dict, ontouml_graph)

Set ontouml:model relation between an ontouml:Project and its related model.

Parameters:
  • project_dict (dict) – Project’s data to have its fields decoded.

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

Return type:

None

json2graph.decoder.decode_obj_project.set_project_diagram_diagram(project_dict, ontouml_graph)

Set the ontouml:diagram object property between an ontouml:Project and its related ontouml:Diagram entities.

Parameters:
  • project_dict (dict) – Project’s data to have its fields decoded.

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

Return type:

None

json2graph.decoder.decode_obj_project.create_project_properties(json_data, ontouml_graph, element_counting)

Decode objects of type ‘Project’.

Receives the whole JSON loaded data as a dictionary and manipulates it to create all properties in which the object’s type is domain (every case) or range of (when related to an abstract class).

This function considers that there may be multiple projects in the loaded JSON file.

Created object properties:
  • ontouml:project (domain ontouml:OntoumlElement, range ontouml:Project)

  • ontouml:model (domain ontouml:Project, range ontouml:Package)

  • ontouml:diagram (domain ontouml:Project, range ontouml:Diagram)

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