Knowledge graph construction system and method based on relational database
By classifying forms and identifying relationships in relational databases, a knowledge graph is constructed, which solves the problems of data redundancy and resource waste in existing technologies and achieves efficient knowledge graph construction and visualization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- EAST CHINA INST OF COMPUTING TECH
- Filing Date
- 2023-06-25
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies cannot effectively utilize the data value of relational databases when constructing knowledge graphs, and there are problems of data redundancy and resource waste.
By classifying and identifying relationships in relational database forms, a knowledge graph is constructed, including a database access module, a knowledge graph construction module, and a graph editing and display module. This enables the graph-based processing of relational databases and supports the integration and visualization of graphs from multiple data sources.
It improves the usability and accuracy of knowledge graphs, eliminates redundant data, realizes multi-dimensional data union and entity fusion, and provides an intuitive display of data relationships.
Smart Images

Figure CN117009441B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph construction technology, and more specifically, to a knowledge graph construction system and method based on a relational database. Background Technology
[0002] The 21st century is the era of information economy and knowledge economy. With the continuous development of informatization, the construction of information systems in enterprises has long been widespread. However, with the development of new technologies, information system construction and services are developing to a higher level. Faced with the global wave of informatization, information system platforms based on single structured databases are gradually unable to meet the needs of enterprise management. Enterprises must adjust their informatization development strategies in a timely manner, seize the strategic high ground of informatization, and make every effort to continuously update the informatization construction of enterprises.
[0003] The new direction of information technology construction should make full use of existing information resources and carry out comprehensive resource integration. Therefore, this invention proposes to establish a data knowledge graph based on the structured database of the existing enterprise information system. Existing data information is processed through computer networks and information systems to generate new information resources, which are provided to enterprise managers in the form of a visual graph. This helps to capture market opportunities, rationally allocate enterprise resources, optimize the combination of production factors, and thus improve the economic benefits and competitiveness of enterprises.
[0004] Knowledge graphs, also known as scientific knowledge graphs, are a series of different graphics used to display the development process and structural relationships of knowledge. They use visualization technology to describe knowledge resources and carriers, and to mine, analyze, construct, draw, and display knowledge and the relationships between them. Structured databases, through graph-based construction, can fully utilize the fusion computing, reasoning, and other technologies of knowledge graphs to fully realize the data value of structured databases.
[0005] Knowledge graphs are an important means of production in an intelligent society. They are semantic representations of the real world, where each node represents an entity and the edges connecting the nodes correspond to the relationships between entities. Data is integrated and expressed as knowledge. The graph's representation reflects how humans perceive the world. By constructing structured databases as graphs, it is convenient to integrate information from multiple data sources, break down data silos, and achieve full-range data connectivity.
[0006] Current knowledge graph construction largely integrates unstructured and semi-structured data, discovering knowledge from fragmented data to help enterprises achieve business intelligence. However, unstructured data is characterized by irregular and incomplete structures and the lack of predefined data models, making it difficult to organize or format. Using unstructured data for graph construction involves a complex process of collecting, processing, and analyzing it. In contrast, the structured databases commonly used in current information systems contain highly organized and neatly formatted data with complete relational trees. Because they originate from information systems, their content data has higher value, making them easier to process and transform into knowledge graphs, thus achieving seamless knowledge conversion.
[0007] By constructing a knowledge graph from the relational database of an existing information system, the internal production, operation, management, and decision-making activities of an enterprise can be linked together through the knowledge graph, which can greatly promote the improvement of the enterprise's production level and efficiency, thereby enabling the enterprise to be in an advantageous position in global competition.
[0008] Patent document (application number: CN202310007617.5) discloses a method, server, and storage medium for constructing knowledge graphs from unstructured information. However, given the characteristics of unstructured data, such as large data volume, high cost, diverse data types, ineffective management, and complex relationships, conventional unstructured data graph construction requires complex algorithm calculations, consumes computational resources, and may still yield unsatisfactory results.
[0009] Patent document (application number: CN201410804466.7) discloses a method and apparatus for constructing a knowledge graph based on structured data. However, during the construction of the structured data graph, this patent fails to consider filtering a significant portion of configuration form information in relational databases. This information may not require graph-based display and has limited value for user analysis and understanding. Furthermore, the patent does not consider detailed methods for constructing entity relationships; the relationships are primarily derived from the mapping relationships between entity names and their attribute information extracted from the structured data to generate corresponding data structure pairs.
[0010] Patent document (application number: CN202310141105.8) discloses a method, apparatus, terminal, and storage medium for constructing a geographic knowledge graph. The apparatus includes a data acquisition subsystem, an entity relationship extraction subsystem, and a knowledge graph display subsystem. This patent relies on automatic algorithms to perform indiscriminate training and extraction on the acquired data, potentially leading to resource waste; it also simply uses the child node data returned by the graph database Neo4j to perform a depth-first traversal of the JSON data to determine the hierarchical relationship of each node. Summary of the Invention
[0011] In view of the shortcomings of the existing technology, the purpose of this invention is to provide a knowledge graph construction system and method based on relational databases.
[0012] The knowledge graph construction system based on relational databases provided by the present invention includes:
[0013] Database Access Module: Provides access management functions for database instances, completes data source connection information verification and status checks; performs structure reading and analysis on successfully accessed relational databases, understands the basic structure information and relationship information of each form in the database, classifies forms based on the above information, and marks the entities, categories and relationship information of database instances by configuring built-in rules, providing basic data support for graphing;
[0014] The knowledge graph construction module provides functions for extracting concept entities, concept entity relationships, and concept entity attributes from raw data in relational database forms. It supports data entity extraction and data entity relationship construction based on extracted concept entities and relationships, ultimately building a complete knowledge graph of the relational database and completing the graphification process of the relational database. During the entity extraction process, entity fusion, deduplication, and entity relationship merging are performed, and graph integration from multiple data sources is supported.
[0015] The graph editing and display module provides editing and management functions for graph entity nodes and relationships, configuration management operations for database entity extraction and relationship analysis, and various user configurations for data entity extraction to optimize the graph generation process. At the same time, it manages the extracted database graph results in a visual way and provides multi-level visualization of the extracted concept graph and entity graph.
[0016] Preferably, the database access module includes:
[0017] Database connection management submodule: Creates database connection entries, manages the connection list and detects connection status. For databases that have been successfully connected, you can choose to classify and identify the forms within the database.
[0018] Form Classification and Recognition Submodule: Based on the database form structure, the database forms are divided into seven categories according to built-in rules, including dictionary tables, related tables, dynamic tables, entity tables, extended tables, sub-tables and others;
[0019] Based on the way forms are associated, database form relationships can be divided into two main categories: primary and foreign key relationships and related table relationships.
[0020] Based on the preliminary processing of the above form information, we have prepared the basic data conversion for the realization of form graphing.
[0021] Preferably, the knowledge graph construction module includes:
[0022] Concept Extraction Submodule: First, a graph space is created as a container for the graph to be generated. Then, a specified database source is selected to generate the database graph. It supports graph generation from a single source database and the integration of graphs from multiple databases.
[0023] For entity table types in the database, if they are identified as graph concept candidates, the identified entity tables will be automatically constructed as concept nodes. The form name will be used as the concept node name, and the form fields will be used as concept node attributes. For other types of forms, a manual selection method will be provided to construct the user-selected form as a graph concept node.
[0024] For any two entity tables in the same database, the identified primary and foreign key relationships and related table relationships between the tables are constructed into a graph concept relationship. The function of manually adding primary and foreign key relationships and related table relationships between forms is provided to supplement the relationships of the already constructed concept graph. This enables the construction of a concept graph based on form information. Through the generated concept graph, a panoramic view of the form distribution relationships in the selected database can be obtained.
[0025] Preferably, the knowledge graph construction module includes:
[0026] Data instance extraction submodule:
[0027] It provides a function to extract data instances based on the concept node. The known concept node is the form. Based on the concept node information, the data entries under the form are obtained, and each data entry is a subordinate entity node of the corresponding concept node.
[0028] Users can manually select the content of a specified field in the form as the display name of the entity node, and the data content of the remaining fields will be used as the attribute value of the entity node;
[0029] Entity nodes are subordinate nodes of concept nodes, fully inheriting the relationships between concept nodes. Each entity node will be effectively associated and displayed based on its own primary and foreign keys.
[0030] Preferably, the knowledge graph construction module includes:
[0031] Fusion and integration module:
[0032] Supports entity fusion functionality, which at the conceptual entity level treats conceptual entities generated from two forms with the same table structure as the same entity and performs fusion operations.
[0033] The identical table structure is as follows: both forms have the same number of attribute fields, and the field names are consistent.
[0034] For data entities, only data entities belonging to the two merged conceptual entities are unified and assigned to the merged conceptual entity, while merging and updating the relevant entity relationships are performed.
[0035] Preferably, the atlas editing and display module includes:
[0036] The graph editing submodule provides a visual interface for the graph transformation results of the database, allows editing of the generated graphs, and offers process configuration options for the data entity extraction process. Specifically:
[0037] Add Node: Provides the function of adding graph nodes, allowing you to add entity nodes of a specified type and name to the graph;
[0038] Add Relationship: Provides the function of adding relationships between graph nodes, establishing a connection between two selected entity nodes;
[0039] Node deletion: Provides a graph node deletion function to delete selected entity nodes in the graph;
[0040] Relationship deletion: Provides the function of deleting relationships between graph nodes, which can delete the selected node relationships in the graph;
[0041] Node editing: Provides the ability to edit graph nodes, allowing modification of the name of a specified entity node;
[0042] Relationship editing: Provides editing functionality for graph node relationships, allowing modification of the names of specified entity relationships;
[0043] Data entity extraction configuration: Before data entity extraction, the data entity name field can be manually configured; a manual configuration function for data entity hierarchy is provided, allowing the selection of one or more different fields as intermediate layer entities; a manual conversion configuration for the data entity dictionary is provided, mapping dictionary code values in data entries to valid values;
[0044] The graph visualization submodule provides a visual interface for the graph transformation results from the database, allowing for multi-dimensional viewing of the generated graphs. Specifically:
[0045] Click the zoom in, zoom out, or restore buttons to adjust the size of the displayed graph;
[0046] Hovering the mouse over a node on the graph will automatically highlight that node and its associated nodes;
[0047] Choose from four node types: Concept, Category, Data, and Custom, and display Concept nodes and Data nodes separately or in combination.
[0048] The knowledge graph construction method based on relational databases provided by the present invention includes:
[0049] Database access steps: Perform database instance access management, verify data source connection information and check status; perform structure reading and analysis on successfully accessed relational databases, understand the basic structure information and relationship information of each form in the database, classify forms based on the above information, and mark the entities, categories and relationship information of database instances by configuring built-in rules to provide basic data support for graphing.
[0050] Knowledge graph construction steps: Based on the original data of the relational database forms, extract concept entities, extract concept entity relationships, and extract concept entity attributes; based on the extracted concept entities and concept entity relationships, extract data entities and construct data entity relationships, and finally construct a complete knowledge graph of the relational database; during the entity extraction process, perform entity fusion deduplication and entity relationship merging, and integrate the graphs from multiple data sources;
[0051] The graph editing and display steps are as follows: edit and manage the graph entity nodes and relationships; manage the configuration for database entity extraction and relationship analysis; perform multiple user configurations for data entity extraction; and optimize the graph generation process. At the same time, manage the extracted database graph results in a visualization manner and display the extracted concept graph and entity graph in a multi-level visualization manner.
[0052] Preferably, the database access step includes:
[0053] Database connection management sub-steps: Create database connection entries, manage the connection list and check the connection status. For databases that have been successfully connected, you can choose to classify and identify the forms within the database.
[0054] Form classification and identification sub-step: Based on the database form structure, the database forms are divided into seven categories according to built-in rules, including dictionary tables, related tables, dynamic tables, entity tables, extended tables, sub-tables and others;
[0055] Based on the way forms are associated, database form relationships can be divided into two main categories: primary and foreign key relationships and related table relationships.
[0056] Based on the preliminary processing of the above form information, we have prepared the basic data conversion for the realization of form graphing.
[0057] Preferably, the knowledge graph construction steps include:
[0058] Concept extraction sub-steps: First, a graph space is created as a container for the graph to be generated. Then, a specified database source is selected for database graph generation, supporting graph generation from a single source database and graph integration from multiple databases. For entity table types in the database, they are identified as graph concept candidates, and the identified entity tables are automatically constructed as concept nodes. The form name serves as the concept node name, and the form fields serve as concept node attributes. For other types of forms, a manual selection of the construction method is provided, and the user-selected forms are constructed as graph concept nodes. For any two entity tables in the same database, the identified primary and foreign key relationships and related table relationships between the tables are constructed as graph concept relationships. A function to manually add primary and foreign key relationships and related table relationships between forms is provided to supplement the relationships in the already constructed concept graph, realizing the construction of a concept graph based on form information. Through the generated concept graph, a panoramic view of the form distribution relationships in the selected database can be obtained.
[0059] Data instance extraction sub-step: Provides a function to extract data instances based on concept nodes. The known concept node is the form. Based on the concept node information, the subordinate data entries of the form are obtained, and each data entry is a subordinate entity node of the corresponding concept node. It allows users to manually select the content of specified fields in the form as the display name of the entity node, and the data content of the remaining fields is used as the attribute value of the entity node. The entity node is a subordinate node of the concept node and fully inherits the relationship between concept nodes. Each entity node will be effectively associated and displayed according to its own primary and foreign keys.
[0060] Integration steps: Perform entity integration. At the conceptual entity level, conceptual entities generated by two forms with the same table structure are treated as the same entity and integrated. The same table structure means that the two forms have the same number of attribute fields and the field names are consistent. For data entities, only data entities belonging to the two integrated conceptual entities are unified and assigned to the integrated conceptual entity. At the same time, the relevant entity relationships are merged and updated.
[0061] Preferably, the atlas editing and display steps include:
[0062] The graph editing sub-steps provide a visual interface for the graph transformation results of the database, allow editing of the generated graphs, and offer process configuration options for the data entity extraction process. Specifically:
[0063] Add Node: Provides the function of adding graph nodes, allowing you to add entity nodes of a specified type and name to the graph;
[0064] Add Relationship: Provides the function of adding relationships between graph nodes, establishing a connection between two selected entity nodes;
[0065] Node deletion: Provides a graph node deletion function to delete selected entity nodes in the graph;
[0066] Relationship deletion: Provides the function of deleting relationships between graph nodes, which can delete the selected node relationships in the graph;
[0067] Node editing: Provides the ability to edit graph nodes, allowing modification of the name of a specified entity node;
[0068] Relationship editing: Provides editing functionality for graph node relationships, allowing modification of the names of specified entity relationships;
[0069] Data entity extraction configuration: Before data entity extraction, the data entity name field can be manually configured; a manual configuration function for data entity hierarchy is provided, allowing the selection of one or more different fields as intermediate layer entities; a manual conversion configuration for the data entity dictionary is provided, mapping dictionary code values in data entries to valid values;
[0070] The map visualization sub-step involves providing a visual interface for the map conversion results from the database, allowing for multi-dimensional viewing of the generated maps. Specifically:
[0071] Click the zoom in, zoom out, or restore buttons to adjust the size of the displayed graph;
[0072] Hovering the mouse over a node on the graph will automatically highlight that node and its associated nodes;
[0073] Choose from four node types: Concept, Category, Data, and Custom, and display Concept nodes and Data nodes separately or in combination.
[0074] Compared with the prior art, the present invention has the following beneficial effects:
[0075] 1) Classify all forms in the relational database to determine the form categories with greater graph value, and avoid the knowledge graph generated from overflowing its scope and containing a large amount of useless data;
[0076] 2) By relying on the information in the association table to mine the potential relationships between forms, as an effective supplement to the relationships between entities, the types of entity relationships are enriched, and the hidden effective information of relational databases is fully utilized;
[0077] 3) Supports the construction of graphs from multiple data sources, breaks down data silos, enables multi-source data fusion, provides users with a foundation for joint information analysis, provides entity fusion and integration capabilities, effectively improves graph availability, eliminates redundant data, and accurately constructs graph structures;
[0078] 4) Extract data instances based on the extracted conceptual entities, fully inherit and retain the subordinate relationships of the relational database, and maintain the consistency of data traceability;
[0079] 5) Based on the extracted conceptual relationships, instance relationships are constructed. By constructing a graph of the form and data content, a visual presentation is given to the user, clarifying the relationship between the form and its data, and enabling the user to intuitively understand the relationship between the specified database forms and between forms, between forms and data, and between data. Attached Figure Description
[0080] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0081] Figure 1 Graphing functional component diagrams for relational databases;
[0082] Figure 2 This is a diagram of the database graph software structure. Detailed Implementation
[0083] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0084] Example 1:
[0085] like Figure 1 This invention provides a knowledge graph construction system based on a relational database. It achieves graph-based construction and integration of the relational database by sorting out the form structure, identifying and analyzing form relationships, and acquiring basic form entries. The system provides graph editing and display capabilities based on graph visualization, entity editing, entity relationship editing, and graph extraction information configuration. This invention offers functions for classifying data forms, extracting and deduplicating entities of concepts and data instances from relational databases, and providing visual configuration management functions for graph-based construction of relational databases. The system mainly consists of three parts: a database access module, a knowledge graph construction module, and a graph editing and display module.
[0086] The database access module mainly includes a database connection management submodule and a form classification and recognition submodule. It provides database instance access management functions, completes data source connection information verification and status checks; it performs structure reading and analysis on successfully accessed relational databases, understanding the basic structural information and relationship information of each form in the database. Based on this raw information, the system classifies database forms into seven categories. Through configured built-in rules, it marks the main entities, categories, and relationship information of database instances, providing basic data support for graph-based data visualization.
[0087] (1) Database connection management submodule
[0088] It supports successfully creating database connection entries, managing the connection list, and detecting connection status. For databases with successfully established connections, it allows for optional form classification and recognition within the database.
[0089] (2) Form classification and recognition submodule.
[0090] Based on the database form structure, this system divides database forms into seven categories according to built-in rules, including "dictionary tables", "association tables", "dynamic tables", "entity tables", "extended tables", "sub-tables" and "others".
[0091] Meanwhile, based on the way forms are associated, this system divides the relationships between database forms into two main categories: "primary and foreign key relationships" and "association table relationships".
[0092] Based on the preliminary processing of the above original form information, a foundation for data conversion and storage is prepared for the realization of form graphing.
[0093] The knowledge graph construction module mainly includes a concept extraction submodule, a data instance extraction submodule, and a fusion and integration module. It features concept entity extraction, concept entity relationship extraction, and concept entity attribute extraction based on raw data from relational database forms. It supports data entity extraction and data entity relationship construction based on extracted concept entities and relationships, ultimately achieving the construction of a complete knowledge graph for the relational database, completing the graph-based processing of the relational database. The entity extraction process also incorporates functions such as entity fusion and deduplication, and entity relationship merging, supporting the integration of graphs from multiple data sources.
[0094] (1) Concept Extraction Submodule
[0095] First, a graph space is created as a "container" for the graph to be generated. Then, a specified database source is selected to generate the graph from the database. This supports graph generation from a single source database as well as graph integration from multiple databases.
[0096] For forms of type "entity table" in the database, this system identifies them as candidate graph concepts and automatically constructs them into concept nodes. The form name serves as the concept node name, and the form fields serve as concept node attributes. Additionally, for other form types, a manual selection method is provided to construct the user-selected form into a graph concept node.
[0097] For any two "entity tables" in the same database, the identified "primary and foreign key relationships" and "association table relationships" between the tables are constructed into a graph concept relationship. The system provides a function to manually add "primary and foreign key relationships" and "association table relationships" between forms to supplement the already constructed concept graph.
[0098] At this point, a concept map has been constructed based on the form information. This generated concept map can be used to gain an overview of the form distribution relationships in a selected database.
[0099] (2) Data Instance Extraction Submodule
[0100] Currently, this system has a grasp of the distribution of forms in the selected database, but it still lacks data item information for specific forms. The data instance extraction submodule provides the function of extracting data instances based on the concept node information. The known concept node is the form. Based on the concept node information, the data items under the form can be obtained, and each data item can be used as a subordinate entity node of the corresponding concept node.
[0101] Users can manually select the content of a specified field in the form as the display name of the entity node, while the data content of the remaining fields is used as the attribute value of the entity node.
[0102] As subordinate nodes of concept nodes, entity nodes should fully inherit the relationships between concept nodes, and each entity node will be effectively associated and displayed based on its own primary and foreign keys.
[0103] (3) Integration module
[0104] This system supports entity fusion. At the conceptual entity level, it considers two forms with the same table structure to generate the same entity and should be merged. The system defines "same table structure" as: both forms have the same number of attribute fields, and all field names are identical. For data entities, the system does not perform extensive fusion filtering; it simply unifies data entities belonging to the two fused conceptual entities, assigning them to the merged conceptual entity, and simultaneously merging and updating related entity relationships.
[0105] This system also possesses multi-database graph integration capabilities, allowing the construction of the same graph using data from different data sources, fully utilizing existing information for graph display. Consistently, for two forms from different data sources with the same table structure, the conceptual entities they generate will be merged and integrated. Similarly, data entities from different data sources will not undergo extensive merging and filtering operations; instead, data entities belonging to two separate merging conceptual entities will be unified and assigned to the merged conceptual entity, and related entity relationships will be merged and updated.
[0106] The graph editing and display module mainly includes a graph editing submodule and a graph display submodule. It provides editing and management functions for graph entity nodes and relationships, and configuration management operations for database entity extraction and relationship analysis. It allows for various user configurations for data entity extraction to optimize the graph generation process. At the same time, it manages the extracted database graph results in a visualization way and provides multi-level visualization of the extracted concept graph and entity graph.
[0107] (1) Atlas Editing Submodule
[0108] This system provides a visual interface for the graph transformation results of the database, allowing users to edit the generated graphs and configure the data entity extraction process.
[0109] 1) Adding new nodes: Provides the function of adding new graph nodes, allowing you to add entity nodes of a specified type and name to the graph;
[0110] 2) Add Relationship: Provides the function of adding relationships between graph nodes, establishing a connection between two selected entity nodes;
[0111] 3) Node deletion: Provides a graph node deletion function to delete selected entity nodes in the graph;
[0112] 4) Relationship Deletion: Provides the function of deleting relationships between graph nodes, which can delete the selected node relationships in the graph;
[0113] 5) Node Editing: Provides the ability to edit graph nodes, allowing modification of the name of a specified entity node;
[0114] 6) Relationship Editing: Provides editing functionality for graph node relationships, allowing modification of the names of specified entity relationships;
[0115] 7) Data Entity Extraction Configuration: Before data entities are extracted, the data entity name field needs to be manually configured; a manual configuration function for the hierarchical relationship of data entities is provided, allowing one or more different fields to be selected as intermediate layer entities; a manual conversion configuration for the data entity dictionary is provided, mapping dictionary code values in data entries to valid values.
[0116] (2) Atlas Display Submodule
[0117] This system provides a visual interface for the graph conversion results of the database, allowing for multi-dimensional viewing of the generated graphs.
[0118] 1) Click the "Zoom In", "Zoom Out", and "Restore" buttons to adjust the size of the displayed graph;
[0119] 2) Hovering the mouse over a node on the graph will automatically highlight that node and its associated nodes;
[0120] By selecting one of the four node types – “Concept,” “Classification,” “Data,” or “Custom” – you can control the separate or mixed display of concept and data nodes.
[0121] like Figure 2 The front-end presentation formats include Vue, JavaScript, Ant-design, CSS, D3, Axios, and Echarts; the back-end service handles Get, Put, Post, and Delete requests; the runtime environment is JRE, SpringBoot, Mybatis, and Swagger; and the underlying platform is Neo4j, MySQL / ORACLE, and MongoDB.
[0122] Example 2:
[0123] Form classification recognition
[0124] The built-in rules for form categorization are as follows:
[0125] 1) Dictionary table: If a form conforms to the custom dictionary rules (such as fields containing XH / MC, etc.), has a unique primary key, and no foreign keys, then the form is determined to be a dictionary table;
[0126] 2) Related Tables: If a form has more than one field that is both a primary key and a foreign key, and these foreign keys come from different forms, then the form is considered a related table.
[0127] 3) Dynamic table: If a form's composite primary key contains a field of type time, then the form is considered a dynamic table;
[0128] 4) Entity table: If a form has a unique primary key and no foreign keys, it is considered an entity table after excluding dictionary tables.
[0129] 5) Extended Tables: ① If a form has more than one primary key field that comes from another form, then the form is considered an extended table of the other form; ② If a form has only two primary key fields, and one primary key field comes from another table, while the other primary key field is not a foreign key, then the form is considered an extended table of the other form.
[0130] 6) Sub-tables: ① If a form has a unique primary key field, and that primary key field comes from another form, then the form is considered a sub-table of that other form; ② If a form has more than one primary key field that comes from another form, then the form is considered a sub-table of that other form.
[0131] 7) Other: If a form is not identified as any of the above types, it is determined to be another type.
[0132] Example 3:
[0133] Form relationship classification and identification
[0134] 1) Primary and foreign key relationship: If the primary key of table A is the foreign key of table B, then it is determined that there is a primary and foreign key relationship between table A and table B;
[0135] 2) Association table relationship: For an association table, if one primary key comes from table A, another primary key comes from table B, and at least one primary key comes from a dictionary table, then it is determined that there is an association table relationship between table A and table B, that is, table A and table B are connected through this association table.
[0136] Example 4:
[0137] Data entity extraction configuration
[0138] 1) Data Entity Name Field Configuration: Based on the extracted concept entities, subordinate data entities are extracted. Before extraction, the data entity name field needs to be manually configured. The attribute value of this field will be used as the entity name of the extracted data entity.
[0139] 2) Data Entity Hierarchical Relationship Configuration: This system supports the direct extraction of data entries into data entities, with data nodes directly attached to concept nodes. However, considering the poor graph display effect and crowded, stacked data nodes when the data volume in the form is large, which is not conducive to exploring and viewing node relationships, this system provides a manual configuration function for data entity hierarchical relationships. Before extracting data entities, one or more different fields can be selected. The selected fields will serve as intermediate layer entities to distribute the subordinate data entities of the concept entities.
[0140] 3) Data Entity Dictionary Conversion Configuration: Databases contain a large amount of data, and the attribute values may not represent the data itself but rather dictionary codes. In such cases, simply generating a graph entity from a single data entry would render the entity meaningless. This system provides manual conversion configuration for data entity dictionaries. For each data field in a related dictionary, users can select the corresponding dictionary field, allowing them to replace the dictionary code value of the data field with the field's content to generate the corresponding data entity.
[0141] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.
[0142] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A knowledge graph construction system based on a relational database, characterized in that, include: Database access module: Provides access management functions for database instances, and completes data source connection information verification and status check functions; The structure of the successfully connected relational database is read and analyzed to understand the basic construction information and relationship information of each form in the database. Based on the above information, the forms are classified. By configuring built-in rules, the entities, categories and relationship information of the database instances are marked, providing basic data support for graphing. The knowledge graph construction module provides functions for extracting concept entities, concept entity relationships, and concept entity attributes from raw data in relational database forms. It supports data entity extraction and data entity relationship construction based on extracted concept entities and relationships, ultimately building a complete knowledge graph of the relational database and completing the graphification process of the relational database. During the entity extraction process, entity fusion, deduplication, and entity relationship merging are performed, and graph integration from multiple data sources is supported. The graph editing and display module provides editing and management functions for graph entity nodes and relationships, configuration management operations for database entity extraction and relationship analysis, and various user configurations for data entity extraction to optimize the graph generation process. At the same time, it manages the extracted database graph results in a visualization way and provides multi-level visualization of the extracted concept graph and entity graph. The database access module includes: Database connection management submodule: Creates database connection entries, manages the connection list and detects connection status. For databases that have been successfully connected, you can choose to classify and identify the forms within the database. Form Classification and Recognition Submodule: Based on the database form structure, the database forms are divided into seven categories according to built-in rules, including dictionary tables, related tables, dynamic tables, entity tables, extended tables, sub-tables and others; Based on the way forms are associated, database form relationships can be divided into two main categories: primary and foreign key relationships and related table relationships. Based on the preliminary processing of the above form information, we have prepared the basic data conversion for the realization of form graphing.
2. The knowledge graph construction system based on relational databases according to claim 1, characterized in that, The knowledge graph construction module includes: Concept Extraction Submodule: First, a graph space is created as a container for the graph to be generated. Then, a specified database source is selected to generate the database graph. It supports graph generation from a single source database and the integration of graphs from multiple databases. For entity table types in the database, if they are identified as graph concept candidates, the identified entity tables will be automatically constructed as concept nodes. The form name will be used as the concept node name, and the form fields will be used as concept node attributes. For other types of forms, a manual selection method will be provided to construct the user-selected form as a graph concept node. For any two entity tables in the same database, the identified primary and foreign key relationships and related table relationships between the tables are constructed into a graph concept relationship. The function of manually adding primary and foreign key relationships and related table relationships between forms is provided to supplement the relationships of the already constructed concept graph. This enables the construction of a concept graph based on form information. Through the generated concept graph, a panoramic view of the form distribution relationships in the selected database can be obtained.
3. The knowledge graph construction system based on relational databases according to claim 1, characterized in that, The knowledge graph construction module includes: Data instance extraction submodule: It provides a function to extract data instances based on the concept node. The known concept node is the form. Based on the concept node information, the data entries under the form are obtained, and each data entry is a subordinate entity node of the corresponding concept node. Users can manually select the content of a specified field in the form as the display name of the entity node, and the data content of the remaining fields will be used as the attribute value of the entity node; Entity nodes are subordinate nodes of concept nodes, fully inheriting the relationships between concept nodes. Each entity node will be effectively associated and displayed based on its own primary and foreign keys.
4. The knowledge graph construction system based on relational databases according to claim 1, characterized in that, The knowledge graph construction module includes: Fusion and integration module: Supports entity fusion functionality, which at the conceptual entity level treats conceptual entities generated from two forms with the same table structure as the same entity and performs fusion operations. The identical table structure is as follows: both forms have the same number of attribute fields, and the field names are consistent. For data entities, only data entities belonging to the two merged conceptual entities are unified and assigned to the merged conceptual entity, while merging and updating the relevant entity relationships are performed.
5. The knowledge graph construction system based on relational databases according to claim 1, characterized in that, The atlas editing and display module includes: The graph editing submodule provides a visual interface for the graph transformation results of the database, allows editing of the generated graphs, and offers process configuration options for the data entity extraction process. Specifically: Add Node: Provides the function of adding graph nodes, allowing you to add entity nodes of a specified type and name to the graph; Add Relationship: Provides the function of adding relationships between graph nodes, establishing a connection between two selected entity nodes; Node deletion: Provides a graph node deletion function to delete selected entity nodes in the graph; Relationship deletion: Provides the function of deleting relationships between graph nodes, which can delete the selected node relationships in the graph; Node editing: Provides the ability to edit graph nodes, allowing modification of the name of a specified entity node; Relationship editing: Provides editing functionality for graph node relationships, allowing modification of the names of specified entity relationships; Data entity extraction configuration: Before data entity extraction, the data entity name field can be manually configured; a manual configuration function for data entity hierarchy is provided, allowing the selection of one or more different fields as intermediate layer entities; a manual conversion configuration for the data entity dictionary is provided, mapping dictionary code values in data entries to valid values; The graph visualization submodule provides a visual interface for the graph transformation results from the database, allowing for multi-dimensional viewing of the generated graphs. Specifically: Click the zoom in, zoom out, or restore buttons to adjust the size of the displayed graph; Hovering the mouse over a node on the graph will automatically highlight that node and its associated nodes; Choose from four node types: Concept, Category, Data, and Custom, and display Concept nodes and Data nodes separately or in combination.
6. A method for constructing a knowledge graph based on a relational database, characterized in that, include: Database access steps: Perform database instance access management, verify data source connection information and check status; The structure of the successfully connected relational database is read and analyzed to understand the basic construction information and relationship information of each form in the database. Based on the above information, the forms are classified. By configuring built-in rules, the entities, categories and relationship information of the database instances are marked, providing basic data support for graphing. The steps for building a knowledge graph are as follows: First, extract concept entities, concept entity relationships, and concept entity attributes from the raw data in the relational database forms. Second, extract data entities and construct data entity relationships based on the extracted concept entities and their relationships, ultimately building a complete knowledge graph for the relational database. During entity extraction, entity fusion and deduplication are performed, entity relationships are merged, and graph synthesis from multiple data sources is carried out. The graph editing and display steps are as follows: edit and manage the graph entity nodes and relationships; manage the configuration for database entity extraction and relationship analysis; perform multiple user configurations for data entity extraction; and optimize the graph generation process. At the same time, manage the extracted database graph results in a visualization manner and display the extracted concept graph and entity graph in a multi-level visualization manner. The database access steps include: Database connection management sub-steps: Create database connection entries, manage the connection list and check the connection status. For databases that have been successfully connected, you can choose to classify and identify the forms within the database. Form classification and identification sub-step: Based on the database form structure, the database forms are divided into seven categories according to built-in rules, including dictionary tables, related tables, dynamic tables, entity tables, extended tables, sub-tables and others; Based on the way forms are associated, database form relationships can be divided into two main categories: primary and foreign key relationships and related table relationships. Based on the preliminary processing of the above form information, we have prepared the basic data conversion for the realization of form graphing.
7. The knowledge graph construction method based on relational databases according to claim 6, characterized in that, The knowledge graph construction steps include: Concept extraction sub-steps: First, a graph space is created as a container for the graph to be generated. Then, a specified database source is selected for database graph generation, supporting graph generation from a single source database and graph integration from multiple databases. For entity table types in the database, they are identified as graph concept candidates, and the identified entity tables are automatically constructed as concept nodes. The form name serves as the concept node name, and the form fields serve as concept node attributes. For other types of forms, a manual selection of the construction method is provided, and the user-selected forms are constructed as graph concept nodes. For any two entity tables in the same database, the identified primary and foreign key relationships and related table relationships between the tables are constructed as graph concept relationships. A function to manually add primary and foreign key relationships and related table relationships between forms is provided to supplement the relationships in the already constructed concept graph, realizing the construction of a concept graph based on form information. Through the generated concept graph, a panoramic view of the form distribution relationships in the selected database can be obtained. Data instance extraction sub-step: Provides a function to extract data instances based on concept nodes. The known concept node is the form. Based on the concept node information, the subordinate data entries of the form are obtained, and each data entry is a subordinate entity node of the corresponding concept node. It allows users to manually select the content of specified fields in the form as the display name of the entity node, and the data content of the remaining fields is used as the attribute value of the entity node. The entity node is a subordinate node of the concept node and fully inherits the relationship between concept nodes. Each entity node will be effectively associated and displayed according to its own primary and foreign keys. Integration steps: Perform entity integration. At the conceptual entity level, conceptual entities generated by two forms with the same table structure are treated as the same entity and integrated. The same table structure means that the two forms have the same number of attribute fields and the field names are consistent. For data entities, only data entities belonging to the two integrated conceptual entities are unified and assigned to the integrated conceptual entity. At the same time, the relevant entity relationships are merged and updated.
8. The knowledge graph construction method based on relational databases according to claim 6, characterized in that, The map editing and display steps include: The graph editing sub-steps provide a visual interface for the graph transformation results of the database, allow editing of the generated graphs, and offer process configuration options for the data entity extraction process. Specifically: Add Node: Provides the function of adding graph nodes, allowing you to add entity nodes of a specified type and name to the graph; Add Relationship: Provides the function of adding relationships between graph nodes, establishing a connection between two selected entity nodes; Node deletion: Provides a graph node deletion function to delete selected entity nodes in the graph; Relationship deletion: Provides the function of deleting relationships between graph nodes, which can delete the selected node relationships in the graph; Node editing: Provides the ability to edit graph nodes, allowing modification of the name of a specified entity node; Relationship editing: Provides editing functionality for graph node relationships, allowing modification of the names of specified entity relationships; Data entity extraction configuration: Before data entity extraction, the data entity name field can be manually configured; a manual configuration function for data entity hierarchy is provided, allowing the selection of one or more different fields as intermediate layer entities; a manual conversion configuration for the data entity dictionary is provided, mapping dictionary code values in data entries to valid values; The graph visualization sub-step involves providing a visual interface for the graph transformation results from the database, allowing for multi-dimensional viewing of the generated graphs. Specifically: Click the zoom in, zoom out, or restore buttons to adjust the size of the displayed graph; Hovering the mouse over a node on the graph will automatically highlight that node and its associated nodes; Choose from four node types: Concept, Category, Data, and Custom, and display Concept nodes and Data nodes separately or in combination.
Citation Information
Patent Citations
Knowledge graph construction method and device based on structural data
CN104462501A
Method, server and storage medium for constructing knowledge graph from unstructured information
CN115795056B
Geographic knowledge graph construction method and device, terminal and storage medium
CN115878818A
Method for extracting relationship between entities of relational database
CN115114379A
Complex equipment knowledge graph cold start method based on relation model conversion
CN116187441A