:py:mod:`json2graph.decode` =========================== .. py:module:: json2graph.decode .. autoapi-nested-parse:: Main function used as script to convert OntoUML JSON files into knowledge graphs, with the flexibility to customize the output and control the execution mode for different use cases. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: json2graph.decode.decode_ontouml_json2graph json2graph.decode.write_graph_file json2graph.decode.decode_all_ontouml_json2graph Attributes ~~~~~~~~~~ .. autoapisummary:: json2graph.decode.decoded_graph .. py:function:: decode_ontouml_json2graph(json_file_path, base_uri = 'https://example.org#', language = '', model_only = False, silent = True, correct = False, execution_mode = 'import') Convert OntoUML JSON data to a Knowledge Graph. This function takes the path to a JSON file representing OntoUML model data provided by the user and converts it into a knowledge graph following the specified options. :param json_file_path: Path to the JSON file to be decoded provided by the user. :type json_file_path: str :param base_uri: Base URI to be used for generating URIs for ontology concepts. Default is https://example.org#. (Optional) :type base_uri: str :param language: Language tag to be added to the ontology's concepts. (Optional) :type language: str :param model_only: If True, only the OntoUML model will be extracted without diagrammatic information. (Optional) :type model_only: bool :param silent: If True, suppresses intermediate communications and log messages during execution. (Optional) :type silent: bool :param correct: If True, attempts to correct potential errors during the conversion process. (Optional) :type correct: bool :param execution_mode: Information about the execution mode. Valid values are 'import' (default), 'script', and 'test'. (Optional) :type execution_mode: str :return: JSON data decoded into a RDFLib's Graph that is compliant with the OntoUML Vocabulary. :rtype: Graph .. py:function:: write_graph_file(ontouml_graph, execution_mode = 'script') Save the ontology graph received as argument into a file using the syntax defined by the user. When running in script mode, the result is saved in the folder specified by the user as argument. When running in test mode, the file is saved inside the 'results' directory created by this function. :param ontouml_graph: Graph compliant with the OntoUML Vocabulary. :type ontouml_graph: Graph :param execution_mode: Information about the execution mode. Valid values are 'import' (default), 'script', and 'test'. (Optional) :type execution_mode: str :return: Saved output file path. :rtype: str .. py:function:: decode_all_ontouml_json2graph() Decode multiple OntoUML JSON files in batch mode. This function processes a directory of OntoUML JSON files and converts each file into a corresponding knowledge graph using the specified options. The output graphs are saved in the output directory chosen by the user as argument. .. py:data:: decoded_graph