Method for retrieving information from knowledge graph

By embedding machine learning systems to generate class and attribute vector representations of knowledge graph ontology, a context-based ontology is constructed, which solves the problems of non-expert accessibility and lack of specificity in queries of knowledge graphs, and achieves more accurate information retrieval and resource optimization.

CN121901262APending Publication Date: 2026-04-21ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ROBERT BOSCH GMBH
Filing Date
2025-10-20
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Traditional knowledge graphs suffer from poor accessibility to non-experts, and domain-specific queries generated by large language models lack specificity, resulting in insufficient accuracy in information retrieval.

Method used

By embedding machine learning systems to generate class and attribute vector representations of knowledge graph ontology, embedding natural language queries, identifying relevant classes and attributes, constructing context-based ontology, and generating structured queries to retrieve information.

Benefits of technology

It improves the accuracy of information retrieval and the ability of non-expert users to access domain-specific knowledge, reduces the consumption of computing resources, and generates more accurate structured queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121901262A_ABST
    Figure CN121901262A_ABST
Patent Text Reader

Abstract

A method for information retrieval from a knowledge graph is provided. A computer-implemented method of retrieving information from a knowledge graph (1). An embedding (300) of a natural language input query (3) and embedding (201, 202, 203) of classes and attributes of an ontology (2) of a knowledge graph are generated by an embedding machine learning system (10). By comparing these inlays, relevant classes and attributes of the ontology (2) relative to the input query (3) are identified. Subsequently, context-based ontologies (3a) are determined as a subset of the ontologies (2), the subset comprising the identified relevant classes and attributes. A structured form query (3A) is determined by a first machine learning system (20) based on the natural language input query (3) and the provided context-based ontology (2A), and information queried by the input query (3) is retrieved from the knowledge graph (1) by executing the determined structured form query (3a) for the knowledge graph (1).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a computer implementation method for information retrieval from a knowledge graph, a corresponding system for information retrieval from a knowledge graph, a computer program, and a machine-readable storage medium. Background Technology

[0002] Knowledge graphs (KGs) play a crucial role in domain-specific knowledge modeling. Especially in production environments, KGs serve as the infrastructure for organizing and linking domain-specific information across multiple data silos. However, traditional KGs have inherent limitations, particularly regarding accessibility to non-experts. Therefore, extracting relevant information from KGs using query languages ​​such as SPARQL presents a significant challenge for users unfamiliar with these specialized tools.

[0003] Large language models (LLMs) have demonstrated the ability to transform text-based questions into grammatically correct queries such as SPARQL. However, because LLMs may not have been exposed to domain-specific knowledge during their training, the generated queries often lack the specificity required for that domain. Summary of the Invention

[0004] According to a first aspect, the present invention relates to a computer-implemented method for information retrieval from a knowledge graph. The knowledge graph, together with its corresponding ontology, can be stored in a computer's storage device. The knowledge graph may include a data structure having multiple entities, relationships between entity pairs, and valued attributes assigned to entities. The ontology corresponding to the knowledge graph may include formal specifications of classes and attributes. Attributes may be properties or relationships between classes in the ontology. Entities in the knowledge graph are instances (i.e., members / elements of classes) of classes in the ontology, and relationships in the knowledge graph are instances / representations of attributes in the ontology, representing specific occurrences of attributes in the ontology. Generally, the ontology corresponding to the knowledge graph can be understood as a blueprint or schema that defines the structure, vocabulary, and rules for the knowledge graph, wherein the knowledge graph includes specific instances of classes and attributes in the ontology. The method according to the first aspect may include the following steps: in a method step, embedding the classes and attributes of the ontology of the knowledge graph using an embedding machine learning system. In other words, in this step, a vector representation / embedding of the classes and attributes of the ontology of the knowledge graph is generated by the embedding machine learning system. The embedding of a quantity (such as a class or attribute) can be a vector representation of the quantity, which can, for example, capture the semantics and / or relations of the quantity in the ontology. This method step can be performed once for classes and attributes in the ontology. In the next step, the embedding machine learning system determines the embedding of the input query. The input query can be given as a natural language input query for retrieving information from a knowledge graph. In other words, in this step, the embedding of the natural language input query is generated by the embedding machine learning system. Therefore, the embedding space of the input query coincides with the embedding space of the classes and / or attributes of the ontology. It is worth noting that this method step must be performed for each natural language input query, while the step of determining the embedding of the classes and attributes of the ontology can be performed only once, and the corresponding embeddings can then be stored for further use. In the next step, those parts of the ontology that have the (most) similar embeddings to the determined embedding of the input query are retrieved as relevant classes. In other words, relevant classes and attributes of the ontology relative to the input query are identified by comparing the embedding of the input query with the embeddings of the classes and attributes of the ontology. In this context, the comparison of the corresponding embeddings may include using a similarity measure between the input query embedding and the class and attribute embeddings. Similarity can be measured using cosine similarity. A class or attribute is identified as relevant when the similarity measure between the embedding of the input query and the embedding of the corresponding attribute or class is greater than a predefined value. In the next step, a smaller ontology (hereinafter referred to as the context-based ontology) is constructed, which includes the identified relevant classes and attributes. In other words, the context-based ontology is determined as a subset (or part) of the ontology, where the subset of the ontology includes the identified relevant classes and / or attributes. In the next step, a structured query is determined based on the input query and the provided context-based ontology.A structured query can be determined by a first machine learning system, and the structured query is executable for the knowledge graph, thereby retrieving information in response to a natural language query. The first machine learning system may differ from an embedded machine learning system. In other embodiments, the first machine learning system may include an embedded machine learning system. The first machine learning system may receive a natural language input query and may determine a structured query as output. The structured query may be, for example, a SPARQL query. A SPARQL query is a formal language expression used to retrieve and manipulate data stored in a graph database (such as a knowledge graph) that conforms to the RDF data model. The RDF data model structures information into triples, each triple consisting of a subject, a predicate, and an object, thereby forming a graph representation of the corresponding information / knowledge.

[0005] In the next method step, information queried by the input query is retrieved from the knowledge graph by performing a determined structured query on the knowledge graph.

[0006] Advantageously, the proposed method improves the accuracy of information retrieval from knowledge graphs. By embedding both ontology elements (classes and attributes) and natural language queries into a shared embedding space, the method enables comparison of their respective semantics. The ontology is then pruned into subsets / parts (i.e., context-based ontologies relevant to the input query), and this context-based ontology is provided to a first machine learning system. This operation enhances the first machine learning system's ability to generate queries with specific structured forms for accurate information retrieval. This can be an improvement over, for example, keyword-based searches, which may often be hampered by, for example, synonyms and implicit relations. Comparison at the embedding level allows for the identification of relevant ontology elements, even if the natural language input query does not use exactly the same terms. This improves the accuracy of retrieving information that semantically matches the user's intent, even if that information is not explicitly provided in the input query. By allowing users to express their information requests in natural language while simultaneously enhancing the query and aligning it with specific context from the ontology relevant to that query, the method thus enhances information retrieval from knowledge graphs. Accordingly, this paper proposes a framework that improves access to knowledge graphs by identifying and adding unique domain knowledge. This framework helps first-generation machine learning systems construct correctly structured queries (e.g., SPARQL queries) for information retrieval, given a specific input question provided in natural language. The inventors found that the additional, tailored domain knowledge provided to generate such structured queries improves the performance / accuracy of the natural language query to structured query conversion and information retrieval from the knowledge graph. In particular, it improves non-expert access to specific / precise / relevant domain knowledge.

[0007] Furthermore, the proposed framework can be used in conjunction with each "standard" knowledge graph, such as in production management and data management. This framework enables non-experts to query requested data within a knowledge graph without prior knowledge of structured query languages ​​(e.g., SPARQL). For users proficient in structured queries for information retrieval from knowledge graphs but unfamiliar with a specific domain, the framework can further support these users in generating correct / relevant structured queries for knowledge graphs within that domain by providing them with suggested structured queries.

[0008] Generally, when aligning the general capabilities of pre-trained large language models (LLMs)—in the context of this disclosure, the first machine learning system can be provided by such large language models—with more specific domains and tasks, it is crucial to provide context-relevant content that enables these general models to accurately access and apply domain-specific knowledge. This can be achieved in various ways, such as direct incorporation of the entire ontology, sub-ontology selection via naive reduction, or context-based reduction methods based on semantic similarity. Subsequently, the selected content can be passed to the LLM in a manner such as Retrieval Augmentation (RAG). It is worth noting that providing the complete ontology to the LLM (here: the first machine learning system) may often be impossible or undesirable due to the limited context window or high cost of the LLM (a large number of tokens will increase the cost of the LLM). The inventors have observed that context-reduced content in the form of a context-based ontology does not impair the performance of structured query generation. In contrast, it can help prevent the illusion of an LLM and save computational resources.

[0009] Preferably, natural language definitions and / or axioms for classes and attributes from the ontology are generated by deriving definitions and / or axioms from the actual connections between classes and attributes within the ontology. Further, the class definitions and / or attribute definitions of the ontology (the definitions or axioms being, for example, parts of the indexes of the corresponding classes or attributes) can subsequently be enriched / enhanced by adding the corresponding generated natural language definitions and / or axioms. In particular, these foregoing optional steps can be performed before determining the context-based ontology. Specifically, the ontology thus enriched can be used in subsequent steps to generate class and attribute embeddings for the ontology.

[0010] Advantageously, this yields a context-rich ontology whose entries are information / content-enriched, and thus these entries can be better interpreted and used when the first machine learning system generates a structured query corresponding to the input query.

[0011] Preferably, the ontology can be further enhanced by adding class and attribute definitions and / or axioms identified in such a way as querying a first machine learning system to determine such definitions for queries based on class or attribute names.

[0012] Preferably, before the first machine learning system determines the structured query, the added generative definitions and / or axioms can be additionally provided to the first machine learning system along with the context-based ontology.

[0013] Advantageously, this can further enhance the contextual understanding of the first machine learning system. Definitions and axioms provide explicit semantic information about the relationships between concepts within a context-based ontology. This deeper understanding allows the machine learning system to generate more accurate and context-relevant structured queries. In particular, definitions can help disambiguate between multiple meanings of terms based on a given specific context. Axioms can introduce logical rules that enable the system to infer implicit relationships and retrieve information that may not be directly expressed in the input query. Therefore, by providing the machine learning system with richer semantic context through definitions and axioms, this approach enhances its ability to translate natural language queries into more accurate and efficient structured queries, thereby leading to the retrieval of more relevant and accurate information from the knowledge graph.

[0014] Preferably, a context-based ontology is determined as a subset of the ontology, which includes the identified relevant classes and / or attributes and one of the following: - The n-hop neighbors corresponding to the relevant class or attribute, or - At least one module, which includes at least one related class or property.

[0015] n-hop neighbors include all classes and attributes in the ontology whose distances to the identified related classes are at most a predefined distance n. Modules in an ontology can be unique parts of the ontology, containing a defined set of concepts and relationships that relate to / dominate a specific topic or function. Modules may include subsets of classes, attributes, and axioms related to a predefined scope. For example, a module may include a class, its subclasses, a superclass of that class, and all attributes / connections between the superclass, class, and subclasses.

[0016] Advantageously, by focusing on relevant subsets of the ontology, the system avoids unnecessary exploration of irrelevant concepts and relations. This reduces the computational resources required for query processing, thereby improving efficiency. By using a context-based ontology during formal query generation, this method optimizes resource utilization and enables efficient retrieval even with large and complex knowledge graphs / corresponding ontologies.

[0017] Preferably, the method further includes the steps of: encoding the context-based ontology into a text representation that a first machine learning system can understand / process, and providing the text representation of the context-based ontology to the first machine learning system. The text representation of the context-based ontology can be, for example, a list format, a table format, or a plain text representation of the context-based ontology. However, the context-based ontology can also be provided to the first machine learning system in RDF format. The first machine learning system can be pre-trained in this manner to understand / interpret the RDF format.

[0018] Preferably, the ontology includes concepts as classes such as machine, process, material, plant, production owner, and / or quality inspection, and includes links between the aforementioned concepts as at least a subset of attributes. For example, the links may be given by one of hasProcess, requiresMaterial, hasProperty, locatedIn, etc.

[0019] Preferably, the input query includes an information retrieval request relating to a machine, a group of interconnected machines, and / or a manufacturing process that can be performed by the machine or the group of machines. In such scenarios, the method may further include the following steps. In an additional step, a control signal may be determined based on information retrieved from a knowledge graph. In a further additional step, the actuators of the machine or the group of machines may be controlled via the determined control signal. The control signal may be configured to: replace one machine with another during production, or interrupt the machine thereby interrupting the manufacturing process, depending on the retrieved information.

[0020] According to a further aspect, the present invention relates to a system comprising a processor configured to perform the methods described herein.

[0021] In particular, the present invention further relates to a (control) system configured to determine a control signal by performing the above-described method steps, wherein the control signal is configured to control an actuator.

[0022] According to a further aspect, the present invention relates to a computer program having machine-readable instructions, which, when executed on one or more computers, cause the computers to perform one of the computer implementation methods described above and below. Furthermore, according to another aspect, the present invention relates to a machine-readable storage medium on which the aforementioned computer program is stored. Attached Figure Description

[0023] Embodiments of the present invention will be discussed in more detail with reference to the following drawings. The drawings show: Figure 1 This is a flowchart of an exemplary embodiment; Figure 2 This is a flowchart of an exemplary embodiment; Figure 3 This is an exemplary system for retrieving information from a knowledge graph. Detailed Implementation

[0024] Figure 1 A flowchart of method 1000 according to an embodiment of the proposed method is shown. In step 101, embeddings of classes and attributes of the ontology are generated by an embedding machine learning system to create a knowledge graph of the ontology. In a subsequent step 102, embeddings of a natural language input query are generated by the embedding machine learning system. In step 103, relevant classes and attributes of the ontology are identified for the input query. This is accomplished by comparing the embeddings of the input query with the embeddings of the classes and attributes. In step 104, a context-based ontology is determined as a subset of the ontology, which includes the identified relevant classes and attributes. The context-based ontology may be given as a subset of the ontology, which includes the identified relevant classes and attributes and their respective n-hop neighbors, wherein the n-hop neighbors include all classes and attributes in the ontology whose distance to the identified relevant classes or attributes is at most a predefined distance n. Alternatively or additionally, the context-based ontology may be given as a subset of the ontology, which includes the identified relevant classes and attributes and at least one module including the relevant classes or attributes. In step 105, a structured form query is determined based on the natural language input query and the provided context-based ontology. This determination can be performed by a first machine learning system that receives the natural language input query and the provided context-based ontology as input and determines a structured form query for information retrieval from the knowledge graph as output. The structured form query is executable against the knowledge graph to retrieve information in response to the natural language query. Optionally, the context-based ontology can be encoded into a text representation that the first machine learning system can understand / process before being provided as input. This text representation can be, for example, in tabular, list, or plain text format. In a further method step 106, the information queried by the input query is retrieved from the knowledge graph by performing the determined structured form query against the knowledge graph. In an optional method step 100, natural language definitions and / or axioms of classes and attributes from the ontology can be derived from the actual connections between classes and attributes in the ontology, and the class definitions and / or attribute definitions of the ontology can be enriched by adding the generated definitions and / or axioms to the ontology. The enriched ontology can then be used in subsequent step 101. It is worth noting that, for a given ontology, steps 100 and 101 can be performed only once, that is, these steps are independent of the actual natural language input query.

[0025] In a particular embodiment, the ontology may include concepts as classes such as machine, process, material, plant, production owner, and / or quality inspection, and includes links between the aforementioned concepts as at least a subset of attributes. Accordingly, in optional method step 107 relating to such embodiments, the input query may include an information retrieval request relating to a machine, a set of interconnected machines, and / or a manufacturing process executable by the machine or the set of machines, and in this method step 107, a control signal may be determined based on information retrieved from a knowledge graph. In a further optional method step 108, the actuators of the machine or the set of machines may be controlled by the determined control signal, thereby replacing one machine with another during production or interrupting the manufacturing process.

[0026] Figure 2A flowchart illustrating an embodiment for information retrieval from a knowledge graph 1 having a corresponding ontology 2 is shown. Optionally, ontology 2 may be enriched prior to context-based content reduction. Enrichment may be performed by generating natural language definitions (2a) and / or axioms (2a) derived from the actual connections between classes and attributes in the ontology for classes and attributes from the ontology, and enriching the class definitions and / or attribute definitions of the ontology by adding the generated definitions and / or axioms. This enrichment may be an optional step to enhance the utility of contextual information. For example, for an ontology lacking natural language definitions or descriptions of concepts, or lacking important axioms (such as, for example, rdfs:domain and rdfs:range), it may first be enriched by automatically generating natural language definitions and axioms from available information in the ontology. This may be accomplished, for example, by automatically generating descriptions of classes and attributes based on the ontology context. For example, a class may be described by its attributes, and attributes may be described by the domain (source class) and / or range (target class or data type) of their properties. Furthermore, attribute axioms such as rdfs:domain and rdfs:range are typically derived automatically from the SHACL constraints or naming conventions used when creating the ontology. In addition to content enrichment using information provided by the ontology, content enhancement can also be achieved by querying knowledge from large language models (e.g., a first machine learning system) or external sources (e.g., domain-related documentation). The content enrichment step not only provides the LLM with further (potentially crucial) context to generate better-formed queries (e.g., SPARQL queries) for information retrieval from the knowledge graph, but also helps identify relevant ontology concepts for a given natural language problem. That is, the method also has the potential to improve context reduction in terms of reducing the context to relevant ontology concepts before invoking the first machine learning system, which should determine the structured queries used for information retrieval from the knowledge graph. By embedding the machine learning system 10, vector embeddings of all classes and attributes (where attributes can be relations or properties) in ontology 2 can be determined. Thus, labels and descriptions (provided by the ontology or generated in previous ontology enrichment steps) can be used to encode entities of the ontology into the embedding space 4. Through the machine learning system 10, the natural language query 3 is embedded into the same embedding space 4. By performing a similarity search within the embedding space 4, the entities / elements (i.e., classes and attributes) most relevant to the given natural language question in ontology 2 are identified. This identification involves comparing the embedding 300 of the input query 3 with the embeddings 201, 202, and 203 of the classes and attributes using a similarity measurement. The similarity measurement could be, for example, cosine similarity. All corresponding embeddings 201, 202, and 203 whose deviations from the embedding 300 of the input query are at most predefined values ​​of classes and attributes can be identified as relevant classes and attributes, respectively. Figure 2The embeddings of relevant classes and attributes are located within a dotted-dash circle surrounding the input query embedding 300. Based on the results of the similarity search, the most relevant entities 201 and 203 of ontology 2 are extracted, and a context-based ontology 2A is subsequently constructed. For this purpose, the extracted relevant entities 201 and 203 can be used as anchors for the context-based ontology 2A (tailored to the “complete” ontology 2). In one embodiment, the context-based ontology 2A can be determined by adding n-hop relevant entities, classes, and attributes of ontology 2 (e.g., 1-hop or 2-hop) to the anchors. In other embodiments, the context-based ontology 2A can be determined by extracting modules from ontology 2, wherein the modules include the anchors, i.e., the identified relevant classes and attributes. The first machine learning system 20 can be provided with an input query 3 and a context-based ontology 2A, and based on the natural language input query 3 and the context-based ontology 2A, the first machine learning system 20 can then determine a structured form query 3a for information retrieval from the knowledge graph 1. The determined structured form query 3a is executable for the knowledge graph 1, thereby retrieving information in response to the natural language query. Subsequently, by performing the determined structured query 3a on the knowledge graph 1, the information queried by the natural language input query 3 is retrieved from the knowledge graph 1.

[0027] Figure 3 An exemplary embodiment of a system 70 for information retrieval from a knowledge graph is shown. The system includes at least one processor 71 and at least one machine-readable storage medium 72, the machine-readable storage medium 72 containing instructions that, when executed by the processor 71, cause the data processing system 70 to perform a method according to an aspect or embodiment of the invention described herein.

Claims

1. A computer-based method (1000) for information retrieval from a knowledge graph, the method comprising the following steps: Embedding of classes and attributes of ontology generated by embedding machine learning systems (101); Embeddings of natural language input queries are generated by embedding machine learning systems; By comparing the embedding of the input query with the embedding of classes and attributes, (103) relevant classes and attributes relative to the ontology of the input query are identified; Determine (104) a context-based ontology as a subset of the ontology, the subset including the identified relevant classes and attributes; Using the first machine learning system, based on natural language input queries and the provided context-based ontology, a structured query is determined (105), wherein the structured query is executable for the knowledge graph, thereby retrieving information in response to the natural language query. as well as The information queried is retrieved from the knowledge graph by performing a structured query on the knowledge graph (106).

2. The method according to claim 1, further comprising the following steps: For classes and attributes from the ontology, generate (100) natural language definitions (2a) and / or axioms (2a) derived from the actual connections between classes and attributes in the ontology, and enrich the class and / or attribute definitions of the ontology by adding the generated definitions and / or axioms.

3. The method according to claim 2, wherein, Before the structured query is determined by the first machine learning system, the added generative definitions and / or axioms are provided to the first machine learning system along with the context-based ontology.

4. The method according to any one of the preceding claims, wherein, The context-based ontology is determined as a subset of the ontology, the subset including the identified relevant classes and attributes and one of the following: The corresponding n-hop neighbors of the relevant classes and attributes, wherein the n-hop neighbors include all such classes and attributes in the ontology: the distance between the class and the identified relevant class or attribute is at most a predefined distance n; At least one module, wherein the at least one module includes related classes and attributes.

5. The method according to any one of the preceding claims, wherein, The method further includes the following steps: encoding the context-based ontology into a text representation that can be understood / processed by a first machine learning system, and providing the text representation of the context-based ontology to the first machine learning system.

6. The method according to any one of the preceding claims, wherein, The ontology includes concepts as classes such as machine, process, material, plant, production owner, and / or quality inspection, and includes links between said concepts as at least a subset of attributes.

7. The method according to any one of the preceding claims, wherein, The input query includes an information retrieval request relating to a machine, a set of interconnected machines, and / or a manufacturing process that can be performed by said machine or said set of interconnected machines, and the method further includes the following steps: The control signal (107) is determined based on information retrieved from the knowledge graph; The actuators of the machine or the group of interconnected machines are controlled by the determined control signals (108) to replace one machine with another during production or to interrupt the manufacturing process.

8. A system (70) including a processor (71) configured to perform the method steps according to any one of claims 1 to 7.

9. A computer program comprising instructions that, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 7.

10. A computer-readable data carrier (72) having thereon a computer program according to claim 9.