A knowledge graph construction and reasoning method, system, device and storage medium
Patent Information
- Application Number
- CN202611065332.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-10-09
AI Technical Summary
[0006]本发明提供了一种知识图谱构建与推理方法、系统、设备及存储介质,旨在解决上述现有技术中存在的属性图模型语义表达能力不足,难以支撑复杂领域建模和推理;以及RDF/OWL语义模型复杂度高、落地难度大,难以适应工业级大规模场景的技术问题
1.本发明继承了LPG结构简单的特点,使得知识图谱的构建可以直接利用现有的大数据生态组件,降低了存储和计算成本。同时,相比于RDF/OWL复杂的本体建模,SPG的语义模型更符合人类自然思维,使得业务专家可以直接参与模型定义,显著降低了沟通成本和维护成本。
Smart Images

Figure CN122886760A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of knowledge graph technology, and in particular relates to a method, system, device and storage medium for knowledge graph construction and reasoning. Background Technology
[0002] Event knowledge graphs, as a form of knowledge representation oriented towards dynamic events and logical processes, have become a research hotspot in recent years. Using events as core nodes, event knowledge graphs construct logical networks through causal, sequential, and conditional relationships between events. These networks are used to characterize the evolution of events and their spatiotemporal logic, and have significant value in fields such as public opinion analysis, financial risk control, and public safety.
[0003] In existing technologies, knowledge graph construction techniques mainly fall into two categories. One category is attribute graph (LPG)-based knowledge graph construction and querying techniques. This type of approach uses attribute graphs as the core data model, with typical implementations including graph databases such as Neo4j. The construction process typically involves extracting entities and relationships from relational databases, log files, or data warehouses; mapping structured records to nodes and edges using ETL tools or graph import tools; and establishing indexes in the graph database to support pattern matching and path queries using graph query languages such as Cypher and Gremlin. The other category is RDF / OWL-based semantic knowledge graph construction and reasoning techniques. This type of approach is based on the W3C's RDF and OWL standards, constructing semantic knowledge graphs using triples and ontology languages.
[0004] The existing technology has the following technical problems: 1. The semantic expressive power of the Attribute Graph (LPG) model is insufficient, making it difficult to support complex domain modeling and reasoning: The types of nodes and edges mainly rely on string labels or enumeration values, lacking formal schema definitions. This leads to inconsistent modeling methods for the same business concept in different systems, making it difficult to achieve cross-system knowledge sharing. Although support for relation attributes (such as the validity time, source, and confidence level of relations) exists, there is a lack of a unified semantic constraint mechanism, making it difficult to guarantee data quality and impossible to perform automatic verification and reasoning based on a unified semantic model.
[0005] 2. RDF / OWL semantic models are complex and difficult to implement, making them unsuitable for large-scale industrial scenarios: The triple model results in fragmented data storage, leading to low query and computation efficiency on large-scale graphs, especially in scenarios involving multi-hop associations and graph analysis, where performance issues are particularly prominent; OWL ontology design and maintenance require high formal logic and semantic technical capabilities, making it difficult for business experts to directly participate in modeling, resulting in a disconnect between the ontology and business practices, and model updates lagging behind business changes. Summary of the Invention
[0006] This invention provides a knowledge graph construction and reasoning method, system, device, and storage medium, aiming to solve the technical problems in the prior art, such as insufficient semantic expression capability of attribute graph models, which makes it difficult to support complex domain modeling and reasoning; and the high complexity and difficulty in implementation of RDF / OWL semantic models, which make them difficult to adapt to large-scale industrial scenarios.
[0007] The technical solution of this invention to solve the above-mentioned technical problems is as follows: A knowledge graph construction and reasoning method, comprising: Obtain pre-input business logic, and construct an SPG semantic model based on the business logic; wherein, the SPG semantic model is used to define the attribute graph rules of the knowledge graph, and the attribute graph rules include structural rules and semantic rules; Obtain multi-source heterogeneous data to be processed, and map the multi-source heterogeneous data based on the attribute graph rules to obtain standardized graph data; The standardized graph data is stored in a graph database in the form of attribute graphs, and a search index is established; Based on the attribute graph rules of the SPG semantic model, logical reasoning is performed on the stored standardized graph data to obtain the reasoning result; Based on the reasoning results, the standardized atlas data is supplemented to obtain the resulting atlas data.
[0008] Furthermore, the SPG semantic model described above is used to define the attribute graph rules for knowledge graphs as follows: Define entity types, event types, and concept types, as well as the logical relationships between these types, and define attribute constraints for each type; wherein, the entity type is used to define objects, implemented through unique identifiers and attribute sets; the event type is used to define action changes or state changes that occur; and the concept type is used to define classification systems or domain knowledge.
[0009] Furthermore, the above-mentioned mapping of the multi-source heterogeneous data based on the attribute graph rules to obtain standardized map data specifically involves: The multi-source heterogeneous data is divided into structured data and unstructured data; For the structured data, using the configured mapping rules, a row of records in the data table is mapped to an SPG node, and fields are mapped to SPG node attributes. For the unstructured data, natural language processing methods are used to extract entities, relationships, and events from the unstructured data and transform them into constraint knowledge that conforms to the rules of attribute graphs. Knowledge fusion is performed on all the aforementioned constraint knowledge to obtain standardized graph data.
[0010] Furthermore, storing the standardized map data in the form of attribute maps specifically involves: The standardized graph data is stored in the form of a label attribute graph (LPG); wherein, based on the type defined by the SPG semantic model, type information is used as the label of the node, and attribute information is used as the property of the node.
[0011] Furthermore, the above-mentioned data supplementation of the standardized atlas data based on the reasoning results specifically includes: Nodes that are subclasses in the reasoning results inherit all attributes and relationships of the parent class nodes.
[0012] Furthermore, the above-mentioned data supplementation of the standardized atlas data based on the reasoning results specifically includes: Obtain the unstructured data output by the inference results; Based on the concept mounting method, the unstructured data is matched with a preset concept library to obtain matching concept words; The matched concept words are attached to the corresponding standard concept nodes.
[0013] Furthermore, after obtaining the resulting spectral data, the process also includes: It provides a standardized query language, SPGQL, and an application programming interface (API) for upper-layer business applications.
[0014] Secondly, to solve the above-mentioned technical problems, the present invention also provides a knowledge graph construction and reasoning system, including: The model building module is used to acquire pre-input business logic and construct an SPG semantic model based on the business logic; wherein, the SPG semantic model is used to define the attribute graph rules of the knowledge graph, and the attribute graph rules include structural rules and semantic rules; The data mapping module is used to acquire multi-source heterogeneous data to be processed, and to map the multi-source heterogeneous data based on the attribute graph rules to obtain standardized graph data. The data storage module is used to store the standardized graph data in the form of attribute graphs in the graph database and to establish a search index; The logical reasoning module is used to perform logical reasoning on the stored standardized graph data based on the attribute graph rules of the SPG semantic model to obtain the reasoning results; The data supplementation module is used to supplement the standardized map data according to the reasoning results to obtain the result map data.
[0015] Thirdly, in order to solve the above-mentioned technical problems, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the knowledge graph construction and reasoning method of the present application.
[0016] Fourthly, in order to solve the above-mentioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the knowledge graph construction and reasoning method of the present application.
[0017] Compared with the prior art, the present invention has the following advantages: 1. This invention inherits the simple structure of LPG, allowing knowledge graph construction to directly utilize existing big data ecosystem components, reducing storage and computing costs. Furthermore, compared to the complex ontology modeling of RDF / OWL, SPG's semantic model is more in line with natural human thinking, enabling business experts to directly participate in model definition, significantly reducing communication and maintenance costs.
[0018] 2. This invention introduces a multi-dimensional modeling mechanism of "entities, events, and concepts," which solves the problem that traditional knowledge graphs struggle to express dynamic events and abstract concepts. While retaining the efficient query capabilities of LPG, it introduces the semantic constraints and reasoning mechanisms of RDF, enabling the knowledge graph to not only store data but also perform logical reasoning like humans (such as risk transmission and causal relationship deduction), thus improving the intelligence level of the knowledge graph.
[0019] 3. The attribute graph semantic model defined in this invention framework can uniformly process structured data (such as database tables) and semi-structured / unstructured data (such as text logs). Through standardized schema constraints, it solves the "siloed" construction problem in data governance, realizes semantic alignment and fusion of multi-source heterogeneous data, and provides a high-quality knowledge foundation for upper-layer applications.
[0020] Other features and advantages of the invention will be set forth in the following description, and some features and advantages will be apparent upon reading the description or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A flowchart illustrating a knowledge graph construction and reasoning method according to an embodiment of the present invention is shown; Figure 2 A schematic diagram of the structure of a knowledge graph construction and reasoning system according to an embodiment of the present invention is shown; Figure 3 A schematic diagram of an electronic device structure according to an embodiment of the present invention is shown. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] Figure 1 A flowchart illustrating a knowledge graph construction and reasoning method according to an embodiment of the present invention is shown, such as... Figure 1 As shown, an embodiment of the present invention provides a knowledge graph construction and reasoning method, comprising: Obtain pre-input business logic, and construct an SPG semantic model based on the business logic; wherein, the SPG semantic model is used to define the attribute graph rules of the knowledge graph, and the attribute graph rules include structural rules and semantic rules; Obtain multi-source heterogeneous data to be processed, and map the multi-source heterogeneous data based on the attribute graph rules to obtain standardized graph data; The standardized graph data is stored in a graph database in the form of attribute graphs, and a search index is established; Based on the attribute graph rules of the SPG semantic model, logical reasoning is performed on the stored standardized graph data to obtain the reasoning result; Based on the reasoning results, the standardized atlas data is supplemented to obtain the resulting atlas data.
[0025] Optionally, the SPG semantic model is used to define the attribute graph rules of the knowledge graph as follows: Define entity types, event types, and concept types, as well as the logical relationships between these types, and define attribute constraints for each type; wherein, the entity type is used to define objects, implemented through unique identifiers and attribute sets; the event type is used to define action changes or state changes that occur; and the concept type is used to define classification systems or domain knowledge.
[0026] In this embodiment, event types inherit from the base event class and are associated with participant entities, possessing attributes such as time and location. Concept types support hierarchical inheritance relationships and are used to construct a standardized thesaurus. During the SPG semantic model (SPG Schema) modeling process, the LPG "tag" mechanism is used to mark node types, while the RDF "schema constraint" mechanism is introduced to define attribute type constraints (such as integer, string), value constraints (such as enumerated values, range), and the domain and range of relations.
[0027] Optionally, the standardized map data is obtained by mapping the multi-source heterogeneous data based on the attribute graph rules as follows: The multi-source heterogeneous data is divided into structured data and unstructured data; For the structured data, using the configured mapping rules, a row of records in the data table is mapped to an SPG node, and fields are mapped to SPG node attributes. For the unstructured data, natural language processing methods are used to extract entities, relationships, and events from the unstructured data and transform them into constraint knowledge that conforms to the rules of attribute graphs. Knowledge fusion is performed on all the aforementioned constraint knowledge to obtain standardized graph data.
[0028] In this embodiment, the multi-source heterogeneous data sources include databases, logs, and documents. Entity recognition and relation extraction are performed using pre-trained language models (such as LLM), and the extraction results are instantiated according to the types defined in the schema to ensure that the data entering the graph conforms to semantic constraints.
[0029] Optionally, storing the standardized spectral data in the form of an attribute graph specifically involves: The standardized graph data is stored in the form of a label attribute graph (LPG); wherein, based on the type defined by the SPG semantic model, type information is used as the label of the node, and attribute information is used as the property of the node.
[0030] In this embodiment, an attribute graph is used for storage, which significantly improves the performance of multi-hop queries. Simultaneously, an inverted index is built to support efficient attribute filtering.
[0031] Optionally, supplementing the standardized atlas data based on the inference results specifically involves: Nodes that are subclasses in the reasoning results inherit all attributes and relationships of the parent class nodes.
[0032] In this embodiment, new relationships that are not directly stated in the data but logically exist are discovered through the implicit relationships in the reasoning.
[0033] Optionally, supplementing the standardized atlas data based on the inference results specifically involves: Obtain the unstructured data output by the inference results; Based on the concept mounting method, the unstructured data is matched with a preset concept library to obtain matching concept words; The matched concept words are attached to the corresponding standard concept nodes.
[0034] In this embodiment, SPG's unique "concept mounting" mechanism is used to automatically map unstructured expressions in the text to standard concept nodes, solving the synonym problem and forming knowledge completion. This ensures the rigor and consistency of the graph data.
[0035] Optionally, after obtaining the resulting spectral data, the following may also be included: It provides a standardized query language, SPGQL, and an application programming interface (API) for upper-layer business applications.
[0036] In this embodiment, upper-layer business applications query explicit knowledge and obtain inferred implicit knowledge by calling the query language SPGQL and the application programming interface (API) to obtain the resulting graph data. The query language SPGQL provides query services. SPGQL supports hybrid queries, including both graph traversal (LPG advantage) and semantic filtering and logical reasoning (RDF advantage).
[0037] Based on and Figure 1 Using the same principle as the method shown, this embodiment of the invention also provides a knowledge graph construction and reasoning system, such as... Figure 2 As shown, it includes: The model building module is used to acquire pre-input business logic and construct an SPG semantic model based on the business logic; wherein, the SPG semantic model is used to define the attribute graph rules of the knowledge graph, and the attribute graph rules include structural rules and semantic rules; The data mapping module is used to acquire multi-source heterogeneous data to be processed, and to map the multi-source heterogeneous data based on the attribute graph rules to obtain standardized graph data. The data storage module is used to store the standardized graph data in the form of attribute graphs in the graph database and to establish a search index; The logical reasoning module is used to perform logical reasoning on the stored standardized graph data based on the attribute graph rules of the SPG semantic model to obtain the reasoning results; The data supplementation module is used to supplement the standardized map data according to the reasoning results to obtain the result map data.
[0038] The knowledge graph construction and reasoning system of this invention can execute the knowledge graph construction and reasoning method provided in this invention. The implementation principle is similar. The actions performed by each module and unit in the knowledge graph construction and reasoning system of each embodiment of this invention correspond to the steps in the knowledge graph construction and reasoning method of each embodiment of this invention. For detailed functional descriptions of each module of the knowledge graph construction and reasoning system, please refer to the descriptions in the corresponding knowledge graph construction and reasoning methods shown above. They will not be repeated here.
[0039] The aforementioned knowledge graph construction and reasoning system can be a computer program (including program code) running on a computer device, such as an application software; the application software can be used to execute the corresponding steps in the method provided in the embodiments of the present invention.
[0040] The modules described in the embodiments of the present invention can be implemented in software or hardware. The names of the modules are not, in some cases, limiting the scope of the module itself.
[0041] Based on the same principles as the methods shown in the embodiments of the present invention, the embodiments of the present invention also provide an electronic device, which may include, but is not limited to: a processor and a memory; the memory for storing computer programs; and the processor for executing the methods shown in any embodiment of the present invention by invoking the computer programs.
[0042] In one alternative embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3 The illustrated electronic device includes a processor and a memory. The processor and memory are connected, for example, via a bus. Optionally, the electronic device may also include a transceiver, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver is not limited to one unit, and the structure of this electronic device does not constitute a limitation on the embodiments of the present invention.
[0043] The memory stores application code (computer program) that executes the present invention, and its execution is controlled by a processor. The processor executes the application code stored in the memory to implement the content shown in the foregoing method embodiments.
[0044] Among these, electronic devices can also be terminal devices. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0045] This invention provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content in the aforementioned method embodiments.
[0046] According to another aspect of the present invention, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various embodiments described above.
[0047] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.
[0048] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
Claims
1. A knowledge graph construction and reasoning method, characterized in that, The method includes: Obtain pre-input business logic, and construct an SPG semantic model based on the business logic; wherein, the SPG semantic model is used to define the attribute graph rules of the knowledge graph, and the attribute graph rules include structural rules and semantic rules; Obtain multi-source heterogeneous data to be processed, and map the multi-source heterogeneous data based on the attribute graph rules to obtain standardized graph data; The standardized graph data is stored in a graph database in the form of attribute graphs, and a search index is established; Based on the attribute graph rules of the SPG semantic model, logical reasoning is performed on the stored standardized graph data to obtain the reasoning result; Based on the reasoning results, the standardized atlas data is supplemented to obtain the resulting atlas data.
2. The knowledge graph construction and reasoning method according to claim 1, characterized in that, The SPG semantic model is used to define the attribute graph rules of the knowledge graph as follows: Define entity types, event types, and concept types, as well as the logical relationships between these types, and define attribute constraints for each type; wherein, the entity type is used to define objects, implemented through unique identifiers and attribute sets; the event type is used to define action changes or state changes that occur; and the concept type is used to define classification systems or domain knowledge.
3. The knowledge graph construction and reasoning method according to claim 1, characterized in that, Based on the attribute graph rules, the multi-source heterogeneous data is mapped to obtain standardized graph data, specifically as follows: The multi-source heterogeneous data is divided into structured data and unstructured data; For the structured data, using the configured mapping rules, a row of records in the data table is mapped to an SPG node, and fields are mapped to SPG node attributes. For the unstructured data, natural language processing methods are used to extract entities, relationships, and events from the unstructured data and transform them into constraint knowledge that conforms to the rules of attribute graphs. Knowledge fusion is performed on all the aforementioned constraint knowledge to obtain standardized graph data.
4. The knowledge graph construction and reasoning method according to claim 2, characterized in that, The standardized atlas data is stored in the form of an attribute graph, specifically as follows: The standardized graph data is stored in the form of a label attribute graph (LPG); wherein, based on the type defined by the SPG semantic model, type information is used as the label of the node, and attribute information is used as the property of the node.
5. The knowledge graph construction and reasoning method according to claim 1, characterized in that, The data supplementation of the standardized atlas data based on the inference results specifically involves: Nodes that are subclasses in the reasoning results inherit all attributes and relationships of the parent class nodes.
6. The knowledge graph construction and reasoning method according to claim 1, characterized in that, The data supplementation of the standardized atlas data based on the inference results specifically involves: Obtain the unstructured data output by the inference results; Based on the concept mounting method, the unstructured data is matched with a preset concept library to obtain matching concept words; The matched concept words are attached to the corresponding standard concept nodes.
7. The knowledge graph construction and reasoning method according to claim 1, characterized in that, After obtaining the resulting spectral data, the following is also included: It provides a standardized query language, SPGQL, and an application programming interface (API) for upper-layer business applications.
8. A knowledge graph construction and reasoning system, characterized in that, include: The model building module is used to acquire pre-input business logic and construct an SPG semantic model based on the business logic; wherein, the SPG semantic model is used to define the attribute graph rules of the knowledge graph, and the attribute graph rules include structural rules and semantic rules; The data mapping module is used to acquire multi-source heterogeneous data to be processed, and to map the multi-source heterogeneous data based on the attribute graph rules to obtain standardized graph data. The data storage module is used to store the standardized graph data in the form of attribute graphs in the graph database and to establish a search index; The logical reasoning module is used to perform logical reasoning on the stored standardized graph data based on the attribute graph rules of the SPG semantic model to obtain the reasoning results; The data supplementation module is used to supplement the standardized map data according to the reasoning results to obtain the result map data.
9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method of any one of claims 1-7.
10. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the method of any one of claims 1-7.