Domain knowledge graph neural symbol reasoning method and system based on subgraph division
By using a subgraph partitioning method, the length of the longest relation chain is dynamically determined and k-order subgraphs are partitioned for symbolic reasoning. Extended subgraphs are generated and neural networks are trained. This solves the problems of low reasoning efficiency and limited generalization ability of OWL DL complex ontology in the prior art, and achieves efficient and accurate knowledge reasoning.
Patent Information
- Application Number
- CN202511723279.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-17
AI Technical Summary
Existing neural symbolic reasoning frameworks are difficult to apply to complex domain ontology, especially OWL DL. Ontology reasoning has high time complexity and low efficiency, cannot efficiently obtain large-scale extended knowledge graphs as supervision data for neural networks, and the large differences in the distribution of training and testing data limit generalization ability, failing to meet the knowledge reasoning needs of complex fields such as medicine and industry.
The longest relation chain length is dynamically determined by parsing the domain ontology axioms. Symbolic reasoning is performed by dividing the k-order subgraph, an extended subgraph is generated, and the k-order subgraph and the extended subgraph are used as training sample pairs to train the neural network, obtain logical mapping relationships, and merge the reasoning results to output an extended domain knowledge graph.
It reduces the time complexity of symbolic reasoning, improves the efficiency and generalization ability of knowledge reasoning, meets the knowledge reasoning needs of complex domains, enhances the learning ability of complex logical mappings, and ensures the completeness and accuracy of reasoning results.
Smart Images

Figure CN121543726A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of neural symbolic reasoning technology, and in particular to a neural symbolic reasoning method and system for domain knowledge graphs based on subgraph partitioning. Background Technology
[0002] As artificial intelligence technology leaps from perceptual intelligence to cognitive intelligence, knowledge graphs, capable of depicting entities and relationships within a domain in a structured form and bridging the semantic gap in deep learning, have become a core technology supporting knowledge reasoning. Simultaneously, the rise of neurosymbolic learning technology, which organically integrates the efficient numerical computation capabilities of neural networks with the rigorous logical reasoning advantages of symbolic systems, enables the generation of supervised data through symbolic reasoning and the learning of logical mapping patterns by neural networks to achieve knowledge reasoning tasks. Existing neurosymbolic reasoning methods are mostly geared towards lightweight, easily processed domain ontologies (such as OWL Lite), adaptable to the reasoning needs of small-scale knowledge graphs, and demonstrating certain effectiveness in simple domain tasks.
[0003] However, existing neural symbolic reasoning frameworks are difficult to apply to complex domain ontology with high expressive power, such as OWL DL. Specifically, on the one hand, the reasoning time complexity of ontology like OWL DL reaches EXPTIME (exponentially increasing with the size of the knowledge graph), making it difficult to efficiently obtain large-scale expanded knowledge graphs as supervision data for neural networks, thus hindering the construction of neural symbolic reasoning methods for complex ontology. On the other hand, traditional frameworks use the complete domain knowledge graph as input to the neural network, which not only makes it difficult for the model to learn complex logical mapping relationships, but also results in extremely low reasoning efficiency due to the need to enumerate massive triples to determine validity. Furthermore, the large difference in the distribution of training and testing data limits the generalization ability of reasoning, failing to meet the knowledge reasoning needs of complex fields such as medicine and industry. Summary of the Invention
[0004] Therefore, it is necessary to provide a neural symbolic reasoning method and system for domain knowledge graphs based on subgraph partitioning to address the aforementioned technical problems.
[0005] A neural symbolic reasoning method for domain knowledge graphs based on subgraph partitioning, the method comprising: The longest relation chain length for the domain knowledge graph reasoning task is dynamically determined by parsing the domain ontology axioms, and the corresponding subgraph order is calculated based on the longest relation chain length and the pre-set mapping rules. Centered on each instance in the domain knowledge graph, k-order subgraphs are divided according to the order of the subgraph. A symbolic inference engine is used to perform inference on each k-order subgraph to generate an extended subgraph containing implicit assertions. The input of the symbolic inference engine is the k-order subgraph and the axioms of the domain ontology. Using the k-th order subgraph and the extended subgraph as training sample pairs, the neural network is trained to learn the mapping relationship from the k-th order subgraph to the extended subgraph, thus obtaining a trained neural network model. The knowledge graph of the domain to be reasoned is divided into k-th order subgraphs centered on each instance. The k-th order subgraphs to be reasoned are then input into the trained neural network model to obtain the reasoning results of each k-th order subgraph. The reasoning results are combined using the cross-subgraph deduplication and chain assertion completion rules to output an extended domain knowledge graph of the domain knowledge graph to be reasoned.
[0006] A domain knowledge graph neural symbolic reasoning system based on subgraph partitioning, the system comprising: The subgraph order calculation module is used to dynamically determine the length of the longest relation chain in the domain knowledge graph reasoning task by parsing the axioms of the domain ontology, and calculate the corresponding subgraph order based on the length of the longest relation chain and the pre-set mapping rules. The subgraph partitioning module is used to partition k-order subgraphs based on the subgraph order, with each instance in the domain knowledge graph as the center, and to perform reasoning on each k-order subgraph through a symbolic inference engine to generate an extended subgraph containing implicit assertions; the input of the symbolic inference engine is the k-order subgraph and the domain ontology axioms; The model training module is used to train the neural network by using the k-th order subgraph and the extended subgraph as training sample pairs to learn the mapping relationship from the k-th order subgraph to the extended subgraph, and obtain the trained neural network model. The reasoning processing module is used to divide the domain knowledge graph to be reasoned into k-order subgraphs centered on each instance, input the k-order subgraphs to be reasoned into the trained neural network model, and obtain the reasoning results of each k-order subgraph. The result output module is used to merge the reasoning results by cross-subgraph deduplication and chain assertion completion rules, and output the extended domain knowledge graph of the domain knowledge graph to be reasoned.
[0007] The aforementioned neural symbolic reasoning method and system for domain knowledge graphs based on subgraph partitioning dynamically determines the length of the longest relation chain and calculates the subgraph order based on domain ontology axioms, enabling precise adaptation to domain ontology of varying complexity and laying the foundation for efficient reasoning. Partitioning k-order subgraphs centered on instances and generating extended subgraphs through symbolic reasoning significantly reduces the time complexity of symbolic reasoning, efficiently acquiring supervised data containing complex logic, and solving the problem of traditional methods struggling to handle large-scale extended knowledge graphs. Using k-order subgraphs and extended subgraphs as sample pairs to train the neural network allows the network to focus on key logical relationships within the subgraph, avoiding the learning burden caused by inputting the complete graph and improving the ability to learn complex logical mappings. Partitioning the reasoning graph into subgraphs and merging the results ensures both reasoning efficiency and result integrity through deduplication and completion rules, effectively alleviating the limitation on generalization ability caused by differences in training and testing data distribution, and meeting the knowledge reasoning needs of complex fields such as medicine and industry. The embodiments of this invention can improve the quality, efficiency, and generalization ability of knowledge reasoning, meeting the reasoning needs of complex domains. Attached Figure Description
[0008] Figure 1 This is a flowchart illustrating a domain knowledge graph neural symbolic reasoning method based on subgraph partitioning in one embodiment. Figure 2 This is a schematic diagram of a neural symbolic reasoning framework based on subgraph partitioning in one embodiment; Figure 3 This is a schematic diagram of end-to-end neural symbolic reasoning in one embodiment; Figure 4 This is a schematic diagram of an algorithm for randomly generating RDF graph data that satisfies the domain ontology definition in one embodiment. Figure 5 This is a schematic diagram of an algorithm for generating RDF graph data consistent with the domain ontology logic in one embodiment. Figure 6 Here is an example of an RDF graph in one embodiment; Figure 7 This is a schematic diagram of a subgraph partitioning algorithm in one embodiment; Figure 8 This is a pseudocode illustration of a recursive query function in one embodiment. Detailed Implementation
[0009] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0010] In one embodiment, such as Figure 1As shown, a neural symbolic reasoning method for domain knowledge graphs based on subgraph partitioning is provided, including the following steps: Step 102: Dynamically determine the length of the longest relation chain for the domain knowledge graph reasoning task by parsing the domain ontology axioms, and calculate the order of the corresponding subgraph based on the length of the longest relation chain and the pre-set mapping rules.
[0011] The definitions and parameter representations involved in step 102 are explained as follows: Domain knowledge graphs and domain ontology are constructed and represented based on the open-world assumption. Domain ontology is a formalized expression of pattern-level knowledge within a specific domain, including class axioms (such as class equivalence and subclass relations), relation axioms (such as relation transitivity and inverse relations), and attribute axioms (such as attribute domain / range constraints). It can be constructed and parsed using ontology editing tools. Domain knowledge graphs are instantiations of domain ontology, using triples as the basic data unit. The head and tail entities in a triple are specific objects within the domain, and relations are the associations between entities. In a triple, entities are real-world objects, events, situations, or abstract concepts, which can be obtained through the recognition or extraction of natural language text. Specifically, the head and tail entities are text data obtained from natural language text using named entity recognition tools. This text data includes characters and words; the named entity recognition tool can be Stanford NLP. Relations are the text data describing the relationship between the head and tail entities. During knowledge graph reasoning, any two of the head, tail, and relation entities can be identified, and the unknown one can be reasoned about. Natural language text can be obtained from the internet via web crawlers or manually configured; no specific restrictions are imposed here. Under the open-world assumption, the domain knowledge graph does not classify unstated triples as false, but only as unknowns, and supports dynamic updates (such as adding instances or supplementing relationships).
[0012] Instance k - Order subgraph: Let e Domain knowledge graph DKG One of the instances, then in DKG In the RDF graph composed of all triples, take the example... e Centered on, its k ( k A subgraph consisting of all instances and relations within a jump range (where '(a' is a positive integer)) is called a subgraph. e of k - Subgraph, denoted as .
[0013] Upper bound on the order of a subgraph: given a domain knowledge graph DKG = <E,R,T> When there are one or more instances e i ∈E ,make = DKG The minimum that is established k The value, called the upper bound of the subgraph order, is denoted as . .
[0014] The subgraph representation of a domain knowledge graph has the following properties: Subgraph Representation Theorem for Domain Knowledge Graphs: Given a large-scale domain knowledge graph, it can be represented losslessly by all its instances. k - A collection of order subgraphs.
[0015] Therefore, it can be formally expressed as:
[0016] in e i express DKG The instance number in i =1, 2, ..., N . N This represents the number of instances in the graph. k This indicates the order of the subgraph. It's important to note that Equation 1 contains redundant information; the same triple may appear in multiple instances of the subgraph.
[0017] Step 104: Centering on each instance in the domain knowledge graph, divide the graph into k-order subgraphs according to their order. Then, use a symbolic inference engine to perform reasoning on each k-order subgraph, generating an extended subgraph containing implicit assertions. The input to the symbolic inference engine is the k-order subgraph and the domain ontology axioms.
[0018] Building upon the concept of subgraphs, we further propose the concept of extended subgraphs: k --order extended subgraph: Let e Domain knowledge graph DKG One of the instances, its corresponding k - The order subgraph is Based on domain ontology Onto right Perform logical reasoning to obtain information about the instance. e The set of triples ,Right now .
[0019] Depend on k The definition of an --order extended subgraph and the subgraph representation theorem for domain knowledge graphs reveal properties concerning approximate reasoning in domain knowledge graphs: Subgraph-based approximation theorem: Given a domain knowledge graph DKG Its extended domain knowledge graph is All instancesk The set of --order extended subgraphs is used This indicates that, in the interval [1...], ... , Within ], there exists a positive integer. k , making Valid, that is, for all instances k The set of --order extended subgraphs can approximate the extended domain knowledge graph, represented as: .
[0020] In the theorem, It is a similarity threshold, defined as follows: Set a [0 , Real numbers between 1 and 1 are denoted as ,if Then it is believed It can approximate well Otherwise, it is considered Cannot approximate well At this point, the real number This is called the similarity threshold.
[0021] In the definition of similarity threshold and the subgraph representation theorem of domain knowledge graph, similarity Similarity Using a generalized recall rate as a metric, i.e.:
[0022] In the formula, trip Represents an RDF triple. len ( The similarity metric is defined this way because both reasoning on a subgraph and reasoning on the overall domain knowledge graph are logical inferences, and their results are truth-preserving (i.e., the accuracy of both reasoning results is 100%). Furthermore, the subgraph only contains local information. The conclusions drawn from reasoning will not exceed Therefore, using In-depth reasoning triples and The ratio of the three inference pairs can be used to assess the degree of similarity between the two.
[0023] The approximation theorem based on subgraphs can be formally expressed as:
[0024] Based on the above formula, large-scale domain knowledge graph reasoning is transformed into an instance-centric approach. kThe process of reasoning based on a subgraph is called Approximate Reasoning Based on Subgraph (ARBS). ARBS refers to transforming reasoning on a large-scale domain knowledge graph into reasoning based on all instances. k - Reasoning on subgraphs, and using all instances k The set of --order extended subgraphs approximates the extended domain knowledge graph.
[0025] Step 106: Input the k-order subgraph and the extended subgraph into the pre-constructed unified training channel, and use the extended subgraph to perform supervised training on the inference model to obtain the trained inference model. The unified training channel is adapted to the training needs of different types of inference models.
[0026] As can be seen from the definition of an extended subgraph, each time from the subgraph arrive The acquisition process involves a complete logical mapping. If we consider the instance... e i Corresponding ( , () is considered as a training sample, where the subgraph Expand the subgraph for input data. To monitor the data, then throughout the entire DKG Above, a total of can be constructed N training samples ( N for DKG (Number of instances). Although each subgraph contains only local information and cannot fully reflect all data patterns in the complete logical mapping, the neural network model can learn this complete logical mapping by iterating through all subgraphs multiple times. Therefore, training the neural network is transformed into learning the mapping from the subgraph of an instance to its extended subgraph, i.e.:
[0027] Equivalent to:
[0028] In the formula, This represents the extended subgraph obtained through neural network computation. Since the reasoning process of a neural network is not deductive, it cannot guarantee that all inference results are accurate and complete; therefore, the symbol “≈” is used in the formula. Combining formulas 8 and 10, the extended domain knowledge graph can be... Further expressed as:
[0029] In the formula, This represents the set of extended subgraphs representing the outputs of all neural networks.
[0030] Step 108: Divide the knowledge graph of the domain to be reasoned into k-th order subgraphs centered on each instance. Input the k-th order subgraphs to be reasoned into the trained neural network model to obtain the reasoning results of each k-th order subgraph.
[0031] like Figure 2 As shown, a schematic diagram of a subgraph inference framework is provided. The inference framework mainly consists of two parts: model training and inference (or testing). (See diagram...) Representation of training graph The number of instances in Represents the test spectrum The number of instances in the diagram. It's important to note that the diagram originates from the domain ontology. Onto To training data The arrow annotation reads "Generate simulation data," while the arrow refers to test data. This refers to "generation." This means that training within the subgraph inference framework uses simulated data, while test data can be either real or simulated data. Aside from being based on the same domain, all instances in different graphs are distinct and independent. The advantage of this is that it provides a large amount of high-quality training data for neural networks, while also giving the model strong generalization capabilities.
[0032] In the model training section, the training graph is first processed. Perform subgraph partitioning to obtain information about each instance. k - Rank diagram The subgraphs of all instances constitute the input subgraph set. Then, the subgraphs in the input subgraph set are compared with the domain ontology. Onto Merge and, using logical reasoning, obtain the corresponding extended subgraph. The extended subgraphs of all instances form an extended subgraph set. By merging all the extended subgraphs, the extended graph can be approximated. Subgraphs and their corresponding extended subgraphs ( , ) constitute a training sample, neural network model ( NN Learn the mapping relationship (correspondence) between the input subgraph and its extended subgraph. Figure 2 Steps one and two in the process (and by iterating through all training samples, the logical reasoning ontology in a specific domain can be fully learned) Onto The following is the deductive process.
[0033] Step 110: Merge the reasoning results according to the cross-subgraph deduplication and chain assertion completion rules, and output the extended domain knowledge graph of the domain knowledge graph to be reasoned.
[0034] In the reasoning part of the model, the test domain knowledge graph will be used. The subgraph is partitioned using the same method to obtain the subgraph for each instance. This forms the input subgraph set. Each subgraph is then encoded using an instance vector generation method and input into the neural network model. NN (correspond Figure 2 (Step 3) and decode the model output using the reconstruction method to restore it to the RDF triple representation, thus obtaining the extended subgraph corresponding to each subgraph. (correspond Figure 2 Step four in the process involves constructing an approximate extended subgraph set for the neural network. Finally, all subgraphs are merged to obtain an approximate extended graph of the large-scale extended domain knowledge graph. .
[0035] like Figure 3 The diagram illustrates an end-to-end neural symbolic reasoning process. As can be seen, although data conversion between the symbolic system and the neural network is involved, these intermediate processes can be automated without human intervention or manual processing of the intermediate results. Ignoring specific intermediate processes, the input to neural symbolic reasoning is the domain knowledge graph to be reasoned about, and its output is an extended domain knowledge graph. The entire process of neural symbolic reasoning is an approximate compilation of the logical reasoning deduction process on the domain knowledge graph. The neural symbolic reasoning method based on the subgraph reasoning framework not only has the advantages of end-to-end learning but also enables end-to-end implementation of different types of reasoning tasks, freeing users from complex logical axiom processing. Based on the subgraph reasoning framework, by setting the order k of the subgraph and whether the subgraph contains instance attribute information, end-to-end single-hop reasoning, multi-hop reasoning, and multi-hop reasoning tasks incorporating instance attributes can be implemented. Of course, this does not mean that a single neural network model can implement all the above reasoning tasks; different models need to be pre-trained for different reasoning tasks. In traditional approximate reasoning methods, achieving approximate reasoning in a knowledge base requires users to possess extensive knowledge and experience in logical languages to simplify complex axiomatic expressions into easily tractable logical language. Therefore, the subgraph reasoning framework lowers the application threshold of neural symbolic reasoning in domain knowledge graphs, facilitating its promotion in practical applications of domain knowledge graph reasoning.
[0036] In the aforementioned neural symbolic reasoning method for domain knowledge graphs based on subgraph partitioning, the longest relation chain length is dynamically determined and the subgraph order is calculated based on domain ontology axioms. This allows for precise adaptation to domain ontology complexities, laying the foundation for efficient reasoning. Partitioning k-order subgraphs centered on instances and generating extended subgraphs through symbolic reasoning significantly reduces the time complexity of symbolic reasoning, efficiently acquiring supervised data containing complex logic, and solving the problem of traditional methods struggling to handle large-scale extended knowledge graphs. Using k-order subgraphs and extended subgraphs as sample pairs to train the neural network enables the network to focus on key logical relationships within the subgraphs, avoiding the learning burden caused by complete graph input and improving the ability to learn complex logical mappings. Partitioning the reasoning graph into subgraphs and merging the results ensures both reasoning efficiency and result integrity through deduplication and completion rules, effectively alleviating the limitation on generalization ability caused by differences in training and testing data distribution, and meeting the knowledge reasoning needs of complex fields such as medicine and industry. This invention improves the quality, efficiency, and generalization ability of knowledge reasoning, meeting the reasoning needs of complex domains.
[0037] In one embodiment, before dynamically determining the longest relation chain length for the domain knowledge graph reasoning task by parsing the domain ontology axioms, the method further includes: obtaining initialized initial domain knowledge graph data; the initialization method includes random generation based on class definitions, relation definitions, and attribute definitions in the domain ontology; detecting the logical consistency between the initial domain knowledge graph data and the domain ontology using a minimum conflict set discovery method, and identifying the set of conflicting assertions in the initial domain knowledge graph data that conflict with the ontology axioms; selecting one assertion from each set of conflicting assertions as a negative example, and the remaining assertions constitute a set of positive examples; obtaining logically consistent domain knowledge graph data based on the positive example set and the negative example set; and using the domain knowledge graph data for k-order subgraph partitioning.
[0038] In this embodiment, the subgraph reasoning framework relies on generated data to train the neural network model. Neural symbolic learning is a data-driven model, and its training process depends on high-quality data. However, in reality, obtaining large-scale and high-quality domain-specific data is very difficult due to privacy protection, data barriers, cost control, and other reasons. Open-source domain ontologies typically contain only axioms or a small amount of instance data, which cannot meet the training requirements. Therefore, the training process of the neural symbolic learning model relies on generated simulation data. This invention uses a method for generating RDF graph data based on domain ontologies for RDF graph data, generating logically consistent domain knowledge graph simulation data on the basis of the OWL DL domain ontology.
[0039] In domain knowledge graph reasoning, it is reasonable to use generated data to train neural network models, mainly for the following reasons: (1) The construction of domain knowledge graphs depends on domain ontology. Domain knowledge graphs are strictly constrained by domain ontology, so generating simulation data that conforms to domain ontology and is logically consistent can ensure a high degree of consistency with real domain knowledge graphs. (2) Domain knowledge graph reasoning is deductive reasoning, that is, inferring implicit triples in instance data through pattern knowledge. Therefore, its reasoning process is a logical mapping from abstract to concrete. The reasoning rules and axioms are universal and do not depend on the specific form of the underlying data. Therefore, both simulation data and real data can be used to train neural networks to acquire reasoning capabilities. (3) Generated data can effectively simulate various axioms defined in the ontology, effectively alleviate the phenomenon of unbalanced distribution of instance data and missing patterns in real domain knowledge graphs, and map ontology axioms to data through reasoning, so that neural network models can learn the axioms in the domain ontology more completely. Using generated data to train neural symbolic learning models can effectively solve the problem of insufficient training data.
[0040] Applying generated data to train neural symbolic reasoning models still faces two challenges. First, generating domain knowledge graphs under the open-world assumption is difficult, especially generating negative triples with real semantic meaning. Domain knowledge graphs only contain correct triples or facts, lacking negative examples. Domain knowledge graphs and domain ontologies are primarily constructed and represented based on the open-world assumption; however, obtaining negative examples with real semantic meaning under this assumption remains a challenge. Second, existing data generation methods cannot guarantee consistency between generated data and the ontology. Generated data may conflict with axioms in the ontology; although neural symbolic reasoning systems are robust to noise, such logically inconsistent data is unsuitable for training.
[0041] To address the aforementioned shortcomings, the graph data generation method can not only generate domain knowledge graphs that are logically consistent with the domain ontology, but also obtain negative example triples with real semantics under the open-world assumption. The graph data generation method mainly includes two processes: first, based on the classes, relations, attributes, and axioms in the domain ontology, a large amount of RDF graph data satisfying the ontology definition is randomly generated; then, a minimum conflict set is found from the domain ontology and the RDF graph data. By processing the minimum conflict set and the RDF graph data, a logically consistent domain knowledge graph can be obtained.
[0042] Randomly generating RDF graph data that satisfies the ontology definition involves generating class assertions, relation assertions, and attribute assertions based on the domain ontology. The specific process is as follows: Figure 4 As shown, it can be roughly divided into the following three steps, which generate three types of assertions respectively.
[0043] (1) The first stage is to generate instances of the class to obtain the class assertion set, and then use logical reasoning to obtain the inference class assertion set (lines 2-9). First, based on the class concept set clsSet in the domain ontology and the list x of the number of instances to be generated for each class, a given number of instances are generated for each class concept to obtain the class assertion. Then, based on the domain ontology, a logical reasoning is performed on the class assertion set to establish the relationship between instances and classes. isA Relationship generalization obtains the relationship between instances and their parent and grandparent classes. isA Relationships are used to obtain the set of assertions for reasoning.
[0044] (2) The second stage is to generate the relation assertion set (lines 10-19). Based on the relation definitions in the domain ontology, obtain the relation set relSet, and obtain each type of relation. r The corresponding domain and range are then used to obtain the set of domain instances (insts) corresponding to the relation, based on the class instance generated in step (1). Domainr Sum of value domain instances (insts) Rangr e Iterate through the instances in the domain instance set in turn. s And randomly select instances from the value range instance set. o Establish a relationship between two instances. r ( s,o ), ultimately yielding a set of relational assertions.
[0045] (3) The third stage is to generate the attribute assertion set (lines 20-28). Based on the attribute definitions in the domain ontology, obtain the attribute set proSet, and then obtain each attribute... p The corresponding domain and the value range of the attribute are obtained from the predefined parameter v. It's important to note that attribute assertions differ from relational assertions. In relational assertion triples, both the head and tail entities are instances, while in attribute assertions, the head entity is the instance, and the tail entity is the attribute value (text, number, boolean, etc.). Based on the attribute's domain, the instance set `insts` is obtained. Domainp For each instance s Generate attribute values that conform to the value range. v Construct property assertions p ( s,v This process ultimately yields the set of attribute assertions.
[0046] The above three steps generate sets of class assertions, relation assertions, and attribute assertions, respectively. Since these triples are randomly generated and satisfy the basic definitions in the domain ontology, they inevitably conflict with the axiom set in the ontology. To ensure consistency between the generated RDF graph data and the domain ontology, the graph data synthesis method is based on the minimal conflict set discovery method, ComputeAllJustifications. It heuristically obtains the minimal conflict set from the RDF graph data, randomly selecting a triple from the minimal conflict set. Under the constraints of the ontology's axiom set, this triple contradicts the set formed by other triples in the minimal conflict set; that is, this triple can be considered a negative example of the other triple sets. Therefore, one assertion can be randomly selected from the minimal conflict set as a negative example, and the remaining assertions constitute the positive example set.
[0047] To obtain logically consistent RDF graph data, based on the generated RDF graph data that satisfies the domain ontology definition, a minimum conflict set discovery method is used, and the consistency of the RDF graph data is checked using a logical inference engine. The process is as follows: Figure 5 As shown, in the algorithm IniSet This refers to the generated logically consistent domain knowledge graph. NegSet It is the corresponding set of negative instances.
[0048] The simulation data generated by the graph data generation method conforms to the open-world assumption. This is because: (1) the negative examples obtained from the minimum conflict set are obtained through logical reasoning that checks the consistency between the domain ontology and the RDF graph data that satisfies its definition. Therefore, the negative examples are implicit negation triples in the domain ontology and the generated domain knowledge graph, and have real semantics; (2) the generated domain knowledge graph is consistent with the domain ontology, that is, it is subject to the axioms in the domain ontology.
[0049] In one embodiment, the mapping rule includes the subgraph order and the length of the longest relation chain satisfying the following condition: ,in, Let the order be the subgraph. The length of the longest relationship chain. This is for rounding up.
[0050] In the subgraph reasoning framework, the choice of subgraph order has a significant impact on neural symbolic systems. From the perspective of symbolic systems, the higher the subgraph order, the closer the subgraph is to a complete system. DKG The set of subgraph reasoning results is related to the whole. DKGA higher degree of approximation in reasoning leads to higher complexity in recursive queries when partitioning the subgraph, as well as higher complexity in reasoning to obtain the extended subgraph. From a neural network perspective, a higher order of subgraph results in more instances and triples, and a richer data pattern, requiring a more powerful learning ability from the neural network model, thus increasing the difficulty of learning and reasoning. Therefore, choosing an appropriate subgraph order in the subgraph reasoning framework is crucial for improving the quality and efficiency of neural symbolic reasoning.
[0051] Subgraph-based approximation reasoning (ARBS) approximates the reasoning results on the overall domain knowledge graph by using the set of extended subgraphs of all instances. ARBS can construct large amounts of high-quality and diverse training data for neural symbolic reasoning, comprehensively improving the reasoning quality, efficiency, and generalization ability of neural network models. However, an important aspect remains to be explained within the subgraph reasoning framework: the approximation effect of ARBS, specifically, the degree to which the set of extended subgraphs approximates the reasoning results of the overall graph. It can be observed that the order of the subgraph... k It is the only variable in ARBS, and it determines the degree of approximation of the overall graph inference results by ABRS.
[0052] order of subgraph k The scope of the neighbor nodes of the instance is defined. In order to illustrate the requirement that the subgraph contains instance nodes for reasoning, the subgraph inclusion theorem for instances is given as follows.
[0053] Subgraph Inclusion Theorem: In subgraph reasoning, if you want to discover implicit knowledge... r ( s,o If the subgraph contains instances, then it must be ensured that at least one subgraph contains instances. s and examples o .
[0054] Proof (Subgraph Inclusion Theorem for Instances): Proof by contradiction. Assume there is no subgraph that simultaneously contains instances. s and examples o Subgraph reasoning can still uncover implicit knowledge. r ( s,o ). Let any containing s The subgraph is g sk ( i ) Any containing o The subgraph is g ok ( j ) Based on the assumption, s ∈g sk (i ) and o ∈ / g sk ( i ) This holds true because logical reasoning can only infer implicit knowledge between existing entities, but cannot discover implicit new nodes. Therefore, for instances... s The extended subgraph satisfies o ∈ / g sk ( i )_ ext ,so r ( s,o )∈ / g sk ( i )_ ext Similarly, we can obtain r ( s,o )∈ / g ok ( j )_ ext Therefore, no subgraph can discover implicit knowledge during the reasoning process. r ( s,o This contradicts the assumption, therefore the theorem holds.
[0055] Although the implicit relationship between two instances can only be discovered if they are both in the same subgraph, it is not required that all permutations and combinations of instance pairs (any instance pair) s , o All instances must be contained within a subgraph, but only instances that may have potential implicit relationships are required to be contained within at least one subgraph. To illustrate this property, we first introduce the concepts of chained reasoning and subgraph diameter.
[0056] Chain reasoning: in domain knowledge graphs DKG In inference, if an implicit triple requires the premises of multiple (greater than or equal to 2) triples, then the reasoning process to obtain the implicit triple is called chain reasoning. In chain reasoning, the number of distinct instances implied in the premise triples is called the length of the reasoning chain, denoted as . l .
[0057] Example of chain reasoning: Figure 6 The example given DKG Take the RDF graph as an example. Assume the following inference rules exist: IF: ( a 1 ,isA,C 3) and ( a1 ,R 1 ,a 6) and ( a 6 ,R 2 ,a 5) and ( a 5 ,R 3 ,a 4) THEN:( a 1 ,R 1 ,a 4) Then, to obtain the implicit triplet ( a 1 ,R 1 ,a 4) This process is a chain of reasoning, where the IF part represents the premises and the THEN part represents the conclusion. The IF part implies... a 1. a 6. a 5 and a Given 4 instances, what is the length of this reasoning chain? l =4.
[0058] Subgraph diameter: for any instance e i ,That k - Order diagram g eik This can be seen as an example e i With the center as the center, k The diameter of a subgraph (DS) is denoted as DS(where DS is the radius and 1 jump is the basic unit). e i , k )=2 k +1 indicates the center instance.
[0059] The reasoning chain that obtains an implicit triple is analogous to a straight line connecting two instances in a plane. The subgraph is analogous to a circle in the plane. If we want to ensure that the straight line is surrounded by at least one circle in the plane, then we must ensure that the diameter of the circle is greater than or equal to the length of the straight line.
[0060] In summary, let's assume... s and o It is a knowledge graph of a given domain. DKG The two entities in the text, entity s and o The length of the inference chain between them is l If we want to ensure that at least one subgraph contains... s and o And all entities implied in its reasoning chain, then there exists at least one instance. e iSatisfying DS( e i , k )≥ l Based on this, the order of the selection subgraph is given. k The empirical formula is shown below.
[0061]
[0062] Combining the empirical formula for choosing the subgraph order with the definitions of single-hop and multi-hop reasoning, we can draw the following conclusions: (1) For chainless domain knowledge graph reasoning, the order of the subgraph This indicates that the first-order subgraph of an instance can contain all the patterns in the axioms of a chainless domain ontology. This means that for reasoning in a chainless domain knowledge graph, single-hop reasoning can obtain reasoning results that are approximately the same as those on the entire graph.
[0063] (2) For reasoning about knowledge graphs with chains, the order of the subgraph ,in l max The maximum length of chained reasoning implied in the axioms and rules of a chained domain ontology indicates that multi-level subgraphs of instances are required to contain patterns that effectively reflect these axioms or rules. This means that for reasoning in chained domain knowledge graphs, multi-hop reasoning is needed to obtain reasoning results that approximate the overall graph.
[0064] It is worth noting that the empirical formula for choosing the subgraph order is to ensure that the ARBS inference results can approximate the inference results on the overall domain knowledge graph well. However, in practical applications, the choice of subgraph order can also be adjusted according to the actual application requirements. Even in chained domain knowledge graphs, when the application only focuses on the first-order neighbors of an instance, single-hop inference can be used, but in this case, some logical implications will be lost. In addition, in practical applications, the length of chained inference should be appropriately truncated. In many cases, the longest inference chain can obtain very few logical implications. If these implications are not very important to the supporting domain application, they can be discarded, and a shorter inference chain can be chosen to determine the subgraph order. Although a small number of logical implications are lost, the impact on the domain application is small and the inference efficiency can be greatly improved.
[0065] For a domain knowledge graph DKG When the order of the subgraph k If the above formula is satisfied, then it can be guaranteed that there are instances with a potential relationship. s,oIf a graph is contained within at least one subgraph simultaneously, the reasoning result of ARBS can approximate the reasoning result on the overall graph quite well. The choice of the subgraph order is determined by the reasoning chain. In this invention, domain knowledge graph reasoning is defined as deductive reasoning from abstract to concrete. Therefore, in a domain knowledge graph, when chained reasoning is needed and how the length of the reasoning chain is determined are determined by the axioms and rules in the domain ontology.
[0066] In one embodiment, dynamically determining the longest relation chain length for a domain knowledge graph reasoning task by parsing domain ontology axioms includes: parsing domain ontology axioms, distinguishing the domain ontology as either a chainless domain ontology or a chained domain ontology based on the domain ontology axioms; if it is a chainless domain ontology, then determining the longest relation chain length as 2; if it is a chained domain ontology, then analyzing the reasoning chain structure corresponding to each axiom, and obtaining the longest relation chain length based on the length of the reasoning chain structure involving the most different instances.
[0067] In this embodiment, the combination of different constructors forms OWL DL languages with different expressive capabilities. These ontology languages with different expressive capabilities give the domain ontology different expressive capabilities and reasoning complexities. Not all constructors involve chained reasoning, which means that not all OWL DL domain ontology requires chained reasoning. For domain ontology that does not involve chained reasoning axioms and rules, this invention refers to it as a chainless domain ontology, and the task of reasoning in the domain knowledge graph based on a chainless domain ontology is called chainless domain knowledge graph reasoning. If the domain ontology involves axioms or rules related to chained reasoning, it is called a chained domain ontology, and the task of reasoning in the domain knowledge graph based on a chained domain ontology is called chained domain knowledge graph reasoning. The specific definitions are as follows: Unlinked and linked domain ontology, unlinked and linked domain knowledge graph reasoning: Given a domain ontology [[ID= , It is a domain knowledge graph generated based on this ontology. If If it does not contain axioms and rules related to chain reasoning, then it is called For the unlinked domain ontology, from Departure, at The process of reasoning about implicit knowledge is called chainless domain knowledge graph reasoning; if If it contains axioms or rules related to chain reasoning, then it is called... For the ontology of the chain domain, from Departure, at The process of reasoning about implicit knowledge is called chained domain knowledge graph reasoning.
[0068] ARBS is called approximate reasoning because ARBS reasoning may lose some logically implied conclusions compared to reasoning on the overall domain knowledge graph. There are two main reasons for this: (1) the subgraph may not contain the domain ontology. The pattern information expressed in the text, for example, in chain reasoning, if the two instances in the conclusion are not on the same subgraph, the implicit assertion of the chain reasoning cannot be found; (2) is the information loss that may be caused by iterative reasoning. In the ontology reasoning process, the conclusions that have been discovered can be used as the premises of other implicit assertions, thereby inferring more assertions. However, there is no information update and propagation between different subgraphs in the ARBS reasoning process, which will cause a certain information loss. Both of these shortcomings can be alleviated by increasing the order of the subgraph, but increasing the order of the subgraph will also reduce the reasoning efficiency.
[0069] ARBS can alleviate the problem of poor scalability of ontology reasoning in large-scale graph reasoning tasks to a certain extent. The main reasons are as follows: (1) The ARBS reasoning method can transform the reasoning problem on a large-scale graph into a linear superposition of reasoning on small-scale subgraphs, which alleviates the influence of graph size on logical reasoning and effectively improves reasoning efficiency. However, it should be noted that since each subgraph is still reasoned under the complete domain ontology, it does not reduce the complexity of logical reasoning in essence. Therefore, ARBS is still constrained by the expressive power of the domain ontology. (2) ARBS can further improve reasoning efficiency through parallel computing. ARBS divides the overall graph into multi-level subgraphs centered on instances, and then reasons on all subgraphs under the domain ontology. In this process, the reasoning of each subgraph is independent, so it is easy to use parallel computing to accelerate subgraph reasoning.
[0070] Using the SPARQL query language, multi-level subgraphs of instances can be obtained step-by-step through recursive queries. The specific process of the subgraph partitioning method is as follows: As shown. In the algorithm, the input is , subgraph order k and ,in This setting determines whether to retrieve the extended subgraph. When training a neural symbolic reasoning model, the extended subgraph is needed as supervision data during training. However, when using the neural symbolic model for reasoning, only the instance subgraph is required. The algorithm first uses a recursive query function... Get the instance k - Rank diagram .if If true, then in the complete domain ontology Next, using the ontology reasoning engine Reasoner, logical reasoning is performed on the subgraph to obtain its corresponding extended subgraph. Then, k- A subgraph pair consisting of an order subgraph and its extended subgraph ( , Add to sub-atlas In this way, all instances are traversed sequentially. At this point, It can be directly used as a training dataset for training neural symbolic models, where For input data, For monitoring data. If If it is false, then only the subgraph will be... Join It is then input into a trained neural symbolic reasoning model, and an approximate extended subgraph is obtained through neural network calculation.
[0071] This represents a recursive query function, with simplified pseudocode as follows: As shown, its received parameters are Examples e order k Hezi Diagram ( This is the name of a variable inside the function, and the value assigned to this variable is... The subgraph expands continuously through recursive queries (initially an empty graph), and the output consists of instances. k - Subgraph of order. As can be seen from the code, during subgraph partitioning, the given instance is first obtained using the DESCRIBE command in SPARQL. e The query iterates through the 1-order subgraph and neighbor nodes of the instance, and then recursively traverses the 1-order subgraph and neighbor nodes of all neighbor nodes, adding them to the subgraph of the instance, until the query terminates when the set order condition is met.
[0072] In one embodiment, generating an extended subgraph containing implicit assertions by performing reasoning on each k-order subgraph using a symbolic inference engine includes: inputting the k-order subgraph and the parsed domain ontology axioms into the symbolic inference engine, wherein the domain ontology axioms include at least one of the concept inclusion axiom, role transitivity axiom, role composition axiom, and SWRL rules; the symbolic inference engine derives implicit class assertions between instances and their parent classes based on the concept inclusion axiom, derives indirect relationship assertions between instances based on the role transitivity axiom, and derives implicit relationship assertions that conform to the rule premises based on the SWRL rules; and integrates all the derived implicit assertions with the explicit assertions in the k-order subgraph to form an extended subgraph containing both explicit and implicit assertions, ensuring the consistency of instance associations between the extended subgraph and the k-order subgraph.
[0073] In one embodiment, the reasoning results are merged according to the cross-subgraph deduplication and chain assertion completion rules to output the extended domain knowledge graph of the domain knowledge graph to be reasoned. This includes: traversing the extended subgraphs of all subgraphs to be reasoned, comparing the entity pairs and relation types of the assertions, and deleting duplicate assertions; identifying broken relation chains according to the role transitivity axiom in the domain ontology, and completing assertions with missing intermediate nodes; and integrating all deduplicated and completed assertions to obtain the extended assertion set of the domain knowledge graph to be reasoned.
[0074] The subgraph reasoning framework proposed in this invention can effectively solve the challenges faced by neural symbol reasoning in the OWL DL domain ontology. Its main advantages are summarized as follows.
[0075] (1) The subgraph reasoning framework effectively supports the construction of neural symbolic reasoning methods for OWL DL domain ontology. By partitioning the subgraph, the framework transforms reasoning from large-scale domain knowledge graphs into instance-centric subgraph reasoning, alleviating the impact of graph size on logical reasoning and reducing the difficulty of acquiring training data, thus making it possible to construct neural symbolic reasoning models for OWL DL domain ontology. In OWL DL ontology, the time consumed by logical reasoning increases exponentially with the size of the domain knowledge graph. For each instance, its subgraph... The size is smaller than Let the whole be... The number of instances in is , The maximum number of instances is ,but Logical reasoning in The computational complexity of the above is Therefore, the upper bound of computational complexity for reasoning on all subgraphs is . ,in p ( )express The polynomial function is shown. Therefore, the subgraph reasoning framework can transform reasoning problems on large-scale domain knowledge graphs into a linear superposition of small-scale subgraph reasoning, mitigating the impact of graph size on logical reasoning and effectively acquiring supervised data. Furthermore, each instance subgraph performs reasoning independently within the domain ontology, indicating that the subgraph reasoning process is parallelizable, further improving the efficiency of acquiring supervised data.
[0076] (2) Advantages in model reasoning quality. The subgraph reasoning framework helps neural networks learn the logical reasoning process, effectively improving the training effect of neural networks and thus improving the quality of neural symbolic reasoning. This is mainly reflected in three aspects: (i) As can be seen from the process of the subgraph reasoning framework, each time from the subgraph arrive Each process involves a complete logical reasoning; therefore, after traversing all subgraphs, the neural network can learn... N (i) The number of instances in the graph) Subgraphs are a logical mapping process, which is very helpful for model training; (ii) Neural networks are data-driven models. By partitioning the graph into subgraphs, the amount and diversity of training data can be increased, thereby improving the training efficiency and learning effect of the model; (iii) From the subgraph arrive The logical mapping relationships between them are explicit. By iteratively learning the mapping relationships between subgraphs and their extended subgraphs of different instances, neural networks can more explicitly learn the logical reasoning process. Therefore, the subgraph reasoning framework can support neural symbolic reasoning models in learning complex logical reasoning processes in OWL DL.
[0077] (3) Advantages in model reasoning efficiency. The subgraph reasoning framework improves reasoning efficiency mainly in two aspects. (i) The subgraph reasoning framework can greatly reduce the space for enumerating all possible triples. Assume the number of instances in the domain knowledge graph is... N A The number of instances in the subgraph is N g The relation type defined in the domain ontology is N r Therefore, in order to obtain a more complete reasoning result, it is necessary to enumerate | across the entire graph. N A × N r × N A The process involves combining triples and sequentially determining whether these triples are true, whereas on a subgraph, only enumeration and reasoning are required. N g × N r × N g | triplet, due to N g N A Therefore, the subgraph reasoning framework effectively reduces the search space and improves the response speed of neural symbolic reasoning. (ii) The subgraph reasoning framework makes neural symbolic reasoning methods easier to parallelize. In the subgraph reasoning framework, the neural network performs reasoning on subgraphs, and the reasoning between each subgraph is independent of each other. This makes the neural symbolic reasoning process easy to parallelize, thereby improving the efficiency of reasoning. Therefore, the subgraph reasoning framework has a significant advantage in terms of model reasoning efficiency.
[0078] (4) Advantages in model generalization ability. The subgraph reasoning framework improves the generalization ability of neural symbolic reasoning in three main ways. (i) The subgraph reasoning framework can guarantee the transferability from training data to reasoning data. Domain knowledge graphs contain a large number of instances of different types (class concepts). Each type of instance can be regarded as a cluster. Different clusters have large differences. For example, instances of the concept of "human" and instances of the concept of "plant" are very different. This supports the diversity of data when partitioning subgraphs. Instances within a cluster have high similarity. For example, under the concept of "human", although two people may have differences in specific aspects, the descriptions of their attributes and relationships are the same. This supports the transferability from training data to reasoning data. In short, it is difficult to guarantee the data scale and distribution of training and testing domain knowledge graphs (both of which are large-scale sets of triples intertwined with many clusters), but it is easy to guarantee high consistency for subgraphs of the same type of instance in the graph. Meanwhile, even if the training and test data differ significantly in size and distribution, they are all pieced together from individual subgraphs. The learning object of the subgraph reasoning framework is the instance subgraph, which ensures that the reasoning process is transferable. (ii) The independence of subgraph reasoning allows the same instance to be encoded independently in different subgraphs. In the subgraph reasoning framework, the reasoning from each instance subgraph to its extended subgraph is independent. This indicates that the neural network can independently encode the same instance in different subgraphs. This allows the neural network to ignore the influence of instances playing different roles in different subgraphs and focus on learning the general mapping rules from the subgraph to the corresponding extended subgraph, i.e., the logical reasoning process. (iii) The subgraph reasoning framework is beneficial for the model to learn entity and relation encoding methods. The processing object of the subgraph reasoning framework is the subgraph, and instances are encoded independently in different subgraphs. This means that each reasoning only needs to generate a small number of instance vector representations (i.e., instances in the subgraph). This helps in the design of encoding methods, reduces the difficulty for the neural network to generate vector representations, and thus generates high-quality encoded vectors for unknown instances.
[0079] Therefore, it is evident that the subgraph reasoning framework plays a crucial role in improving the generalization ability of the model. Furthermore, the subgraph reasoning framework can support the implementation of different types of neural symbolic reasoning methods, bringing greater flexibility to domain knowledge graph applications, which is also a significant advantage of the subgraph reasoning framework.
[0080] (5) The subgraph reasoning framework is a general framework for implementing different types of reasoning. This invention mainly considers three different types of domain knowledge graph reasoning: single-hop reasoning, multi-hop reasoning, and multi-hop reasoning that integrates instance attributes. In the subgraph reasoning framework, these three different types of neural symbol reasoning can be implemented end-to-end by controlling the size and content of the subgraph. In single-hop reasoning, the first-order subgraph of the instance is selected; in multi-hop reasoning, the multi-order subgraph of the instance is selected; and when considering instance attributes, the instance attribute information only needs to be added to the subgraph when dividing it. This means that, unlike traditional approximation methods, the neural symbol reasoning method built based on the subgraph reasoning framework does not need to deal with cumbersome logical axioms. It only needs to adjust the subgraph and design a neural network model suitable for the characteristics of the subgraph to achieve different types of neural symbol reasoning end-to-end.
[0081] (6) The subgraph reasoning framework provides greater flexibility for the application of domain knowledge graphs. In different application scenarios of domain knowledge graphs, it is sometimes necessary to obtain extended domain knowledge graphs (i.e., Sometimes, it may only be necessary to obtain the inference triples related to one or a few instances. The subgraph inference framework can selectively obtain inference results related to certain instances (i.e., the extended subgraphs corresponding to the instances). It can also take the set of extended subgraphs corresponding to all instances and use it as an approximation of the reasoning results on the overall domain knowledge graph (i.e., This can satisfy the different application scenarios mentioned above, which provides more flexibility for the application of neural symbolic reasoning in domain knowledge graphs.
[0082] Based on the above analysis, the subgraph inference framework can not only construct large-scale, high-quality, and diverse data for neural network training, but also ensure transferability from training to inference, improve the training effect of the model, and comprehensively improve the inference quality, inference efficiency, and inference generalization ability of the model, effectively supporting the construction of neural symbolic inference methods for OWL DL ontology.
[0083] This invention verifies the effectiveness of its method through experiments. The experiments were conducted on three open-source ontology libraries: family.swrl (released from the Stanford University ontology library, an ontology modeling family relationships, abbreviated as FAMILY); and sem_r (released from the University of Toronto ontology library, an ontology modeling simple events).
[182] The first is SEM, and the last is time-qualitative-only, published by Batsakis et al., which is an ontology representing temporal relationships, abbreviated as TIME. All three domain ontologs are complex domain ontologs built on OWLDL and SWRL. In the experiments, the similarity threshold was set to... α=95%, ARBS reasoning and overall domain knowledge graph reasoning both use the Pellet logic inference engine. To experiment with the approximation effect of ARBS on unlinked and linked domain knowledge graph reasoning respectively, the axioms and rules related to chained reasoning involved in the above ontology were removed, and unlinked domain ontology (denoted as FAMLIY) was constructed. nc SEM nc and TIME nc To conduct experiments evaluating reasoning efficiency, this invention selected the FAMILY and TIME ontologs and generated graph data of different scales on them to analyze and compare the reasoning time of ARBS and overall domain knowledge graph reasoning on data of different scales. The reasoning for FAMILY and TIME was chosen because both are chained domain ontologs, possessing strong expressive power and containing SWRL rules. Compared to non-chained domain ontologs, reasoning is more complex, closer to real-world applications, and better reflects the low efficiency of logical reasoning in complex domain ontologs.
[0084] First, we analyze the similarity between ARBS's reasoning results on unlinked domain knowledge graphs and its reasoning results on the overall graph. Based on the conclusions drawn from the previous axiom analysis, for reasoning on unlinked domain knowledge graphs, only the first-order subgraph based on the instance is needed; in this case, single-hop reasoning can obtain relatively good approximate reasoning results. The reasoning results of ARBS on the three unlinked domain knowledge graphs #F1, #S1, and #T1 are shown in Table 1: Table 1. Reasoning results of ARBS on a non-linked domain knowledge graph.
[0085] Table This represents an approximate extended domain knowledge graph obtained through ARBS inference. The values represent the similarity scores. Table 1 shows that although graphs #F1, #S1, and #T1 are constructed and reasoned based on different domain ontologies, without including chain-reasoning axioms and rules, the ABRS inference results on all graphs based on instance-based first-order subgraphs are... The values all reached 100%, exceeding the set similarity threshold. α =95%. This indicates that at this point... and ′ The results are the same. ARBS can very well approximate the reasoning results on the whole graph. That is, for reasoning in a non-linked domain knowledge graph, single-hop reasoning can obtain very good approximate reasoning results, which verifies the analysis conclusion above.
[0086] Next, we analyze the approximation effect of ARBS in knowledge graph reasoning in chained domains. The results of ARBS in knowledge graph reasoning in chained domains are shown in Table 2: Table 2 shows the reasoning results of ARBS on a knowledge graph with chains.
[0087] Table l max This represents the maximum inference chain length within the chained domain ontology. k r The minimum subgraph order is calculated using an empirical formula based on the subgraph order selection. For chained domain knowledge graphs #F1, #S1, and #T1, the ARBS subgraphs at order 1, 2, and 3 (i.e., ...) are calculated for each instance. k ={1 , 2 , 3) The result of the inference Values. As can be seen from Table 2, the most obvious change is with increasing subgraph order. k The increase, The value also increases accordingly. On #F1, when... k When =1, The value is 82.50%, when k When =2, The value is 98.96%, when k When =3, The value is 99.70%. On #S1, when... k =1 and k When =2, The values were 11.87% and 25.11% respectively, while when k When =3, then The value reached 100%. Similar results were also observed for #T1. This indicates that the higher the order of the subgraph, the closer the ARBS results are to the inference results on the overall knowledge graph. This is as expected, because the higher the order of the subgraph, the closer the subgraph is to the complete domain knowledge graph. Furthermore, the table also shows that for #F1, #S1, and #T1, when the order of the subgraph... k Pick k r When the values are (i.e., respectively) k =2, 3, 3), ARBS corresponding to the three spectra on the three spectra. The values were 98.96%, 100%, and 99.68%, respectively, all exceeding the set similarity threshold. α =95%, indicating that the expected approximation level has been achieved. The above analysis shows that for reasoning in a chained domain knowledge graph, when the order of the subgraph satisfies the empirical formula, ARBS can approximate the reasoning results on the overall domain knowledge graph quite well, which is consistent with the analysis conclusions above.
[0088] Table 3 compares the time consumption of ARBS inference and inference on the overall domain knowledge graph on datasets of different sizes. Table 3 Comparison of Reasoning Time
[0089] In the experiment, #F1 #F4, Settings k =2, Dataset #T1 #T4, take k =3. In the table, ′ This represents the time consumed in reasoning across the entire domain knowledge graph. The table shows the inference time consumed by ARBS. The inference time in the experiment does not include the time for result serialization. The unit is seconds. "-" indicates that inference could not proceed due to memory overflow or that no inference result was obtained after more than 10 hours. Furthermore, since all subgraph inference processes are independent in ARBS, parallel inference is possible. The experiment compared single-threaded, 2-threaded, and 4-threaded parallel inference. Table 3 shows that for #F1... #F4, in all experiments All less than ′ This indicates that the inference time of ARBS is consistently shorter than that of the overall graph inference. Furthermore, it is quite evident that the time advantage of ARBS becomes increasingly pronounced as the graph size increases. For example, for #F1, the time consumed by ARBS single-threaded inference is 26 seconds, while the time consumed by overall graph inference is 174 seconds, the latter being approximately 7 times the former. For #F4, the time consumed by overall graph inference is approximately 85 times that of ARBS single-threaded inference and approximately 220 times that of 4-thread parallel inference, meaning that ARBS has a significantly faster inference speed.
[0090] The table also shows that on #T1, in the experiment... Slightly larger ′ This indicates that ARBS consumes more time, but both are on the same order of magnitude, with little difference. (Regarding #T2) In #T4, the ontology inference engine is unable to perform inference on the overall domain knowledge graph. In this case, inference fails due to memory overflow or failure to return results after more than 10 hours. However, ARBS can still perform inference and effectively obtain the results. This demonstrates that ARBS has better scalability to the domain knowledge graph and can perform effective inference in situations where inference on the overall domain knowledge graph is insufficient. The inference results for #F4 also verify this conclusion.
[0091] Furthermore, the table shows that compared to single-threaded inference, multi-threaded parallel computation can further improve the speed of ARBS. For example, for #F1, single-threaded inference takes 26 seconds, two-threaded parallel inference takes 14 seconds, and four-threaded parallel inference only takes 8 seconds to complete. However, more parallel threads do not necessarily mean higher inference efficiency; it is limited by computer performance. When the graph is large, too many parallel threads will consume a lot of computing resources, leading to reduced inference efficiency or inference failure. A clear example is #T4, where due to memory overflow, four-threaded parallel inference cannot obtain inference results.
[0092] The experiments above demonstrate that ARBS offers better scalability compared to overall graph reasoning. It can transform reasoning problems on large-scale graphs into a linear superposition of reasoning on smaller subgraphs, and can further improve reasoning speed through parallel computing. Furthermore, ARBS can still effectively obtain reasoning results even when large-scale graphs cannot be directly reasoned about.
[0093] It should be understood that, although The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this invention, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Furthermore, At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0094] In one embodiment, a domain knowledge graph neural symbolic reasoning system based on subgraph partitioning is provided, comprising: The subgraph order calculation module is used to dynamically determine the length of the longest relation chain in the domain knowledge graph reasoning task by parsing the axioms of the domain ontology, and calculate the corresponding subgraph order based on the length of the longest relation chain and the pre-set mapping rules. The subgraph partitioning module is used to partition k-order subgraphs based on the subgraph order, with each instance in the domain knowledge graph as the center, and to perform reasoning on each k-order subgraph through a symbolic inference engine to generate an extended subgraph containing implicit assertions; the input of the symbolic inference engine is the k-order subgraph and the domain ontology axioms; The model training module is used to train the neural network by using the k-th order subgraph and the extended subgraph as training sample pairs to learn the mapping relationship from the k-th order subgraph to the extended subgraph, and obtain the trained neural network model. The reasoning processing module is used to divide the domain knowledge graph to be reasoned into k-order subgraphs centered on each instance, input the k-order subgraphs to be reasoned into the trained neural network model, and obtain the reasoning results of each k-order subgraph. The result output module is used to merge the reasoning results by cross-subgraph deduplication and chain assertion completion rules, and output the extended domain knowledge graph of the domain knowledge graph to be reasoned.
[0095] Specific limitations regarding the subgraph partitioning-based domain knowledge graph neural symbolic reasoning system can be found in the limitations of the subgraph partitioning-based domain knowledge graph neural symbolic reasoning method described above, and will not be repeated here. Each module in the aforementioned subgraph partitioning-based domain knowledge graph neural symbolic reasoning system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0096] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0097] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A subgraph partition-based domain knowledge graph neural symbolic reasoning method, characterized in that, The method comprises: determining the longest relationship chain length of the domain knowledge graph reasoning task by analyzing the domain ontology axioms, calculating the corresponding subgraph order number according to the longest relationship chain length and a pre-set mapping rule; centering on each instance in the domain knowledge graph, dividing k-order subgraphs according to the subgraph order number, performing reasoning on each k-order subgraph by a symbolic reasoning machine to generate an extended subgraph containing implicit assertions, and taking the k-order subgraph and the domain ontology axioms as inputs of the symbolic reasoning machine; training a neural network to learn the mapping relationship from the k-order subgraph to the extended subgraph by taking the k-order subgraph and the extended subgraph as a training sample pair, and obtaining a trained neural network model; dividing a to-be-reasoned domain knowledge graph into to-be-reasoned k-order subgraphs each centered on an instance, inputting the to-be-reasoned k-order subgraph into the trained neural network model, and obtaining a reasoning result of each to-be-reasoned k-order subgraph; merging the reasoning results according to a cross-subgraph deduplication and chained assertion completion rule, and outputting an extended domain knowledge graph of the to-be-reasoned domain knowledge graph.
2. The method of claim 1, wherein, The method of dynamically determining the longest relationship chain length of the domain knowledge graph reasoning task by analyzing the domain ontology axioms comprises: analyzing the domain ontology axioms, and distinguishing the domain ontology into a chain-free domain ontology or a chained domain ontology according to the domain ontology axioms; if it is a chain-free domain ontology, determining that the longest relationship chain length is 2; if it is a chained domain ontology, analyzing the reasoning chain structure corresponding to each axiom, and obtaining the longest relationship chain length according to the reasoning chain length involving the largest number of different instances.
3. The method of claim 1, wherein, The mapping rule comprises that a subgraph order and a longest relationship chain length satisfy wherein, is a subgraph order, is a longest relationship chain length, is a rounding up.
4. The method of claim 1, wherein, The method of performing reasoning on each k-order subgraph by a symbolic reasoning machine to generate an extended subgraph containing implicit assertions comprises: inputting the k-order subgraph and the analyzed domain ontology axioms into the symbolic reasoning machine, wherein the domain ontology axioms comprise at least one of a concept inclusion axiom, a role transmission axiom, a role composition axiom and a SWRL rule; the symbolic reasoning machine derives implicit class assertions of an instance and a parent class based on the concept inclusion axiom, derives indirect relationship assertions between instances based on the role transmission axiom, and derives implicit relationship assertions conforming to rule premises based on the SWRL rule; integrating all the derived implicit assertions and the explicit assertions in the k-order subgraph to form an extended subgraph containing the explicit assertions and the implicit assertions, and ensuring consistency of the instance association between the extended subgraph and the k-order subgraph.
5. The method of claim 1, wherein, The method of merging the reasoning results according to the cross-subgraph deduplication and chained assertion completion rule to output an extended domain knowledge graph of the to-be-reasoned domain knowledge graph comprises: traversing the extended subgraphs of all to-be-reasoned subgraphs, comparing entity pairs and relationship types of the assertions, and deleting the same repeated assertions; according to the role transmission axiom in the domain ontology, identifying a broken relationship chain, and completing the missing assertions of the intermediate nodes; integrating all the deduplicated and completed assertions to obtain an extended assertion set of the to-be-reasoned domain knowledge graph. 6.A subgraph partition based domain knowledge graph neural symbolic reasoning system, characterized in that, The system comprises: a subgraph order number calculation module configured to dynamically determine the longest relationship chain length of the domain knowledge graph reasoning task by analyzing the domain ontology axioms, and calculate the corresponding subgraph order number according to the longest relationship chain length and a pre-set mapping rule; a subgraph division module, configured to divide k-order subgraphs according to the order of subgraphs in the domain knowledge graph with each instance in the domain knowledge graph as the center, perform reasoning on each k-order subgraph by a symbolic reasoning machine, and generate an extended subgraph containing implicit assertions, wherein the input of the symbolic reasoning machine is the k-order subgraph and the domain ontology axiom; a model training module, configured to train a neural network by taking the k-order subgraph and the extended subgraph as a training sample pair, learn the mapping relationship from the k-order subgraph to the extended subgraph, and obtain a trained neural network model; a reasoning processing module, configured to divide a to-be-reasoned k-order subgraph with each instance as the center from a to-be-reasoned domain knowledge graph, input the to-be-reasoned k-order subgraph into the trained neural network model, and obtain a reasoning result of each to-be-reasoned k-order subgraph; a result output module, configured to merge the reasoning results according to a cross-subgraph deduplication and chain assertion completion rule, and output an extended domain knowledge graph of the to-be-reasoned domain knowledge graph.