:py:mod:`json2graph.decoder.decode_obj_relation` ================================================ .. py:module:: json2graph.decoder.decode_obj_relation .. autoapi-nested-parse:: Functions to decode specificities of the object Relation. Function's nomenclatures: - Functions that set one property are named: set___. - Functions that set multiple object properties are named: set__relations. - Functions that set multiple data properties are named: set__attributes. - Functions that set both object and data properties are named: set__properties. - Functions that set default values: set__defaults. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: json2graph.decoder.decode_obj_relation.set_relation_defaults json2graph.decoder.decode_obj_relation.set_relation_stereotype json2graph.decoder.decode_obj_relation.set_relation_relations json2graph.decoder.decode_obj_relation.create_relation_properties .. py:function:: set_relation_defaults(relation_dict, ontouml_graph) Set attribute's default values for ontouml:Relation. The attribute's default values are the following: DRA1) ontouml:isDerived default value = False DRA2) ontouml:isAbstract default value = False :param relation_dict: Relation object loaded as a dictionary. :type relation_dict: dict :param ontouml_graph: Knowledge graph that complies with the OntoUML Vocabulary. :type ontouml_graph: Graph .. py:function:: set_relation_stereotype(relation_dict, ontouml_graph) Set ontouml:stereotype property between an instance of ontouml:Relation and an instance representing an ontouml:RelationStereotype. Warning messages: - VRS1: Relation has invalid stereotype associated to it. Result is invalid. :param relation_dict: Relation object loaded as a dictionary. :type relation_dict: dict :param ontouml_graph: Knowledge graph that complies with the OntoUML Vocabulary. :type ontouml_graph: Graph .. py:function:: set_relation_relations(relation_dict, ontouml_graph) Set the following object properties to instances of ontouml:Relation. The object properties are the following: - ontouml:relationEnd (range ontouml:Property) - ontouml:sourceEnd (range ontouml:Property) - ontouml:targetEnd (range ontouml:Property) :param relation_dict: Relation object loaded as a dictionary. :type relation_dict: dict :param ontouml_graph: Knowledge graph that complies with the OntoUML Vocabulary. :type ontouml_graph: Graph .. py:function:: create_relation_properties(json_data, ontouml_graph) Decode an object of type Relation. 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 properties: - ontouml:relationEnd (range ontouml:Property) - ontouml:sourceEnd (range ontouml:Property) - ontouml:targetEnd (range ontouml:Property) - ontouml:stereotype (range ontouml:RelationStereotype) - ontouml:isDerived (range xsd:boolean) - ontouml:isAbstract (range xsd:boolean) :param json_data: JSON's data to have its fields decoded loaded into a dictionary. :type json_data: dict :param ontouml_graph: Knowledge graph that complies with the OntoUML Vocabulary. :type ontouml_graph: Graph