CN115114451A - Method and device for converting mind map into knowledge map - Google Patents

Method and device for converting mind map into knowledge map Download PDF

Info

Publication number
CN115114451A
CN115114451A CN202210741536.3A CN202210741536A CN115114451A CN 115114451 A CN115114451 A CN 115114451A CN 202210741536 A CN202210741536 A CN 202210741536A CN 115114451 A CN115114451 A CN 115114451A
Authority
CN
China
Prior art keywords
graph
information
relationship
node
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210741536.3A
Other languages
Chinese (zh)
Inventor
郭少敏
陈旭仲
薄连强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210741536.3A priority Critical patent/CN115114451A/en
Publication of CN115114451A publication Critical patent/CN115114451A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method and a device for converting a mind map into a knowledge map, wherein the method comprises the following steps: the method comprises the steps of obtaining an extensible markup language file of a thinking graph, wherein the extensible markup language file comprises graph information and a tree structure relation between two graphs, determining the graph information as node information of a knowledge graph and the tree structure relation as relation information between two nodes according to a mapping relation, and establishing the knowledge graph according to the node information and the relation information between the two nodes. That is, the mind map may be converted into the knowledge graph by determining the graph information of the mind map and the tree structure relationship between two graphs as the node information of the knowledge graph through a mapping relationship and determining the tree structure relationship as the relationship information between two nodes, so that the knowledge graph can be constructed using the node information and the relationship information.

Description

Method and device for converting mind map into knowledge map
Technical Field
The invention relates to the field of computers, in particular to a method and a device for converting a mind map into a knowledge map.
Background
With the development of finance and computers in the current society, more and more financial trades are related, and as one of the important links for carrying out financial trades, a core system for carrying out data processing on the financial trades is required by banks.
The thinking map can be used for displaying relevant information of the bank core system and the like. However, these graphs only visually show the relationships between systems or within systems, and if automatic searching or learning through the relationships between nodes is desired, a knowledge graph with data of the association relationships between systems needs to be constructed.
Therefore, there is a need for a method that can convert mind maps into knowledge maps.
Disclosure of Invention
In view of the above, an object of the present application is to provide a method and an apparatus for converting a mind map into a knowledge map, which can realize management and utilization of a system from visualization to knowledge map.
The embodiment of the application provides a method for converting a mind map into a knowledge map, which comprises the following steps:
acquiring an extensible markup language file of a mind map, wherein the extensible markup language file comprises graphic information and a tree structure relationship between two graphics;
according to the mapping relation, determining the graph information as node information of a knowledge graph and determining the tree structure relation as relation information between two nodes;
and establishing a knowledge graph according to the node information and the relation information between the two nodes.
Optionally, the graph information includes a graph number and a graph name, and the node information includes a node number and a node attribute;
determining the graph information as node information of the knowledge graph according to the mapping relationship comprises:
and determining the graph number as a node number of the knowledge graph and determining the graph name as a node attribute of the knowledge graph according to the mapping relation.
Optionally, the tree structure relationship between the two graphs includes a starting graph number and an ending graph number, and the relationship information between the two nodes includes a starting node number, an ending node number, and a relationship attribute between the two nodes;
determining the tree structure relationship as relationship information between two nodes according to the mapping relationship comprises:
determining the starting graph number as a starting node number and determining the ending graph number as an ending node number according to the mapping relation;
and determining the relationship attribute between the two nodes according to the starting graph number and the ending graph number.
Optionally, the determining a relationship attribute between two nodes according to the starting graph number and the ending graph number includes:
acquiring a tree structure of all graphs in the mind map, wherein the tree structure comprises branch elements and leaf elements;
storing branch elements into a branch element stack according to the tree structure, and storing leaf elements belonging to the same branch in the tree structure into a leaf element stack;
when the branch element stack is popped up to a first branch element, popping up the first leaf element belonging to the first branch element in the leaf element stack, wherein the first branch element corresponds to a starting figure number, and the first leaf element corresponds to an ending figure number;
and determining the relationship attribute between the two nodes according to the inclusion relationship between the first branch element and the first leaf element.
Optionally, the method further comprises:
and pre-configuring the mapping relation between the graph information and the node information of the knowledge graph and the mapping relation between the tree structure relation and the relation information.
The embodiment of the present application further provides an apparatus for converting a mind map into a knowledge graph, where the apparatus includes:
the system comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring an extensible markup language file of a thought guide graph, and the extensible markup language file comprises graph information and a tree structure relationship between two graphs;
the determining unit is used for determining the graph information as node information of a knowledge graph and determining the tree structure relationship as relationship information between two nodes according to the mapping relationship;
and the establishing unit is used for establishing a knowledge graph according to the node information and the relation information between the two nodes.
Optionally, the graph information includes a graph number and a graph name, and the node information includes a node number and a node attribute;
the determining unit is specifically configured to:
and determining the graph number as a node number of the knowledge graph and determining the graph name as a node attribute of the knowledge graph according to the mapping relation.
Optionally, the tree structure relationship between the two graphs includes a starting graph number and an ending graph number, and the relationship information between the two nodes includes a starting node number, an ending node number, and a relationship attribute between the two nodes;
the determining unit is specifically configured to:
determining the number of the starting graph as the number of a starting node and determining the number of the ending graph as the number of an ending node according to the mapping relation;
and determining the relationship attribute between the two nodes according to the starting graph number and the ending graph number.
Optionally, the determining unit is specifically configured to:
acquiring a tree structure of all graphs in the mind map, wherein the tree structure comprises branch elements and leaf elements;
storing branch elements into a branch element stack according to the tree structure, and storing leaf elements belonging to the same branch in the tree structure into a leaf element stack;
when the branch element stack is popped up to a first branch element, popping up the first leaf element belonging to the first branch element in the leaf element stack, wherein the first branch element corresponds to a starting figure number, and the first leaf element corresponds to an ending figure number;
and determining the relationship attribute between the two nodes according to the inclusion relationship between the first branch element and the first leaf element. Optionally, the apparatus further comprises:
and the configuration unit is used for configuring the mapping relationship between the graph information and the node information of the knowledge graph and the mapping relationship between the tree structure relationship and the relationship information in advance.
The embodiment of the application provides a method for converting a mind map into a knowledge map, which comprises the following steps: the method comprises the steps of obtaining an extensible markup language file of a mind map, wherein the extensible markup language file comprises graph information and a tree structure relation between two graphs, determining the graph information as node information of a knowledge map and the tree structure relation as relation information between two nodes according to a mapping relation, and establishing the knowledge map according to the node information and the relation information between the two nodes. That is, the conversion of the mind map into the knowledge map may be achieved by determining the graph information of the mind map and the tree structure relationship between two graphs as node information of the knowledge map through a mapping relationship and determining the tree structure relationship as relationship information between two nodes so that the knowledge map can be constructed using the node information and the relationship information.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method for transforming a mind map into a knowledge graph according to an embodiment of the present application;
FIG. 2 illustrates a schematic diagram of a mental map provided by an embodiment of the present application;
FIG. 3 illustrates another conceptual diagram provided by an embodiment of the present application;
FIG. 4 is a diagram illustrating an XML file of a mind map provided by an embodiment of the present application;
FIG. 5 illustrates a schematic view of a knowledge-graph provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram illustrating an apparatus for converting a mind map into a knowledge map according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, but the present application may be practiced in other ways than those described herein, and it will be apparent to those of ordinary skill in the art that the present application is not limited by the specific embodiments disclosed below.
The method and the device for converting the mind map into the knowledge map can be applied to the financial field or other fields, for example, the application scene of converting the mind map into the knowledge map in the financial field. The other fields are arbitrary fields other than the financial field, for example, the computer field. The above description is only an example, and does not limit the application field of the method and apparatus for converting a mind map into a knowledge map provided by the present invention.
With the development of finance and computers in the current society, more and more financial trades are involved, and as one of the important links for carrying out financial trades, a core system for carrying out data processing on the financial trades is needed by banks.
The method can draw a relational graph of a bank core system and the like by using mind map software, wherein the graphs are visual representations of the association relationship and the correlation between the systems to be developed or existing systems, but the graphs basically only provide visual understanding, the association between the systems is searched by eyes, and if the relation between nodes is searched or learned automatically, a knowledge graph with the association relationship data between the systems needs to be constructed. The direct connection system and the indirect connection system of the N level of each system and the properties of the contact can be quickly obtained through the knowledge graph. The method is characterized in that the knowledge graph is constructed by converting the relations among the systems into graph data and storing the graph data, and the relations contained in the mind graph are organized into a graph database model and converted into the knowledge graph.
Therefore, there is a need for a method that can convert mind maps into knowledge maps.
Based on this, the embodiment of the present application provides a method for converting a mind map into a knowledge graph, the method including: the method comprises the steps of obtaining an extensible markup language file of a thinking graph, wherein the extensible markup language file comprises graph information and a tree structure relation between two graphs, determining the graph information as node information of a knowledge graph and the tree structure relation as relation information between two nodes according to a mapping relation, and establishing the knowledge graph according to the node information and the relation information between the two nodes. That is, the conversion of the mind map into the knowledge map may be achieved by determining the graph information of the mind map and the tree structure relationship between two graphs as node information of the knowledge map through a mapping relationship and determining the tree structure relationship as relationship information between two nodes so that the knowledge map can be constructed using the node information and the relationship information.
For a better understanding of the technical solutions and effects of the present application, specific embodiments will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, the figure is a schematic flow chart of a method for converting a mind map into a knowledge map according to an embodiment of the present application.
The method for converting the mind map into the knowledge map comprises the following steps:
s101, obtaining an extensible markup language file of the mind map.
In the embodiment of the application, the thought graph file may be stored in a format of an EXtensible Markup Language (XML) file, and the storage in the XML file format may be more beneficial to conversion into the knowledge graph.
The extensible markup language file comprises graph (node) information and a tree structure relationship between two graphs.
As an example, refer to fig. 2, which is a schematic diagram of a mind map provided in the embodiments of the present application. Storing the thought chart schematic diagram as an XML file format is as follows:
<map version="1.0.1">
<node CREATED="1585106602196" ID="ID_194562157"MODIFIED="1585116581414"STYLE="bubble"TEXT="main">
<node CREATED="1585106617430"HGAP="33"ID="ID_1726636208"MODIFIED="1585117747894" POSITION="right" STYLE="bubble"TEXT="1">
<node CREATED="1585106627298" ID="ID_1176142803"MODIFIED="1585116581416"STYLE="bubble"TEXT="1.1">
<node CREATED="1585106635769" ID="ID_1712681657"MODIFIED="1585116581421"STYLE="bubble"TEXT="1.1.1"/>
</node>
<node CREATED="1585106630098" ID="ID_202353993"MODIFIED="1585116581421"STYLE="bubble"TEXT="1.2"/>
</node>
<node CREATED="1585106621711" HGAP="24" ID="ID_539815194"MODIFIED="1585117744681"POSITION="right"STYLE="bubble"TEXT="2"VSHIFT="25">
<node CREATED="1585106641299" ID="ID_1081137511"MODIFIED="1585116581422"STYLE="bubble"TEXT="2.1"/>
</node>
<node CREATED="1585106622968" HGAP="22" ID="ID_857041307"MODIFIED="1585117742533"POSITION="right"STYLE="bubble"TEXT="3"VSHIFT="27"/>
</node>
</map>
that is, the graphic information includes a graphic number (node ID) and a graphic name (text).
The tree structure relationship between two graphs may include a start graph number, an end graph number, and an inclusion relationship between two graphs.
The extensible markup language file of the mind map is a tree structure with a node as an identifier: each row starting with node is an element of a thought graph and can be mapped to a node of the knowledge graph, wherein node ID corresponds to a node number, and TEXT corresponds to a node attribute. The containment relationships between elements in the tree structure may be mapped to relationship attributes between nodes in the knowledge graph.
The appearance of the tail of the line '/>' indicates that the element is a leaf element, the content of the line is </node > indicates that the sub-tree is ended, and the relationship between the root element of the sub-tree and the sub-elements is the inclusion relationship.
As an example, refer to fig. 3, which is a schematic diagram of another mind map provided in the embodiments of the present application. Referring to fig. 4, a schematic diagram of an XML document of a mind map provided in an embodiment of the present application is shown, and fig. 4 is a schematic diagram of the mind map shown in fig. 3 stored in an XML document format.
Reading the extensible markup language file of the thinking map, reading rows of TEXT (main), TEXT (1), TEXT (1.1) and TEXT (1.1.1) in sequence, wherein the rows are all 'end' and are all branch elements, and when reading the TEXT (1.1.1.1) and encountering the '/>' mark, the read rows are leaf elements.
The continuous reading meets the statement that the sub-tree ends with a sub-tree of a root node with TEXT being 1.1.1, the sub-tree only has one branch and one leaf element, and the relationship among the elements is as follows: the relationship between "1.1.1" and "1.1.1.1" includes
Continuing to read TEXT — the "/>" designation encountered by "1.1.2" represents a leaf element.
Continuing to read TEXT — 1.1.3 "encounters the"/> "identification, representing a leaf element.
The continuous reading meets the statement that the sub-tree ends with a root node of TEXT ═ 1.1, the sub-tree has three branches, a branch element and two leaf elements, and the relationship between the elements is as follows: the terms "1.1" and "1.1.1" include the relationships, the terms "1.1" and "1.1.2" include the relationships, and the terms "1.1" and "1.1.3" include the relationships.
Continuing to read TEXT — the "/>" designation encountered by "1.2" represents a leaf element.
The read-on encounters the subtree whose specification ends with the root node having TEXT ═ 1, and which has two branches, a branch element and a leaf element, with the relationship between the elements: the relationship between TEXT 1 and 1.1 is included, and the relationship between TEXT 1 and 1.2 is included.
The next reading is "2".
Continuing to read TEXT — 2.1 "encounters the"/> "identification, representing a leaf element.
The read-on encounters the statement to end with the subtree of the root node of TEXT ═ 2 ', and the subtree has only one branch, and a leaf element, namely the element TEXT ═ 2 ' and the element TEXT ═ 2.1 ', are included relations.
Continuing to read TEXT — the "3" encounters the "/>" identification, representing a leaf element.
The continuous reading meets the statement that the reading is ended by a subtree of a TEXT ═ main root node, the subtree has three branches, two branch elements and a leaf element, and the relationship between the elements is as follows: the relationship between TEXT and "main" and "1" is inclusive, the relationship between TEXT and "main" and "2" is inclusive, and the relationship between TEXT and "main" and "3" is inclusive.
S102, according to the mapping relation, the graph information is determined as node information of the knowledge graph and the tree structure relation is determined as relation information between two nodes.
In an embodiment of the present application, a mapping relationship between graph information of an XML file of the mind map and node information of the knowledge graph and a mapping relationship between tree structure relationship and relationship information of an XML file of the mind map may be configured in advance. The mapping relationship may then be used to determine the graphical information as node information of the knowledge-graph and the tree structure relationship as relationship information between two nodes.
In practical application, the mapping relationship can be provided for a user to customize, so that the mapping relationship can be expanded and changed conveniently.
The basic elements in the graph model of the knowledge graph include nodes and Relationships. Both nodes and relationships may include information such as Properties.
Specifically, the node information may include a node number (node id) and a node attribute (name). The relationship information between two nodes includes a start node number, an end node number, and a relationship attribute between the two nodes.
As an example, the graph model may be a Neo4j graph database.
In the embodiment of the application, mapping between the graph information of the thought graph and the node information of the knowledge graph may be performed first, and according to the mapping relationship, the graph number may be determined as the node number of the knowledge graph, and the graph name may be determined as the node attribute of the knowledge graph.
Specifically, the node ID "ID _194562157" TEXT "main" is mapped to a node number "ID _194562157", and the node attribute TEXT "main".
The node ID "ID _1726636208" TEXT "1" is mapped to a node with a node number "ID _1726636208" and a node attribute TEXT "1".
In the embodiment of the application, after the nodes are mapped, the tree structure relationship between two graphs of the thought graph and the relationship information between the two nodes can be mapped, the number of the starting graph can be determined as the number of the starting node according to the mapping relationship, the number of the ending graph can be determined as the number of the ending node, and then the relationship attribute between the two nodes can be determined according to the number of the starting graph and the number of the ending graph.
Specifically, can acquire the tree structure of whole figures in the thought-guiding graph, the tree structure includes branch element and leaf element, according to the tree structure with branch element storage to branch element stack, with the leaf element storage to the leaf element stack that belongs to same branch in the tree structure, when branch element stack pop-up first branch element, pop-up the first leaf element that belongs to first branch element in the leaf element stack, first branch element corresponds the figure number that begins, first leaf element corresponds the figure number that ends, according to the first branch element and the first leaf element's inclusion relation, confirms the relationship attribute between two nodes. That is, the relationship of all node patterns in the combing thinking guide graph is usually an inclusion (include) relationship, and then the relationship between a plurality of nodes is established according to a plurality of leaf elements.
As an example, two stacks and a branch node child node counter are used to achieve the acquisition of the relationship between the nodes. The two stacks are a branch element stack and a leaf element stack, respectively.
Specifically, when the xml-format file of the thought graph starts to be read, elements which are not finished with \ are pushed into the branch element stack, and when the elements which are finished with \ are pushed into the leaf element stack, the count of the sub-node counter of the stack top element of the branch element stack is increased by 1.
When encountering the element of the branch element stack which is the root node of the subtree, the element of the leaf element stack is popped according to the count of the sub-node counter of the element at the top of the branch element stack, and forms an inclusion relationship with the root node of the subtree. The branch element is then pushed onto the leaf element stack and the top element child node counter of the branch element stack is incremented by 1.
For example, the extensible markup language file schema of the mind map shown in FIG. 4.
1. Reading lines of TEXT ═ main ", TEXT ═ 1", TEXT ═ 1.1"TEXT ═ 1.1.1", sequentially, ending, and all branch elements, pushing into the branch element stack, when reading TEXT ═ 1.1.1.1 "and meeting the mark of"/> ", it is indicated that the branch element is a leaf element, pushing into the leaf element stack, and meanwhile, the sub-node counter of the stack top element 1.1.1 of the branch element stack counts + 1.
As shown in the following table:
Figure BDA0003718168560000101
2. the read-on encounters the statement that the subtree with the root node having TEXT ═ 1.1.1 ends, the branch element stack 1.1.1 is popped, the leaf element stack 1.1.1 is popped, the inclusion relationship of TEXT ═ 1.1.1 "and TEXT ═ 1.1.1.1" is formed, then 1.1.1 is pushed into the leaf element stack, and the counter count of the sub-node of the top element 1.1 of the branch element stack is incremented by 1.
As shown in the following table:
Figure BDA0003718168560000111
3. continuing to read TEXT — the "1.1.2" encounters the "/>" identification, representing a leaf element, pushing the leaf element stack, while the child node counter of the top stack element 1.1 of the branch element stack counts + 1. Continuing to read TEXT — the "1.1.3" encounters the "/>" identification, representing a leaf element, pushing the leaf element stack, while the branch element stack's top-of-stack element 1.1 child node counter count is incremented by 1.
As shown in the following table:
Figure BDA0003718168560000112
4. continuing reading and encountering the statement of the </node > and ending with the subtree of the root node with TEXT ═ 1.1, popping the branch element stack 1.1, counting the sub-node counter of the stack top element 1.1 of the branch element stack to 3, popping the leaf element stack 1.1.3, and forming: the leaf element stack 1.1.2 pops, the leaf element stack 1.1.2 forms the TEXT 1.1 and the TEXT 1.1.2 inclusions, the leaf element stack 1.1.1 pops, the leaf element stack 1.1.1 forms the TEXT 1.1 and the leaf element stack 1.1.1, the leaf element stack 1.1, and the branch stack top element 1 child node counter 1.
As shown in the following table:
Figure BDA0003718168560000113
5. continuing to read TEXT — the "/>" flag is encountered "1.2", representing a leaf element, pushing the leaf element stack, while the top-of-stack element 1 child node counter of the branch element stack counts + 1.
As shown in the following table:
Figure BDA0003718168560000121
6. continuing reading and meeting the statement of the </node > and ending with a subtree of a root node with TEXT ═ 1, popping the branch element stack 1, enabling the count of the sub-node counter of the top element 1 of the branch element stack to be 2, popping the leaf element stack 1.2, forming an inclusion relationship of TEXT ═ 1 and TEXT ═ 1.2, popping the leaf element stack 1.1, forming an inclusion relationship of TEXT ═ 1 and TEXT ═ 1.1, then pushing 1 into the leaf element stack, and adding 1 to the count of the sub-node counter of the top element main of the branch element stack.
As shown in the following table:
Figure BDA0003718168560000122
7. continuing to read TEXT ═ 2 "pushes on the branch element stack, continuing to read TEXT ═ 2.1" encounters the "/>" identification, representing a leaf element, pushing on the leaf element stack, while the top element 2 child node counter of the branch element stack counts + 1.
As shown in the following table:
Figure BDA0003718168560000123
8. continuing reading and encountering the statement, ending with the subtree of the root node with TEXT ═ 2 ', popping the branch element stack 2, counting the sub-node counter of the stack top element 2 of the branch element stack to be 1, popping the leaf element stack 2.1, forming the inclusion relationship of the element TEXT ═ 2 ' and the element TEXT ═ 2.1 '. Then 2 is pushed onto the leaf element stack and the top stack element main child node counter count of the branching element stack is incremented by 1. As shown in the following table:
Figure BDA0003718168560000124
9. continuing to read TEXT — the "3" encounters the "/>" identification, representing a leaf element, pushing the leaf element stack, while the top-of-stack element main child node counter of the branch element stack counts + 1.
As shown in the following table:
Figure BDA0003718168560000131
10. continuing reading and meeting the description of </node > and ending with a sub-tree of a root node TEXT ═ main, popping the branch element stack mian, popping the leaf element stack 3, 2, 1 according to the count of the sub-node of the top element main of the branch element stack being 3, and the relationship between the elements being: the relationship "main" and "3" includes the relationship "main" and "2" and the relationship "main" and "1" includes the relationship.
The specific method for obtaining the relationship attribute between the two nodes in the pop-up mode is that the relationship attribute between the two nodes is obtained in the pop-up mode because only a tree structure relationship exists between the two graphs of the thought-guided graph and connection information between the graphs is not included.
As an example, refer to fig. 5, which is a schematic diagram of a knowledge graph provided in the embodiment of the present application. The knowledge-graph shown in fig. 5 is transformed from the mind map shown in fig. 2.
S103, establishing a knowledge graph according to the node information and the relation information between the two nodes.
In the embodiment of the application, after the node information of the knowledge graph and the relationship information between two nodes are obtained according to the mapping relationship, the knowledge graph can be established according to the node information and the relationship information between two nodes.
In embodiments of the present application, the process of converting the mind map into the knowledge-graph may be monitored in real time. The method can specifically provide a query interface for querying the thinking guide graph import graph model result for a user, and display information such as whether import is successful, how many nodes are imported, how many relationships and the like on the query interface.
That is to say, the method provided by the embodiment of the present application converts the graphic file into the graph database data by interpreting the mind map file in the XML format and mapping the graphic elements therein to the elements such as nodes and relationships of the graph model, thereby implementing the construction of the related knowledge graph.
The embodiment of the application provides a method for converting a mind map into a knowledge map, which comprises the following steps: the method comprises the steps of obtaining an extensible markup language file of a thinking graph, wherein the extensible markup language file comprises graph information and a tree structure relation between two graphs, determining the graph information as node information of a knowledge graph and the tree structure relation as relation information between two nodes according to a mapping relation, and establishing the knowledge graph according to the node information and the relation information between the two nodes. That is, the conversion of the mind map into the knowledge map may be achieved by determining the graph information of the mind map and the tree structure relationship between two graphs as node information of the knowledge map through a mapping relationship and determining the tree structure relationship as relationship information between two nodes so that the knowledge map can be constructed using the node information and the relationship information.
Based on the method for converting the mind map into the knowledge graph provided by the embodiment, the embodiment of the application also provides a device for converting the mind map into the knowledge graph, and the working principle of the device is described in detail below by combining the attached drawings.
Referring to fig. 6, the drawing is a schematic structural diagram of an apparatus for converting a mind map into a knowledge map according to an embodiment of the present application.
The apparatus 400 for converting a mind map into a knowledge graph provided by the embodiment of the application comprises:
an obtaining unit 410, configured to obtain an extensible markup language file of the mind map, where the extensible markup language file includes graph information and a tree structure relationship between two graphs;
a determining unit 420, configured to determine, according to a mapping relationship, the graph information as node information of a knowledge graph and the tree structure relationship as relationship information between two nodes;
the establishing unit 430 is configured to establish a knowledge graph according to the node information and the relationship information between the two nodes.
Optionally, the graph information includes a graph number and a graph name, and the node information includes a node number and a node attribute;
the determining unit is specifically configured to:
and determining the graph number as a node number of the knowledge graph and determining the graph name as a node attribute of the knowledge graph according to the mapping relation.
Optionally, the tree structure relationship between the two graphs includes a starting graph number and an ending graph number, and the relationship information between the two nodes includes a starting node number, an ending node number, and a relationship attribute between the two nodes;
the determining unit is specifically configured to:
determining the starting graph number as a starting node number and determining the ending graph number as an ending node number according to the mapping relation;
and determining the relationship attribute between the two nodes according to the starting graph number and the ending graph number.
Optionally, the determining unit is specifically configured to:
acquiring a tree structure of all graphs in the mind map, wherein the tree structure comprises branch elements and leaf elements;
storing branch elements into a branch element stack according to the tree structure, and storing leaf elements belonging to the same branch in the tree structure into a leaf element stack;
when the branch element stack is popped up to a first branch element, popping up the first leaf element belonging to the first branch element in the leaf element stack, wherein the first branch element corresponds to a starting figure number, and the first leaf element corresponds to an ending figure number;
and determining the relationship attribute between the two nodes according to the inclusion relationship between the first branch element and the first leaf element.
Optionally, the apparatus further comprises:
and the configuration unit is used for configuring the mapping relationship between the graph information and the node information of the knowledge graph and the mapping relationship between the tree structure relationship and the relationship information in advance.
Based on the method for converting the mind map into the knowledge map provided by the above embodiment, the embodiment of the application also provides a device for converting the mind map into the knowledge map, and the device for converting the mind map into the knowledge map comprises:
a processor and a memory, the number of processors may be one or more. In some embodiments of the present application, the processor and memory may be connected by a bus or other means.
The memory may include both read-only memory and random access memory, and provides instructions and data to the processor. The portion of memory may also include NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or subsets thereof, or expanded sets thereof, wherein the operating instructions may include various operating instructions for performing various operations. The operating system may include various system programs for implementing various basic services and for handling hardware-based tasks.
The processor controls the operation of the terminal device and may also be referred to as a CPU.
The method disclosed in the embodiments of the present application may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The processor described above may be a general purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The embodiment of the present application further provides a computer-readable storage medium for storing a program code, where the program code is used to execute any one implementation of the methods of the foregoing embodiments.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
When introducing elements of various embodiments of the present application, the articles "a," "an," "the," and "said" are intended to mean that there are one or more of the elements. The terms "comprising," "including," and "having" are intended to be inclusive and mean that there may be additional elements other than the listed elements.
It should be noted that, as one of ordinary skill in the art would understand, all or part of the processes of the above method embodiments may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when executed, the computer program may include the processes of the above method embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, and the units and modules described as separate components may or may not be physically separate. In addition, some or all of the units and modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is merely a preferred embodiment of the present application and, although the present application discloses the foregoing preferred embodiments, the present application is not limited thereto. Those skilled in the art can now make numerous possible variations and modifications to the disclosed embodiments, or modify equivalent embodiments, using the methods and techniques disclosed above, without departing from the scope of the claimed embodiments. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present application still fall within the protection scope of the technical solution of the present application without departing from the content of the technical solution of the present application.

Claims (10)

1. A method of converting a mind map into a knowledge map, the method comprising:
acquiring an extensible markup language file of a mind map, wherein the extensible markup language file comprises graphic information and a tree structure relationship between two graphics;
according to the mapping relation, determining the graph information as node information of a knowledge graph and determining the tree structure relation as relation information between two nodes;
and establishing a knowledge graph according to the node information and the relation information between the two nodes.
2. The method of claim 1, wherein the graph information comprises a graph number and a graph name, and the node information comprises a node number and a node attribute;
determining the graph information as node information of the knowledge graph according to the mapping relationship comprises:
and determining the graph number as a node number of the knowledge graph and determining the graph name as a node attribute of the knowledge graph according to the mapping relation.
3. The method according to claim 2, wherein the tree structure relationship between the two graphs comprises a starting graph number and an ending graph number, and the relationship information between the two nodes comprises a starting node number, an ending node number and a relationship attribute between the two nodes;
determining the tree structure relationship as relationship information between two nodes according to the mapping relationship comprises:
determining the starting graph number as a starting node number and determining the ending graph number as an ending node number according to the mapping relation;
and determining the relationship attribute between the two nodes according to the starting graph number and the ending graph number.
4. The method of claim 3, wherein determining the relationship attribute between two nodes according to the starting graph number and the ending graph number comprises:
acquiring a tree structure of all graphs in the mind map, wherein the tree structure comprises branch elements and leaf elements;
storing branch elements into a branch element stack according to the tree structure, and storing leaf elements belonging to the same branch in the tree structure into a leaf element stack;
when the branch element stack is popped up to a first branch element, popping up the first leaf element belonging to the first branch element in the leaf element stack, wherein the first branch element corresponds to a starting figure number, and the first leaf element corresponds to an ending figure number;
and determining the relationship attribute between the two nodes according to the inclusion relationship between the first branch element and the first leaf element.
5. The method according to any one of claims 1-4, further comprising:
and pre-configuring the mapping relation between the graph information and the node information of the knowledge graph and the mapping relation between the tree structure relation and the relation information.
6. An apparatus for converting a mind map into a knowledge map, the apparatus comprising:
the system comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring an extensible markup language file of a mind map, and the extensible markup language file comprises graphic information and a tree structure relationship between two graphics;
the determining unit is used for determining the graph information as node information of a knowledge graph and determining the tree structure relationship as relationship information between two nodes according to the mapping relationship;
and the establishing unit is used for establishing a knowledge graph according to the node information and the relation information between the two nodes.
7. The apparatus of claim 6, wherein the graph information comprises a graph number and a graph name, and the node information comprises a node number and a node attribute;
the determining unit is specifically configured to:
and determining the graph number as a node number of the knowledge graph and determining the graph name as a node attribute of the knowledge graph according to the mapping relation.
8. The apparatus of claim 7, wherein the tree structure relationship between the two graphs comprises a starting graph number and an ending graph number, and the relationship information between the two nodes comprises a starting node number, an ending node number, and a relationship attribute between the two nodes;
the determining unit is specifically configured to:
determining the starting graph number as a starting node number and determining the ending graph number as an ending node number according to the mapping relation;
and determining the relationship attribute between the two nodes according to the starting graph number and the ending graph number.
9. The apparatus according to claim 8, wherein the determining unit is specifically configured to:
acquiring a tree structure of all graphs in the mind map, wherein the tree structure comprises branch elements and leaf elements;
storing branch elements into a branch element stack according to the tree structure, and storing leaf elements belonging to the same branch in the tree structure into a leaf element stack;
when the branch element stack is popped up to a first branch element, popping up the first leaf element belonging to the first branch element in the leaf element stack, wherein the first branch element corresponds to a starting figure number, and the first leaf element corresponds to an ending figure number;
and determining the relationship attribute between the two nodes according to the inclusion relationship between the first branch element and the first leaf element.
10. The apparatus of any one of claims 6-9, further comprising:
and the configuration unit is used for configuring the mapping relationship between the graph information and the node information of the knowledge graph and the mapping relationship between the tree structure relationship and the relationship information in advance.
CN202210741536.3A 2022-06-28 2022-06-28 Method and device for converting mind map into knowledge map Pending CN115114451A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210741536.3A CN115114451A (en) 2022-06-28 2022-06-28 Method and device for converting mind map into knowledge map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210741536.3A CN115114451A (en) 2022-06-28 2022-06-28 Method and device for converting mind map into knowledge map

Publications (1)

Publication Number Publication Date
CN115114451A true CN115114451A (en) 2022-09-27

Family

ID=83329977

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210741536.3A Pending CN115114451A (en) 2022-06-28 2022-06-28 Method and device for converting mind map into knowledge map

Country Status (1)

Country Link
CN (1) CN115114451A (en)

Similar Documents

Publication Publication Date Title
US9424251B2 (en) Method for extracting semantic distance from mathematical sentences and classifying mathematical sentences by semantic distance, device therefor, and computer readable recording medium
CN109522018B (en) Page processing method and device and storage medium
US20150186193A1 (en) Generation of client-side application programming interfaces
US20100312803A1 (en) Apparatus and method for identifying and abstracting a visualization point from an arbitrary two-dimensional dataset into a unified metadata for further consumption
CN111522927B (en) Entity query method and device based on knowledge graph
CN113377373A (en) Page loading method and device based on analysis engine, computer equipment and medium
US10489024B2 (en) UI rendering based on adaptive label text infrastructure
CN112182236A (en) Knowledge graph construction method and system and electronic equipment
CN110795093B (en) Interactive view generation method and device
CN108664546B (en) XML data structure conversion method and device
CN110308907B (en) Data conversion method and device, storage medium and electronic equipment
CN111508562A (en) Visual display method, device, equipment and medium of flow descriptive language
CN113609100B (en) Data storage method, data query device and electronic equipment
CN112559760B (en) CPS (cyber physical system) resource capacity knowledge graph construction method for text description
CN110941655A (en) Data format conversion method and device
CN112328246A (en) Page component generation method and device, computer equipment and storage medium
CN115114451A (en) Method and device for converting mind map into knowledge map
CN108427664A (en) A kind of document analysis method and device
CN114880308A (en) Metadata processing method, device and medium based on big data
CN114722112A (en) Visual list data display method and device
Deshmukh et al. An Empirical Study: XML Parsing using Various Data Structures
CN113987118A (en) Corpus acquisition method, apparatus, device and storage medium
CN115719055A (en) Table construction method and device
Carme et al. The lixto project: Exploring new frontiers of web data extraction
CN112988778A (en) Method and device for processing database query script

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination