Method and apparatus for guiding semantic propagation by enhancing generated ontology for image retrieval
Patent Information
- Application Number
- CN202611055105.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-09-25
AI Technical Summary
静态本体难以适应知识图谱动态变化,而完全无约束的知识构建又可能引入大量噪声和语义不一致问题
[0015]本公开将本体语义约束直接嵌入图传播过程,相关性信息不再单纯沿拓扑连接度扩散,而是同时受关系语义相关性和实体类型兼容性的定向约束。这有效抑制了高连接度桥接节点对传播方向的支配作用,避免了关键证据在稠密子图中的稀释问题,使多跳推理的证据链更加完整,检索结果的语义精准度显著提升。
Smart Images

Figure CN122819249A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer science, and more particularly to an ontology-guided semantic propagation method and apparatus for graph retrieval augmented generation (RAG). Background Technology
[0002] Large Language Models (LLMs) have demonstrated superior capabilities in natural language understanding and generation tasks, but they still face challenges in knowledge-intensive tasks such as illusion generation, knowledge obsolescence, and insufficient reasoning reliability. Retrieval-Augmented Generation (RAG) alleviates these problems to some extent by introducing external knowledge sources to provide factual basis for the generation process. However, most existing RAG systems still primarily employ text block retrieval based on vector similarity, lacking explicit modeling of knowledge structures and semantic relationships.
[0003] In recent years, researchers have begun to extend the retrieval process from traditional text block retrieval to structured knowledge-enhanced retrieval, driving the development of Graph RAG methods. Graph RAG organizes knowledge evidence through entities, relations, and graph structures, enabling the retrieval process to utilize the associated paths in the graph, thus more effectively supporting multi-hop reasoning tasks. However, most current Graph RAG methods still primarily rely on graph connectivity, node similarity, and entity co-occurrence statistics during the retrieval phase. In dense knowledge graphs, some highly connected bridging entities (such as well-known figures or institutions) connect a large number of semantically unrelated nodes. When the graph propagation process lacks effective constraints, relevant information can easily diffuse along structural connections to semantically mismatched nodes, causing the propagation process to favor graph structure popularity rather than user query intent, thereby diluting key relational information and reducing the effectiveness of multi-hop reasoning.
[0004] Ontology provides semantic constraints for knowledge graphs, including entity types, domain and range restrictions for relations, and concept hierarchy. For example, "bee" belongs to "Hymenoptera," "Hymenoptera" belongs to "Insecta," and "Insecta" belongs to "Arthropoda." Such concept inheritance relationships can be modeled using ontology. However, existing ontology-enhanced RAG methods typically only use ontology for query expansion, candidate filtering, or post-retrieval validation, and rarely participate directly in modeling propagation mechanisms.
[0005] Meanwhile, real-world knowledge graphs are constantly evolving, with new entity types, new relational patterns, and new knowledge structures emerging continuously. Static ontologies struggle to adapt to the dynamic changes in knowledge graphs, while completely unconstrained knowledge construction may introduce significant noise and semantic inconsistencies. Therefore, a graph retrieval mechanism that balances semantic constraints with dynamic evolution capabilities is needed. Summary of the Invention
[0006] This disclosure provides an ontology-guided semantic propagation method for graph retrieval augmented generation (RAG), comprising the following steps: acquiring a natural language query input by a user, and performing semantic modeling on the natural language query to parse and obtain query candidate entities, query candidate relations, and query candidate types; calculating the initial activation scores of entity nodes in the graph based on the query candidate entities, query candidate types, and type constraint information in a pre-built ontology storage module, and constructing an ontology-aware seed distribution; reconstructing the edge weights in the knowledge graph based on the query candidate relations, query candidate types, and relation signatures and type hierarchy in the ontology storage module to obtain a query-aware transition matrix; performing ontology-constrained semantic propagation on the knowledge graph based on the ontology-aware seed distribution and the query-aware transition matrix until convergence is achieved, obtaining the steady-state distribution of each node; sorting the evidence nodes according to the steady-state distribution, and selecting target evidence to input into the generation model to generate an answer.
[0007] In some embodiments, the method further includes an offline ontology-knowledge graph co-evolution step: extracting entities, relations, and types from the original document set to construct an initial knowledge graph; normalizing the entity types of newly added entities in the initial knowledge graph, and adding entity types that cannot match existing types in the ontology to a candidate pool; using a large language model to perform semantic clustering and hierarchical inference on the types in the candidate pool, and updating the inference results to the ontology storage module; inferring semantic signatures for newly added relations, and updating the knowledge graph after verification based on ontology consistency constraints.
[0008] In some embodiments, constructing the ontology-aware seed distribution includes: calculating the entity link confidence and basic retrieval signal between the query and entity nodes in the graph; calculating the type compatibility score between the type label of the entity node and the candidate query type; and obtaining the initial activation score by weighted calculation based on the entity link confidence, basic retrieval signal and type compatibility score, so that entities that simultaneously satisfy query relevance and type consistency receive higher initial weights.
[0009] In some embodiments, reconstructing the edge weights in the knowledge graph to obtain a query-aware transition matrix includes: calculating the semantic similarity between the relation type of the edge in the graph and the query candidate relation to obtain relation coefficients; evaluating the compatibility of the head entity and tail entity types of the edge with the query candidate type and the relation domain and value range in the ontology to obtain type coefficients; and fusing the original edge weights with the relation coefficients and the type coefficients to obtain transition weights in the query-aware transition matrix to suppress the propagation of semantically mismatched paths.
[0010] In some embodiments, the execution of ontology-constrained semantic propagation employs a personalized PageRank algorithm for iterative calculation. The iterative formula introduces a restart coefficient, which ensures that a preset proportion of the ontology-aware seed distribution is retained in each round of propagation to maintain consistency between the propagation process and the user's query intent.
[0011] Another embodiment of this disclosure provides an ontology-guided semantic propagation apparatus for graph retrieval-enhanced generation, comprising: a query semantic modeling module for acquiring a natural language query input by a user and parsing it to obtain query candidate entities, query candidate relations, and query candidate types; a seed distribution construction module for constructing an ontology-aware seed distribution based on the query candidate entities, query candidate types, and type constraint information in a pre-built ontology storage module; an edge weighting module for reconstructing edge weights in a knowledge graph based on the query candidate relations, query candidate types, and relation signatures and type hierarchy in the ontology storage module to obtain a query-aware transition matrix; a semantic propagation module for performing ontology-constrained semantic propagation on the knowledge graph based on the ontology-aware seed distribution and the query-aware transition matrix to obtain a steady-state distribution of each node; and an answer generation module for selecting target evidence and generating an answer based on the steady-state distribution.
[0012] In some embodiments, the apparatus further includes an ontology-knowledge graph co-evolution module, which includes: an entity type normalization submodule for performing type matching and normalization processing on newly added entities; a type hierarchy inference submodule for performing semantic clustering and subclass-parent class induction on emerging types using a large language model, and updating the ontology; and a relation signature inference submodule for inferring the domain and value range of newly added relations and performing consistency verification.
[0013] In some embodiments, the seed distribution construction module is specifically used to: calculate the entity link confidence and type compatibility score of entity nodes; and superimpose the type compatibility score as an enhancement signal onto the basic retrieval signal to generate the ontology-aware seed distribution, so as to achieve semantic control at the propagation source.
[0014] In some embodiments, the edge weighting module includes: a relation-aware weighting submodule, used to construct a relation weight matrix based on relation semantic similarity; a type consistency evaluation submodule, used to construct a type consistency matrix based on the degree of matching between entity type and relation domain and value range; and a joint weighting submodule, used to fuse the relation weight matrix and the type consistency matrix to dynamically adjust the edge transfer weights.
[0015] This disclosure directly embeds ontology semantic constraints into the graph propagation process. Relevance information no longer simply diffuses along topological connectivity, but is simultaneously constrained by both relational semantic relevance and entity type compatibility. This effectively suppresses the dominance of high-connectivity bridging nodes on the propagation direction, avoids the dilution of key evidence in dense subgraphs, makes the evidence chain for multi-hop reasoning more complete, and significantly improves the semantic accuracy of the retrieval results. Attached Figure Description
[0016] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0017] Figure 1 A schematic flowchart of an ontology-guided semantic propagation method for graph-oriented retrieval enhancement generation (RAG) is shown according to some embodiments.
[0018] Figure 2 A comparison of some existing technical solutions with the methods of this disclosure is shown.
[0019] Figure 3 Another schematic flowchart of an ontology-guided semantic propagation method for graph retrieval enhancement generation (RAG) according to some embodiments is shown.
[0020] Figure 4 An explanatory diagram is shown illustrating an ontology-guided semantic propagation method for graph-oriented retrieval enhancement generation (RAG) according to some embodiments.
[0021] Figure 5 Another schematic flowchart of an ontology-guided semantic propagation method for graph retrieval enhancement generation (RAG) according to some embodiments is shown.
[0022] Figures 6A to 6C The following are comparisons of retrieval metrics on the hotpot1000 dataset using various methods according to some embodiments: Figure 6A Corresponding to recall@3, Figure 6B Corresponding to F1@3, Figure 6C Corresponding to MAP@3.
[0023] Figure 7 The paper presents a comparison of question-answering metrics on the hotpot1000, popqa1000, and triviaqa1000 datasets using various methods according to some embodiments, with the best results highlighted in bold and the second-best results underlined. Detailed Implementation
[0024] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0025] It should be understood that the various steps described in the method embodiments of this disclosure can be performed in sequence and / or in parallel. Furthermore, method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0026] The terminology used herein, including but not limited to, is open-ended. The term "based on" is at least partially based on. The term "one embodiment" refers to at least one embodiment; the term "another embodiment" refers to at least one additional embodiment; the term "some embodiments" refers to at least some embodiments. Relevant definitions for other terms will be given in the description below.
[0027] It should be noted that the concepts of "first," "second," etc., mentioned in this disclosure are used only to distinguish different devices, modules, or units, and are not used to define the order of functions performed by these devices, modules, or units or their interdependencies.
[0028] It should be noted that any modification mentioned in this disclosure is illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, it should be understood as one or more.
[0029] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0030] Existing Retrieval Enhancement Generation (RAG) technologies can be categorized into four main types based on their technological evolution: dense text retrieval RAG, hierarchical structure-aware RAG, graph-enhanced RAG, and ontology-enhanced RAG. The following section provides a complete explanation of these RAG technologies, including their architectural principles, representative literature, and inherent limitations.
[0031] Traditional Dense Text Retrieval (RAG) Dense text retrieval (RAG), represented by DPR, REALM, and the basic RAG framework, establishes a classic retrieval-generation paradigm. The overall process involves receiving a user query, using a dense retrieval vector retrieval tool to transform the query and knowledge base text fragments into low-dimensional vectors, relying on vector similarity matching to recall the most relevant text paragraphs, and then using the recalled paragraphs as context input to a large language model to generate the answer. However, its core limitations are very prominent: the basic unit of retrieval is only an independently segmented text block, which naturally severs the internal entity relationships within the text, making it impossible to explicitly model the relationships between entities and multi-hop logical dependencies. It relies solely on shallow text semantic matching to complete the retrieval, and is prone to losing the reasoning link when facing complex problems that require multi-step logical deduction.
[0032] Hierarchical / Structure-Aware RAG RAPTOR, proposed in 2024, introduces a hierarchical summary tree structure on top of the dense text retrieval RAG. In the preprocessing stage, it recursively clusters all documents and generates summaries layer by layer, building a tree-like architecture from the top-level coarse-grained summary to the bottom-level original text. After query input, it prioritizes matching the top-level summary to quickly locate relevant subtrees, then delves deeper layer by layer to filter effective text fragments at the bottom level before sending them to the large model to generate a response. This approach relies on hierarchical summarization to achieve coarse-grained simplification of long texts, effectively reducing the recall of irrelevant text. However, the entire structure of the hierarchical tree is generated solely from text semantic similarity clustering, lacking constraints from real-world entities and business relationships. The tree structure only optimizes the granularity of text recall rather than knowledge logic, and it cannot constrain or control effective relationship paths in multi-hop reasoning processes, making it difficult to support complex knowledge association derivation.
[0033] Graph retrieval enhancement generation method Typical solutions for graph-enhanced RAG include GraphRAG, LightRAG, and HippoRAG2. These technologies introduce entity relationship knowledge graphs into the retrieval process. The preprocessing stage extracts entities and semantic relationships between entities from the original documents to construct the graph structure. GraphRAG relies on community detection and graph summarization to achieve query focusing, LightRAG uses a lightweight graph structure to reduce construction and retrieval overhead, and HippoRAG2 builds the graph using phrase and paragraph nodes and completes evidence association through graph message propagation. In actual operation, it starts from the seed entity node associated with the query and performs diffusion retrieval along the graph edges, collecting the associated documents bound to the graph nodes and inputting them into the larger model. This solution can mine structured evidence of knowledge and supports multi-hop reasoning based on local and global graph retrieval, making up for the shortcomings of the first two pure text solutions that lack explicit relationship modeling. However, graph construction highly relies on manually heuristic rules and information extraction models, inevitably introducing extraction noise. Furthermore, in dense knowledge graphs, highly connected entity nodes easily become information diffusion hubs, generating a large number of semantically irrelevant invalid paths during propagation, interfering with retrieval effectiveness.
[0034] ontology-enhanced retrieval methods The representative work of ontology-enhanced RAG is OG-RAG. This solution improves knowledge retrieval performance by introducing entity type and relation constraints, enabling query expansion, candidate filtering, and result verification. However, existing ontology-enhanced RAGs generally treat the ontology as external auxiliary information in the retrieval process, without deeply integrating ontology semantics and constraint rules into the graph propagation retrieval stage of the knowledge graph. Furthermore, static external ontologies cannot be dynamically updated with the knowledge base and business scenarios, making it difficult to adapt to the newly added entity types and relationships during the continuous evolution of the knowledge graph. The ontology's constraint capabilities over retrieval initialization and the entire graph propagation process are insufficient.
[0035] The above schemes have some shortcomings: (1) Lack of semantic constraints in the propagation process: Existing Graph RAG methods mainly rely on graph connectivity, node similarity, or entity co-occurrence relationships for propagation. In dense knowledge graphs, some high-connectivity bridging entities (such as well-known people or institutions) will connect a large number of semantically irrelevant nodes. When the graph propagation process lacks effective constraints, relevant information is easily diffused along structural connections to semantically mismatched nodes, causing the propagation process to be biased towards graph structure popularity rather than user query intent, thereby diluting key relationship information. (2) High-level nodes cause structural bias: In complex knowledge graphs, high-level nodes are easily over-focused, leading to the introduction of a large number of semantically irrelevant paths in the propagation process, affecting retrieval accuracy and inference performance. (3) Insufficient utilization of ontology: Existing ontology-enhanced RAG methods usually only use the ontology for query expansion, candidate filtering, or post-retrieval verification, without directly integrating it into the graph propagation mechanism modeling, and cannot achieve semantic control from both the propagation source and propagation path levels. (4) Lack of dynamic evolution capability: Static ontology is difficult to adapt to the dynamic changes of knowledge graph, while completely unconstrained knowledge construction may introduce a lot of noise and semantic inconsistency problems, and lacks an effective ontology collaborative update mechanism.
[0036] Figure 2A comparison of some existing technical solutions with the method of this disclosure is shown. Addressing the problems of existing Graph RAG methods, such as over-reliance on graph structure connections, susceptibility to high-connectivity nodes, insufficient ontology utilization, and lack of dynamic evolution capabilities, this disclosure proposes an Ontology-Guided Semantic Propagation (OGSP) method for enhanced generation of evolutionary knowledge graph retrieval. This method achieves the following objectives: (1) Integrating ontology information as a control signal into both the retrieval initialization and propagation transition stages, achieving semantic constraint control from both the propagation source and propagation path levels; (2) Adjusting propagation weights through relation matching and type constraints to alleviate the structural bias problem caused by high-connectivity nodes, thereby improving the ability to rank key evidence and multi-hop reasoning performance; (3) Introducing a lightweight ontology knowledge graph co-evolution mechanism to support continuous updates of the knowledge graph in dynamic environments.
[0037] refer to Figure 1 , Figure 3 and Figure 5 The ontology-guided semantic propagation method for graph retrieval augmented generation (RAG) disclosed herein may include step S101, which involves obtaining a natural language query input by the user, performing semantic modeling on the natural language query, and parsing it to obtain query candidate entities, query candidate relations, and query candidate types. In some embodiments, the natural language query may include text queries, etc.
[0038] In some embodiments, the method of this disclosure may further include step S102, calculating the initial activation score of entity nodes in the graph based on query candidate entities, query candidate types, and type constraint information in the pre-built ontology storage module, and constructing an ontology-aware seed distribution. In some embodiments, calculating the initial activation score of entity nodes in the graph based on query candidate entities, query candidate types, and type constraint information in the pre-built ontology storage module, and constructing an ontology-aware seed distribution. In some embodiments, constructing the ontology-aware seed distribution includes: calculating the entity link confidence and basic retrieval signal between the query and entity nodes in the graph; calculating the type compatibility score between the type label of the entity node and the query candidate type; and obtaining the initial activation score through weighted calculation based on the entity link confidence, basic retrieval signal, and type compatibility score, so that entities that simultaneously satisfy query relevance and type consistency receive higher initial weights.
[0039] In some embodiments, the method of this disclosure may further include step S103, reconstructing the edge weights in the knowledge graph based on query candidate relations, query candidate types, and relation signatures and type hierarchies in the ontology storage module to obtain a query-aware transition matrix. In some embodiments, reconstructing the edge weights in the knowledge graph to obtain the query-aware transition matrix includes: calculating the semantic similarity between the relation type of the edge in the graph and the query candidate relation to obtain relation coefficients; evaluating the compatibility of the head entity and tail entity types of the edge with the query candidate type and the relation domain and value range in the ontology to obtain type coefficients; and fusing the original edge weights with the relation coefficients and the type coefficients to obtain transition weights in the query-aware transition matrix to suppress the propagation of semantically mismatched paths.
[0040] In some embodiments, the method of this disclosure may further include step S104, performing ontology-constrained semantic propagation on the knowledge graph based on the ontology-aware seed distribution and the query-aware transition matrix until convergence is achieved, obtaining the steady-state distribution of each node. In some embodiments, the ontology-constrained semantic propagation is performed using a personalized PageRank algorithm for iterative calculation, and a restart coefficient is introduced in its iterative formula to retain a preset proportion of the ontology-aware seed distribution in each round of propagation, so as to maintain the consistency between the propagation process and the user's query intent.
[0041] In some embodiments, the method of this disclosure may further include step S105, sorting the evidence nodes according to the steady-state distribution, and selecting target evidence to input into the generation model to generate a response.
[0042] Figure 4 A schematic diagram illustrating the method of this disclosure is shown. This disclosure directly embeds ontology semantic constraints into the graph propagation process. Relevance information no longer simply diffuses along topological connectivity but is simultaneously constrained by both relational semantic relevance and entity type compatibility. This effectively suppresses the dominance of high-connectivity bridging nodes on the propagation direction, avoids the dilution problem of key evidence in dense subgraphs, makes the evidence chain for multi-hop reasoning more complete, and significantly improves the semantic accuracy of retrieval results. Simultaneously, the co-evolutionary capability of the ontology and knowledge graph ensures that the semantic constraint system remains effective as the knowledge base dynamically grows, preventing the introduction of semantic inconsistencies and noise diffusion by new entity types or relational patterns. Experiments show that the above improvements bring stable performance improvements in tasks such as multi-hop question answering and long-tail entity retrieval, especially in cross-document multi-hop reasoning scenarios, where the improvement in answer accuracy and key evidence ranking quality is particularly significant.
[0043] In some embodiments, an ontology-guided semantic propagation method for graph RAG is provided, including an offline ontology-knowledge graph co-evolution step and an online query-aware semantic propagation step. The offline ontology-knowledge graph co-evolution step is used to periodically construct and maintain the knowledge graph and the ontology to ensure semantic consistency between them. The online query-aware semantic propagation step is used to, upon receiving a user query, utilize the ontology to semantically constrain the propagation process of information on the knowledge graph in order to retrieve and generate an answer. In some embodiments, the query-aware semantic propagation steps in the online phase specifically include: semantically modeling the natural language query input by the user, parsing to obtain a candidate entity set, a candidate relation set, and a candidate type set; constructing an initial seed distribution for ontology awareness based on the candidate entity set and candidate type set, combined with type constraints in the ontology; reconstructing the edge weights in the knowledge graph based on the candidate relation set and candidate type set, combined with relation signatures and type hierarchy in the ontology, to obtain a query-aware transition matrix; performing semantic propagation iterations on the knowledge graph based on the initial seed distribution and the query-aware transition matrix, until a steady-state distribution is obtained; sorting the evidence nodes in the knowledge graph according to the steady-state distribution, selecting the documents associated with the Top-k evidence nodes, and generating an answer based on the documents and returning it to the user.
[0044] In some embodiments, such as Figure 3 As shown, the method disclosed herein also includes an offline ontology-knowledge graph co-evolution step: extracting entities, relations, and types from the original document set to construct an initial knowledge graph; performing entity type normalization on newly added entities in the initial knowledge graph, and adding entity types that cannot match existing types in the ontology to a candidate pool; using a large language model to perform semantic clustering and hierarchical inference on the types in the candidate pool, and updating the inference results to the ontology storage module; inferring semantic signatures for newly added relations, and updating the knowledge graph after verification based on ontology consistency constraints.
[0045] like Figure 3As shown, the technical solution disclosed herein comprises two main parts: an offline ontology-knowledge graph co-evolution module and an online query-aware semantic propagation module. The offline phase is responsible for constructing and dynamically maintaining an ontology constraint system consistent with the semantics of the knowledge graph. The online phase is responsible for semantically regulating information propagation using ontology constraints during the retrieval process, achieving evidence retrieval and ranking aligned with query intent. The core design concept of this disclosure is to deeply embed the semantic constraint capabilities of ontology into the entire information propagation process of Graph Retrieval Augmentation (Graph RAG), rather than merely using it as an auxiliary filtering method before and after retrieval. Specifically: at the propagation starting point, the initial seed nodes are semantically weighted using the type matching degree between entity type and query intent, so that activation signals preferentially focus on semantically related entities; along the propagation path, the structural bias of indiscriminate diffusion along height nodes is suppressed by jointly constraining the transfer weights of edges using relational semantic similarity and type compatibility; in evolutionary maintenance, an incremental ontology update mechanism ensures semantic consistency during the dynamic growth of the knowledge graph.
[0046] Therefore, the OGSP system disclosed herein consists of two main components: an offline layer and an online layer. In the offline phase: knowledge extraction (entities, relations, and types from the original document) is performed on the text input using a large model, and then sequentially enters the knowledge graph storage module and ontology storage module—the ontology-knowledge graph co-evolution module—and finally the updated knowledge graph storage module and ontology storage module. This phase is executed periodically and is not required for every query. In the online phase: user queries first enter the query semantic modeling module, whose output is distributed in parallel to the seed distribution construction module and the edge weighting module; the output of the seed distribution construction module... Output of edge weighting module The semantic propagation module is the common input; the output of the semantic propagation module enters the answer generation module and is finally returned to the user.
[0047] In some embodiments, the knowledge graph storage module is used to store knowledge graphs. ,in For entity nodes and document collections, The set of relationship edges includes: entity-entity business relationship edges; entity-document association edges. Each entity is assigned a type label. Each relation edge has a semantic signature. , representing the domain (head entity type constraint) and range (tail entity type constraint) of the relation, respectively. This module is bidirectionally connected to the ontology storage module, receiving ontology constraints to verify graph consistency, and simultaneously outputting newly added entity and relation data to the ontology evolution module.
[0048] In some embodiments, the ontology storage module is used to store the ontology. ,in It is a collection of entity types (including hierarchical structure). This module represents a set of relation types (including Domain / Range constraints). It outputs type constraints, relation signatures, and hierarchical structure information to the query semantic modeling module, edge weighting module, and semantic propagation module.
[0049] In some embodiments, the ontology-knowledge graph co-evolution module includes the following sub-modules: Entity type normalization submodule: Receives new entities from the knowledge graph storage module, calculates similarity and normalizes them in the type embedding space through the nearest type match; for types that cannot be reliably aligned, they are placed into a temporary candidate pool.
[0050] Type-level inference submodule: For emerging types in the candidate pool, perform two-stage large language model-assisted inference: first, perform semantic clustering, and then perform subclass-parent class induction within each cluster; only candidate types that maintain the consistency of the directed acyclic graph (DAG) are included in the ontology.
[0051] The relation signature inference submodule infers semantic signatures for new relations based on the observed head and tail entity types. It also verifies whether the relationships satisfy ontology-level consistency constraints; only relationships that pass the verification are included in the knowledge graph.
[0052] The output of this module is a semantically consistent knowledge graph. ,in This represents the set of types, relations, and hierarchical constraints derived from the ontology.
[0053] In some embodiments, the query semantic modeling module receives a natural language query Q, parses it using a large language model, and outputs a structured semantic representation, including: a set of candidate entities. Candidate relation set Candidate type set This module outputs the above structured representation to the seed distribution construction module and the edge weight module.
[0054] In some embodiments, the seed distribution construction module is based on the output of the query semantic modeling module. Constructing the initial activation distribution of ontology perception ,satisfy Unlike traditional initialization methods based on word matching or vector similarity, OGSP leverages ontology information to enhance seed node weights, prioritizing activation signals for entities that simultaneously satisfy query relevance and type consistency. For candidate entities... Its ontology-enhanced activation score is defined as: ,in, For entity link confidence, For compatibility scores with implicit query types. The final reset distribution is: ,in, Use it as a base for retrieving signals (such as querying the relevance of a query to a triple or corpus). This is an adjustable ontology seed scaling factor. This module will... Output to the semantic propagation module.
[0055] In some embodiments, the edge weighting module receives the output of the query semantic modeling module. and The module, along with the type constraints and relation signatures output by the ontology storage module, constructs a query-aware transition matrix. This module includes: a relation-aware weighted submodule: constructing a relation weight matrix. Its elements are defined as: ,in, To prevent zero-weighted smoothing parameters, This calculates the semantic similarity between relations and queries. The type consistency evaluation submodule constructs the type consistency matrix. Its elements are defined as: in, This serves as a penalty factor. Type compatibility is evaluated at multiple levels: direct matching with the query type, consistency with the edge domain / range, and relaxed matching through subclass relations. Full weight is assigned if any condition is met; otherwise, a soft penalty is applied.
[0056] Joint weighted submodule: Combines the outputs of the above two submodules into a query-aware transition matrix. The transition weight of edge (i, j) is: ,in This represents the original edge weights. This module will... Output to the semantic propagation module.
[0057] In some embodiments, the semantic propagation module receives the output of the seed distribution construction module. The output of the edge weighting module Propagation of ontology constraint information: ,in, The restart coefficient is used. This iterative process converges to a steady-state distribution: steady-state distribution Used to sort evidence nodes and output Top-k documents as search results.
[0058] In some embodiments, the answer generation module receives the Top-k documents output by the semantic propagation module and calls the large language model to generate the final answer.
[0059] like Figure 3As shown, this disclosure presents a two-layer semantic control architecture supported by ontology. Within a graph propagation framework, it constructs a two-layer control architecture where an offline ontology semantic layer and an online query-aware layer work collaboratively. The offline layer provides global semantic constraints such as type hierarchy and relation signatures, while the online layer dynamically adjusts propagation behavior based on query semantics. The two layers achieve semantic sharing through unified ontology storage, enabling the retrieval process to simultaneously possess global consistency and query adaptability. Furthermore, this disclosure presents an integrated mechanism for query-aware ontology constraint propagation and ranking. Ontology constraints are directly embedded into the graph propagation process. The effective transition probability of edges is jointly determined by query-conditional relation weights and type compatibility weights, and evidence ranking is directly completed using the steady-state propagation results. Semantic constraints participate throughout the entire process, from path selection and weight allocation to result ranking, achieving tightly coupled integrated processing of propagation and retrieval ranking. Additionally, this disclosure presents a multi-level type-compatible flexible semantic constraint mechanism. It employs a multi-level type compatibility evaluation strategy to comprehensively match entity types with relation domains, value domains, and parent-child relationships in the concept hierarchy. Type constraints use flexible scoring rather than hard filtering, penalizing nodes that do not fully match rather than directly eliminating them, thus preserving potentially valid evidence paths while ensuring semantic consistency. Furthermore, this disclosure presents an adaptive incremental ontology maintenance mechanism, employing a lightweight incremental update approach to maintain the ontology structure. Newly added types are standardized through embedding alignment, semantic clustering, and hierarchical relationship induction. Newly added relationships are inferred from the head and tail entity types and their signatures are verified for consistency. This approach maintains the stability of the ontology structure while providing adaptive support for the continuous evolution of the knowledge graph.
[0060] To verify the effectiveness of OGSP, this paper conducts experiments on three representative knowledge-intensive question-answering datasets.
[0061] (1) PopQA: PopQA is built on Wikidata and mainly includes questions related to long-tail entities. Since a large number of questions involve low-frequency entities, it poses a high challenge to the knowledge of language model parameters. Therefore, it is suitable for evaluating retrieval capabilities in sparse knowledge scenarios.
[0062] (2) TriviaQA: TriviaQA is an open-domain question answering dataset containing a large number of natural language question answering samples and corresponding evidence documents. This dataset mainly examines fact retrieval ability and answer generation ability.
[0063] (3) HotpotQA: HotpotQA is a typical multi-hop question answering dataset that requires the model to obtain supporting evidence from multiple documents and complete reasoning. Therefore, it is particularly suitable for evaluating graph structure retrieval and multi-hop reasoning capabilities.
[0064] To ensure fair comparison, this paper adopts the same experimental setup as existing research (SelfRAG), directly using the candidate document set provided by the dataset without rebuilding the nearest neighbor index. All experiments are conducted on the first 1000 samples of each dataset.
[0065] The experiments used GPT-4o-mini and LLaMA3.3-70B as answer generation models. All methods shared the same candidate document library, the same embedding model, and the same GPT-4o-mini retrieval tool. Top-5 evidence was consistently selected as the generation context during the retrieval phase. Specifically, GPT-4o-mini was accessed via API; LLaMA3.3-70B was deployed locally via Ollama.
[0066] To comprehensively evaluate OGSP performance, the following representative methods were selected as baselines.
[0067] (1) Only-LLM: The answer is generated directly by relying solely on the knowledge of language model parameters without using external retrieval; (2) NaiveRAG: A traditional retrieval-enhanced generation method that obtains relevant documents through vector retrieval and then directly concatenates them into the generation model; (3) RAPTOR: It uses a hierarchical tree structure to organize documents and realize multi-level abstract retrieval; (4) LightRAG: Enhances the traditional RAG retrieval process by utilizing a lightweight graph structure; (5) HippoRAG2: Constructs a graph structure based on phrase nodes and paragraph nodes, and realizes evidence reasoning through graph propagation mechanism; (6) OGSP: This paper proposes a method that introduces an ontology-guided semantic propagation mechanism on the basis of graph retrieval framework.
[0068] The evaluation metrics disclosed herein include question-answering performance metrics and retrieval performance metrics. Question-answering performance metrics (evaluating the quality of the final answer): (1) QA-EM (Exact Match) measures the exact match rate between the predicted answer and the standard answer; (2) QA-F1 calculates the standardized word-level overlap; (3) Contains Accuracy determines whether the predicted answer contains the correct answer. Retrieval performance metrics (further evaluating retrieval quality for HotpotQA): (1) Recall@3 reflects the evidence coverage rate; (2) F1@3 comprehensively considers precision and recall; (3) MAP@3 measures whether key evidence is prioritized.
[0069] OGSP includes three core parameters: the volumetric enhancement factor (… ), relational smoothing parameter ( ), type penalty coefficient ( Also refer to the HippoRAG2 settings. And the local propagation radius k=3.
[0070] The parameter configurations for different datasets are shown in Table 1 below: Table 1 Dataset HotpotQA 0.5 0.5 0.2 PopQA 1.0 0.5 0.5 TriviaQA 0.3 0.1 0.7 This disclosure studies a 100-sample subset of HotpotQA. , and Sensitivity. Within a reasonable range, the performance difference is small (<1% MAP@3), indicating that the parameters are relatively robust. The selected values for HotpotQA (= 0.5, = 0.5, = 0.2) fall within this stable region. For PopQA and TriviaQA, the principle of hyperparameter selection based on dataset characteristics is as follows: PopQA, due to its long-tail characteristics, is more suitable for enhancing ontology guidance (= 1.0), while TriviaQA, due to its word overlap patterns, relies more on basic retrieval (= 0.3, = 0.1). These transfer settings have not been extensively tuned; this paper reports them as reasonable default values.
[0071] like Figures 6A to 6C As shown, the OGSP method disclosed in this paper consistently achieves the best retrieval performance across all Top-3 metrics. Specifically, OGSP achieves 90.35% Recall@3, 72.42% F1@3, and 84.63% MAP@3, surpassing all baseline methods. Compared to the strongest baseline, HippoRAG2, OGSP improves across all Top-3 retrieval metrics, including a 0.41 improvement in Recall@3, a 0.32 improvement in F1@3, and a 0.44 improvement in MAP@3. These improvements are further amplified in downstream question-answering performance, resulting in a maximum 5.2% improvement in QA-EM and a 5.96% improvement in QA-F1, indicating more accurate evidence ranking and more coherent multi-hop retrieval paths. The improvement in MAP@3 further indicates that supporting evidence is ranked more frequently, which is particularly important for downstream answer generation within a limited context window.
[0072] In addition, such as Figure 7As shown, this disclosure reports downstream question-answering performance on HotpotQA, PopQA, and TriviaQA. Under both the GPT-4o-mini and LLaMA3.3-70B generation settings, OGSP achieves the strongest overall performance on HotpotQA and PopQA, and makes a significant improvement on the reasoning-focused HotpotQA benchmark. Compared to HippoRAG2, OGSP improves QA-EM by 5.2% and QA-F1 by 5.96% on HotpotQA, indicating that ontology-guided propagation can generate more coherent early evidence ranking for multi-hop reasoning. On PopQA, OGSP consistently achieves the best fact-answering performance, suggesting that ontology-guided propagation is particularly beneficial in long-tail entity retrieval, where semantically aligned evidence should be prioritized under sparse supervision. On TriviaQA, the results demonstrate the effectiveness of matching retrieval strategies with generator capabilities. When using the smaller generator GPT4o-mini, NaiveRAG achieves the highest EM, while OGSP remains competitive on F1. However, when switching to the more powerful LLaMA3.3-70B generator, OGSP achieved the best overall results on TriviaQA, reaching 69.80% EM and 79.23% F1, surpassing all baseline methods. This indicates that OGSP's ontology-guided evidence ranking generates more semantically coherent and structurally sound contexts, and that large language models can better utilize these contexts. In contrast, NaiveRAG's lexical overlap-based retrieval strategy may offer slight improvements on smaller generators, but its effectiveness diminishes as generator capabilities increase. Overall, OGSP demonstrates robust advantages on tasks requiring inference and on long-tail benchmarks, while also achieving superior performance on TriviaQA when paired with sufficiently powerful generators.
[0073] To further illustrate the specific implementation process of the ontology-guided semantic propagation method (OGSP) for graph RAG proposed in this invention, the following description is based on three scenarios.
[0074] Regarding the main body update Prerequisites Assume the system has an ontology: ① Entity types: Scientists, theories, experiments, phenomena ② Relationship Signature Proposed: Domain = Scientist; Range = Theory Prediction: Domain = theory; Range = phenomenon Verification: Domain = Experiment; Range = Theory New knowledge triggers ontology updates New document: In 2025, the Chinese Academy of Sciences will use quantum satellite experiments to further verify the theory of general relativity.
[0075] LLM extraction results: Entities {Chinese Academy of Sciences (institution), Quantum Satellite Experiment (experiment), General Relativity (theory)} The relationship is: Chinese Academy of Sciences -> Conducting -> Quantum Satellite Experiments; Quantum satellite experiment -> verification -> general relativity} Entity type normalization The experimental theoretical types among the three entity types in the extraction results can all be matched in the initial ontology (the matching principle in this experiment is to calculate the highest embedding similarity between the extracted entity type and all types in the existing ontology; if it is greater than a certain threshold, it is matched), but the organization type yields: sim(institution, scientist) = 0.42 sim(mechanism, experiment) = 0.31 sim(mechanism, theory) = 0.49 All similarities are less than the threshold (assumed to be 0.8), so the organization type is determined to be a possible new concept and enters the candidate pool.
[0076] Type hierarchy inference For all types in the candidate pool, a clustering algorithm is executed, and LLM is used to perform subclass-parent class inference induction within each cluster (e.g., related entity types such as institutions and organizations are divided into one cluster and the large model infers that institutions -> organizations, etc.); only candidate types that maintain the consistency of the directed acyclic graph (DAG) are included in the ontology.
[0077] Relational signature inference The validation relations in the extraction results can be matched in the initial ontology, and new relations are discovered. All triples extracted for this relation are counted. Chinese Academy of Sciences (institution) -> Conducting -> Quantum Satellite Experiment (Experiment) Summarize and incorporate into the ontology: Domain = organization; Range = experiment Thus, a new entity is obtained: ① Entity types: Scientist, Theory, Experiment, Phenomenon, Institution, Organization (where Institution and Organization form a subclass-parent class hierarchy) ② Relationship Signature Proposed: Domain = Scientist; Range = Theory Prediction: Domain = theory; Range = phenomenon Verification: Domain = Experiment; Range = Theory Conduct: Domain = institution; Range = experiment Regarding seed node distribution and edge weight reconstruction Parsing user queries Question: Which experiments have verified general relativity? LLM analysis: Candidate entity set: General Relativity Candidate relation set: Validation Candidate type set: experimental, theoretical Seed initialization The retrieval score is essentially a basic retrieval score plus an ontology-enhanced activation score. The basic retrieval score is calculated based on the relevance of the query to the triples or corpus. The ontology-enhanced activation score is defined as the similarity between each node in the graph and the query candidate entity, plus the highest similarity with the query candidate type. Assume: Calculate the score for each node and truncate the top-5 nodes: General Relativity = 0.8 + sim(General Relativity, General Relativity) / sim(Theory, Theory) = 0.8 + 0.511 = 1.3 Einstein = 0.6 + sim(General Relativity, Einstein) / sim(Scientist, Experiment) = 0.6 + 0.5 + 0.7 + 0.6 = 0.81 Solar eclipse observation = 0.4 + sim(general relativity, solar eclipse observation) sim(phenomenon, theory) = 0.4 + 0.5 0.4 0.7 = 0.54 Quantum satellite experiment = 0.3 + sim(general relativity, quantum satellite experiment) sim(experiment, experiment) = 0.3 + 0.5 + 0.71 = 0.65 Light bending = 0.3 + sim(general relativity, light bending) sim(phenomenon, experiment) = 0.3 + 0.5 + 0.6 + 0.3 = 0.39 The initial seed distribution is obtained after normalization.
[0078] Construct edge weights Assuming the original image: (Solar eclipse observation, verification, general relativity) (Quantum satellite experiment, verification of general relativity) (Einstein proposed the theory of general relativity) (General relativity predicts that light will bend) Calculate the similarity between the candidate query relation and each relation in the graph: sim(verify, verify) = 1.0 sim(propose, verify) = 0.2 sim(prediction, validation) = 0.3 Relationship coefficient matrix: Assumption: get: Verify the edge relationship coefficient = 0.1 + 0.9 * 1 = 1 The proposed edge relation coefficient is 0.1 + 0.9 * 0.8 = 0.82. Predicted edge relationship coefficient = 0.1 + 0.9 * 0.6 = 0.64 Type coefficient matrix: Assumption: The result is: the verified tail entity type is theoretical and matches, therefore the verification edge type coefficient = 1. The proposed tail entity type is theoretical, matching, and the proposed edge type coefficient is 1. The predicted tail entity type is phenomenon, which is a mismatch; the predicted edge type coefficient is 0.2. Final edge weight = original edge weight, relation coefficient, and type coefficient (where the original edge weight is constructed from the number of times entities co-occur within the triple). For example: (Einstein, who proposed the theory of general relativity) = 10.821 = 0.82 (Solar eclipse observation, verification, general relativity) = 1 * 1 * 1 = 1.
[0079] On the semantic propagation process of ontology constraints This embodiment uses the following knowledge graph fragment: E1: General Relativity E2: Solar Eclipse Observation Experiment E3: Quantum Satellite Experiment E4: Einstein The correspondence is as follows: The E2E1 (verification) weight is 1.1. E3E1 (verification) weight is 1.1 E4E1 (proposed) has a weight of 0.3. Normalize each node according to its outgoing edge weights to obtain the transition probability matrix: Source node target node Transition probability E2 E1 1.0 E3 E1 1.0 E4 E1 1.0 Since each of the three nodes has only one outgoing edge, the transition probability is 1 after normalization.
[0080] Assume the seed distribution has already been calculated by the seed construction module: For each node's initial activation value, set a restart coefficient: That is, 15% of the initial query intent signal is retained after each round of propagation.
[0081] First round of transmission First, calculate the diffusion portion of the graph: The 0.33 from node E2 retains 15% of the initial query intent signal and propagates 85% along the edge to E1: 0.33 * 1.0 * 0.85 = 0.2805 The 0.31 from node E3 propagates to E1: 0.31 * 1.0 * 0.85 = 0.2635 Propagation from node E4: 01.00.85 = 0 but Continue to utilize To spread.
[0082] Second wave of transmission Since node E1 itself has no outgoing edges for further propagation, the activation value from E1 will no longer spread outwards. However, E2 and E3 will continue to pass activation values back to E1 using the method described above. .
[0083] Convergence criterion Set the convergence threshold: When the following conditions are met: The iteration stops when the propagation reaches a steady state.
[0084] Assume the final steady-state distribution: Sort by steady-state score from highest to lowest: node Steady-state score General relativity 0.904 Solar eclipse observation experiment 0.0495 Quantum satellite experiment 0.0465 Einstein 0 This explanation uses entity nodes as an example to illustrate the propagation process. In practice, each document will also participate in the propagation process as a node in the graph. Finally, the system will prioritize returning the top K related documents with the highest scores as the search results.
[0085] This disclosure directly embeds ontology semantic constraints into the graph propagation process. Relevance information no longer simply diffuses along topological connectivity but is simultaneously constrained by both relational semantic relevance and entity type compatibility. This effectively suppresses the dominance of high-connectivity bridging nodes on the propagation direction, avoids the dilution of key evidence in dense subgraphs, makes the evidence chain for multi-hop reasoning more complete, and significantly improves the semantic accuracy of retrieval results. Simultaneously, the co-evolutionary capability of the ontology and knowledge graph ensures that the semantic constraint system remains effective as the knowledge base dynamically grows, preventing the introduction of semantic inconsistencies and noise diffusion by new entity types or relational patterns. Experiments show that the above improvements bring stable performance improvements in tasks such as multi-hop question answering and long-tail entity retrieval, especially in cross-document multi-hop reasoning scenarios, where the improvement in answer accuracy and key evidence ranking quality is particularly significant.
[0086] This disclosure employs an incremental ontology maintenance strategy, performing embedding space matching and LLM-assisted semantic clustering on newly added entity types, and ontology consistency verification on newly added relationships, thereby maintaining semantic constraints during the dynamic evolution of the knowledge graph. Furthermore, this disclosure extends the traditional graph propagation process into an ontology-constrained information propagation process, achieving consistency between the propagation direction and the user query semantics through the combined action of ontology-aware seed distribution and query-aware transfer operators. Additionally, this disclosure incorporates ontology information (entity type matching degree) into the initial propagation distribution construction, prioritizing the allocation of activation signals to entities that simultaneously satisfy query relevance and type consistency, achieving semantic control from the propagation source. Moreover, this disclosure constructs a query-aware transfer matrix by jointly modeling relationship relevance and type compatibility, dynamically adjusting edge propagation weights to achieve semantic constraints at the propagation path level.
[0087] Embodiments of this disclosure also provide an ontology-guided semantic propagation apparatus for graph retrieval-enhanced generation, comprising a query semantic modeling module, a seed distribution construction module, an edge weighting module, a semantic propagation module, and an answer generation module. In some embodiments, the query semantic modeling module acquires a natural language query input by a user and parses it to obtain query candidate entities, query candidate relations, and query candidate types. In some embodiments, the seed distribution construction module constructs an ontology-aware seed distribution based on the query candidate entities, query candidate types, and type constraint information in a pre-built ontology storage module. In some embodiments, the edge weighting module reconstructs the edge weights in the knowledge graph based on the query candidate relations, query candidate types, and relation signatures and type hierarchy in the ontology storage module to obtain a query-aware transition matrix. In some embodiments, the semantic propagation module performs ontology-constrained semantic propagation on the knowledge graph based on the ontology-aware seed distribution and the query-aware transition matrix to obtain a steady-state distribution of each node. In some embodiments, the answer generation module selects target evidence and generates an answer based on the steady-state distribution.
[0088] It should be understood that the description of the ontology-guided semantic propagation method for graph retrieval enhancement generation also applies to the ontology-guided semantic propagation device for graph retrieval enhancement generation described here, but will not be described in detail here for simplicity.
[0089] In some embodiments, the apparatus further includes an ontology-knowledge graph co-evolution module, which includes: an entity type normalization submodule for performing type matching and normalization processing on newly added entities; a type hierarchy inference submodule for performing semantic clustering and subclass-parent class induction on emerging types using a large language model, and updating the ontology; and a relation signature inference submodule for inferring the domain and value range of newly added relations and performing consistency verification.
[0090] In some embodiments, the seed distribution construction module is specifically used to: calculate the entity link confidence and type compatibility score of entity nodes; and superimpose the type compatibility score as an enhancement signal onto the basic retrieval signal to generate the ontology-aware seed distribution, so as to achieve semantic control at the propagation source.
[0091] In some embodiments, the edge weighting module includes: a relation-aware weighting submodule, used to construct a relation weight matrix based on relation semantic similarity; a type consistency evaluation submodule, used to construct a type consistency matrix based on the degree of matching between entity type and relation domain and value range; and a joint weighting submodule, used to fuse the relation weight matrix and the type consistency matrix to dynamically adjust the transfer weight of the edges.
[0092] Although this subject matter has been described using language specific to structural features and / or methodological actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described herein. Rather, the specific features and actions described above are disclosed merely as exemplary forms of implementing the claims of this disclosure. Therefore, the scope of this disclosure is defined only by the appended claims and their equivalents, and is not strictly limited by the foregoing specific embodiments.
Claims
1. A method for ontology-guided semantic propagation in graph retrieval augmented generation (RAG), characterized in that, Includes the following steps: Obtain the natural language query input by the user, perform semantic modeling on the natural language query, and parse it to obtain query candidate entities, query candidate relations and query candidate types; Based on the query candidate entities, query candidate types, and type constraint information in the pre-built ontology storage module, the initial activation scores of entity nodes in the graph are calculated, and ontology-aware seed distribution is constructed. Based on the query candidate relations, query candidate types, and the relation signatures and type hierarchy in the ontology storage module, the edge weights in the knowledge graph are reconstructed to obtain the query-aware transition matrix. Based on the ontology-aware seed distribution and the query-aware transition matrix, ontology-constrained semantic propagation is performed on the knowledge graph until convergence is achieved, and the steady-state distribution of each node is obtained. The evidence nodes are sorted according to the steady-state distribution, and the target evidence is selected to input into the generation model to generate a response.
2. The ontology-guided semantic propagation method for graph retrieval enhancement generation according to claim 1, characterized in that, The method also includes an offline stage of ontology-knowledge graph co-evolution: Extract entities, relationships, and types from the original document collection to construct an initial knowledge graph; The newly added entities in the initial knowledge graph are normalized in terms of entity type, and entity types that cannot be matched with existing types in the ontology are added to the candidate pool. The large language model is used to perform semantic clustering and hierarchical inference on the types in the candidate pool, and the inference results are updated to the ontology storage module; Semantic signatures are inferred for newly added relations, and the knowledge graph is updated after verification based on ontology consistency constraints.
3. The ontology-guided semantic propagation method for graph retrieval enhancement generation according to claim 1, characterized in that, The construction of the ontology-aware seed distribution includes: Calculate the entity link confidence between the query and entity nodes in the graph, as well as the basic retrieval signal; Calculate the type compatibility score between the type label of the entity node and the query candidate type; Based on the entity link confidence, basic retrieval signal, and type compatibility score, the initial activation score is obtained through weighted calculation, so that entities that simultaneously satisfy query relevance and type consistency receive higher initial weights.
4. The ontology-guided semantic propagation method for graph retrieval enhancement generation according to claim 1, characterized in that, The reconstruction of edge weights in the knowledge graph to obtain the query-aware transition matrix includes: Calculate the semantic similarity between the relationship type of the edges in the graph and the candidate query relationship to obtain the relationship coefficient; The type coefficients are obtained by evaluating the compatibility of the head and tail entity types of the edges with the query candidate types and the domain and value range of the relations in the ontology. The original edge weights are fused with the relation coefficients and the type coefficients to obtain the transition weights in the query-aware transition matrix, thereby suppressing the propagation of semantically mismatched paths.
5. The ontology-guided semantic propagation method for graph retrieval enhancement generation according to claim 1, characterized in that, The execution of ontology-constrained semantic propagation employs a personalized PageRank algorithm for iterative calculation. The iterative formula incorporates a restart coefficient, ensuring that a preset proportion of the ontology-aware seed distribution is retained in each round of propagation to maintain consistency between the propagation process and the user's query intent.
6. A semantic propagation device for ontology-guided generation of graph retrieval enhancement, characterized in that, include: The query semantic modeling module is used to obtain the natural language query input by the user and parse it to obtain the query candidate entities, query candidate relations and query candidate types; The seed distribution construction module is used to construct an ontology-aware seed distribution based on the query candidate entities, query candidate types, and type constraint information in the pre-built ontology storage module. The edge weighting module is used to reconstruct the edge weights in the knowledge graph based on the query candidate relationship, query candidate type, and the relationship signature and type hierarchy in the ontology storage module, so as to obtain the query-aware transition matrix. The semantic propagation module is used to perform ontology-constrained semantic propagation on the knowledge graph based on the ontology-aware seed distribution and the query-aware transition matrix, so as to obtain the steady-state distribution of each node. The answer generation module is used to select target evidence and generate an answer based on the steady-state distribution.
7. The ontology-guided semantic propagation apparatus for graph retrieval enhancement generation according to claim 6, characterized in that, The device also includes an ontology-knowledge graph co-evolution module, which includes: The entity type normalization submodule is used to perform type matching and normalization processing on newly added entities; The type hierarchy inference submodule is used to perform semantic clustering and subclass-parent class induction on emerging types using a large language model, and to update the ontology; The relation signature inference submodule is used to infer the domain and value range of newly added relations and perform consistency checks.
8. The ontology-guided semantic propagation apparatus for graph retrieval enhancement generation according to claim 6, characterized in that, The seed distribution construction module is specifically used for: Calculate the entity link confidence and type compatibility score of entity nodes; The type compatibility score is superimposed on the basic retrieval signal as an enhancement signal to generate the ontology-aware seed distribution, thereby achieving semantic control at the propagation source.
9. The ontology-guided semantic propagation apparatus for graph retrieval enhancement generation according to claim 6, characterized in that, The edge weighting module includes: The relation-aware weighted submodule is used to construct a relation weight matrix based on relation semantic similarity. The type consistency assessment submodule is used to construct a type consistency matrix based on the degree of matching between entity types and relation domains and value ranges. The joint weighting submodule is used to fuse the relation weight matrix and the type consistency matrix to dynamically adjust the transition weights of edges.