Methods for retrieving information from a knowledge graph

The method embeds ontology classes and properties to align natural language queries with context-based ontologies, addressing non-expert access and query specificity issues in knowledge graphs, enhancing retrieval accuracy and efficiency.

JP2026073980APending Publication Date: 2026-05-01ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
ROBERT BOSCH GMBH
Filing Date
2025-10-17
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Conventional knowledge graphs (KGs) are challenging for non-experts to access due to their specialized query languages like SPARQL, and large language models (LLMs) lack domain-specific knowledge, leading to unspecific queries.

Method used

A method that embeds ontology classes and properties using machine learning, aligns natural language queries with a context-based ontology subset, and generates structured queries like SPARQL for accurate information retrieval.

Benefits of technology

Enhances non-expert access to domain-specific knowledge graphs by improving query accuracy and reducing computational resources, allowing natural language queries to generate precise structured queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026073980000001_ABST
    Figure 2026073980000001_ABST
Patent Text Reader

Abstract

This relates to a computer-implemented method for retrieving information from a knowledge graph (1). [Solution] An embedding machine learning system (10) generates embeddings (300) of the natural language input query (3) and embeddings (201, 202, 203) of classes and properties of the knowledge graph ontology (2). By comparing each embedding, the relevant classes and properties of the ontology (2) for the input query (3) are identified. Subsequently, a context-based ontology (2A) is determined as a subset of the ontology (2) containing the identified relevant classes and properties. A first machine learning system (20) determines a structured query (3a) based on the natural language input query (3) and the supplied context-based ontology (2A), and by executing the determined structured query (3a) against the knowledge graph (1), the information queried by the input query (3) is obtained from the knowledge graph (1).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a computer-implemented method for obtaining information from a knowledge graph, a corresponding system for obtaining information from a knowledge graph, a computer program, and a machine-readable storage medium.

Background Art

[0002] Background Art Knowledge graphs (KGs) play an important role in the modeling of knowledge about a particular domain. In particular, in the production domain, KGs serve as an infrastructure for compiling and linking specific domain information across many data silos. However, conventional KGs have inherent limitations, especially from the perspective of accessibility to non-experts. For this reason, using a query language such as SPARQL to extract relevant information from a KG poses a significant challenge to users who are not proficient in these specialized tools.

[0003] Large language models (LLMs) have demonstrated the ability to convert text-based questions into, for example, syntactically correct SPARQL queries. However, the queries obtained from this often do not have the specificity required for a particular domain because the LLMs have not been exposed to domain-specific knowledge during training.

Summary of the Invention

Means for Solving the Problems

[0004] Disclosure of the Invention According to a first aspect, the present invention relates to a computer-implemented method for retrieving information from a knowledge graph. A knowledge graph can be stored in computer storage along with its corresponding ontology. A knowledge graph may include a data structure having multiple entities, relationships between pairs of entities, and attributes having values ​​assigned to entities. The ontology corresponding to a knowledge graph may include formal specifications for classes and properties. Properties may be attributes of relationships between classes in the ontology. Entities in a knowledge graph are instances (i.e., members / elements) of classes in the ontology, and relationships in a knowledge graph are instances that represent specific occurrences of properties in the ontology. Generally, the ontology corresponding to a knowledge graph can be understood as a blueprint or schema that defines the structure, vocabulary, and rules of the knowledge graph, including specific instances of classes and properties in the ontology. The method according to the first aspect may include the following steps: In one method step, the classes and properties of the knowledge graph ontology are embedded by an embedded machine learning system. In other words, in this step, the embedded machine learning system generates vector representations / embeddings of classes and properties of the ontology in the knowledge graph. Embeddings of quantities such as classes or properties may be, for example, vector representations of the quantities that can capture their semantic meaning and / or relationships in the ontology. This method step can be performed once for classes and properties in the ontology. In the next step, the embedded machine learning system determines the embedding of an input query. The input query may be given as a natural language input query to retrieve information from the knowledge graph. In other words, in this step, the embedded machine learning system generates embeddings of the natural language input query. This causes the embedding space of the input query to match the embedding space of the classes and / or properties of the ontology.It should be noted that while the method step must be performed for each natural language input query, the step of determining the embeddings of classes and properties in the ontology only needs to be performed once, after which each embedding becomes storable for further use. In the next step, these parts of the ontology are obtained / identified as related classes having the (most) similar embeddings to the determined embeddings of the input query. In other words, the related classes and related properties of the ontology for the input query are identified by comparing the embeddings of the input query with the embeddings of classes and properties in the ontology. In this association, the comparison of each embedding may involve using a similarity measure between the embeddings of the input query and the embeddings of classes and properties. The similarity measure may be given by cosine similarity. If the similarity measure between the embeddings of the input query and the embeddings of each property or class is greater than a given value, the class and property can be determined as related classes and related properties. In the next step, a smaller ontology containing the identified related classes and related properties is constructed, which will be referred to below as the context-based ontology. In other words, the context-based ontology is determined as a subset (or part) of the ontology, where the subset of the ontology includes identified related classes and / or related properties. In the next step, a structured query is determined based on the input query and the provided context-based ontology. The structured query is determinable by a first machine learning system and is executable against the knowledge graph to perform information retrieval 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 can receive a natural language input query and determine a structured query as output. The structured query may be, for example, a SPARQL query.SPARQL queries are a formal language representation for searching and processing data stored in graph databases that conform to the RDF data model, such as knowledge graphs. The RDF data model structures information as triplets consisting of a subject, predicate, and object, thereby forming a graph representation of each piece of information / knowledge. In the following method step, the information queried by the input query is retrieved from the knowledge graph by executing the determined structured formal query against the knowledge graph.

[0005] Advantageously, the proposed method improves the accuracy of retrieving information from the knowledge graph. This method allows for a comparison of the semantic meanings of ontology elements (classes and properties) and natural language queries by embedding them in a shared embedding space. The ontology is then pruned into subsets / parts, i.e., context-based ontologs relevant to the input query, which are then fed into a first machine learning system, thereby enhancing the system's capabilities to generate specific structured queries for accurate information retrieval. This can often be an improvement over keyword-based searches, for example, which may compete with synonyms and implicit relationships. The comparison at the embedding level allows for the identification of relevant ontology elements even if the natural language input query does not use strictly identical terminology. This improves the accuracy of retrieving information that semantically matches the user's intent, even when not explicitly provided in the input query. Therefore, this method can enhance the retrieval of information from the knowledge graph by enabling users to express their information requests in natural language, while further enhancing queries and aligning them with specific contexts from related ontologs. Accordingly, this specification proposes a framework for improving data access to the knowledge graph by identifying and adding separate domain knowledge to assist a first machine learning system in constructing correct structured queries (e.g., SPARQL queries) for information retrieval, given specific input questions supplied in natural language. The inventors have found that pruned additional domain knowledge supplied for the generation of such structured queries improves the performance / accuracy of the conversion from "natural language queries" to "structured queries" and the retrieval of information from the knowledge graph. In particular, non-expert access to specific / accurate / relevant domain knowledge is improved.

[0006] Furthermore, the proposed framework can be used in conjunction with any "standard" knowledge graph, for example, in production management, data management, etc. This means that non-experts can query the required data in the knowledge graph even if they are unfamiliar with structured query languages, such as SPARQL. Moreover, it can assist users who are not familiar with a particular domain but have experience with structured queries for retrieving information from the knowledge graph, thereby supporting the generation of correct / relevant structured queries for the knowledge graph in that domain by providing the determined structured queries as suggestions to the user.

[0007] Generally, when aligning the general capabilities of a pre-trained large-scale language model (LLM) (in the context of this disclosure, the first machine learning system may be provided by such a large-scale language model) to more specific domains and tasks, it is essential to provide contextually relevant content that enables these general models to accurately access and apply domain-specific knowledge. This can be achieved by various means, such as direct incorporation of the entire ontology, selection of sub-ontologies by simple reduction, or selection of sub-ontologies by context-based reduction methods based on semantic similarity. Each selected piece of content can then be passed to the LLM by techniques such as Search Enhancement Generation (RAG). It should be noted that providing the LLM (here, the first machine learning system) with a complete ontology is often not possible or undesirable due to the limited or high cost of the LLM's context window (a large number of tokens increases the LLM cost). The inventors have observed that contextually reduced content in the form of a context-based ontology does not impair the ability to generate structured queries. In contrast, this could help prevent hallucination of LLMs and save computational resources.

[0008] Preferably, natural language definitions and / or axioms for classes and properties from the ontology are generated by deriving the definitions and / or axioms from the actual connections between classes and properties in the ontology. Furthermore, the class definitions and / or property definitions of the ontology (the definitions or axioms are, for example, part of the index of each class or property) are enrichable / extendable by appending the generated natural language definitions and / or axioms, respectively. In particular, these optional steps described above can be performed before determining the context-based ontology. Specifically, the enriched ontology thus becomes available for use in subsequent steps that generate the embedding of classes and properties in the ontology.

[0009] Advantageously, this results in a rich context-based ontology that is better interpretable due to the enrichment of information / context and has ontology entries used by the first machine learning system when generating structured queries corresponding to input queries.

[0010] Preferably, the ontology is further extensible by querying a first machine learning system and adding class definitions, property definitions, and / or axioms identified by determining the definition of the query based on class names and property names.

[0011] Preferably, the generated and added definitions and / or axioms can be supplied to the first machine learning system along with the context-based ontology before the structured form query is determined by the first machine learning system.

[0012] Advantageously, this further enhances 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 distinguish between multiple meanings of a term based on a given specific context. Axioms can introduce logical rules that allow the system to infer implicit relationships and retrieve information that may not be directly stated in the input query. Thus, by supplying the machine learning system with a richer semantic context through definitions and axioms, this method can enhance its ability to translate natural language queries into more accurate and effective structured queries, thereby retrieving more relevant and accurate information from the knowledge graph.

[0013] Preferably, the context-based ontology is Identified related classes and related properties, One of the following, namely, - The corresponding n-hop neighborhoods of the related class or related property, or - At least one module containing at least one related class or related property One of them, It is determined as a subset of the ontology that includes the identified related class. The n-hop neighborhood includes all classes and properties in the ontology that include classes that are at least a given distance n from the identified related class. A module in an ontology is a separate part of the ontology that may include a set of defined concepts and relationships that relate to or govern a particular subject or functionality. A module may include a subset of classes, properties and axioms related to a given range. For example, a module may include a class, its subclasses, its superclasses, and all properties / connections between the superclass and the class and its subclasses.

[0014] Advantageously, the system avoids unnecessary searching for irrelevant concepts and relationships by focusing on relevant subsets of the ontology. This reduces the computational resources required for query processing and improves efficiency. By using context-based ontologs during formal query generation, the method can optimize resource utilization and enable efficient searching even for large and complex knowledge graphs / corresponding ontologs.

[0015] Preferably, the method further includes the steps of encoding a context-based ontology into a text representation understandable / processable by a first machine learning system, and supplying the text representation of the context-based ontology to the first machine learning system. The text representation of the context-based ontology may be, for example, a list format, a table format, or a plain text representation of the context-based ontology. The context-based ontology may also be supplied to the first machine learning system in RDF format. The first machine learning system may be pre-trained to understand / interpret the RDF format.

[0016] Preferably, the ontology includes, as classes, concepts of machine, process, material, plant, production owner, and / or quality inspection, and as properties, links between at least a subset of the above concepts. The links may be given by, for example, one of hasProcess, requireMaterial, hasProperty, locatedIn, etc.

[0017] Preferably, the input query includes a request for information retrieval related to a machine, a set of interconnected machines, and / or a manufacturing process that can be performed by a machine or set of machines. In such a scenario, the method further includes the following steps: In an additional step, a control signal can be determined based on the information obtained from the knowledge graph. In a further additional step, the actuators of a machine or set of machines can be controlled by the determined control signal. The control signal can be configured, depending on the retrieved information, so that one machine is replaced by another machine during the manufacturing process, or so that a machine is interrupted, thereby halting the manufacturing process.

[0018] In a further aspect, the present invention relates to a system comprising a processor configured to carry out the method described herein.

[0019] In particular, the present invention further relates to a (control) system configured to determine a control signal configured to control an actuator by carrying out the method steps described above.

[0020] In a further aspect, the present invention relates to a computer program that includes machine-readable instructions for causing one or more computers to perform one of the computer-implemented methods described above and below when executed on such computers. Furthermore, in another aspect, the present invention relates to a machine-readable storage medium storing the computer program.

[0021] Embodiments of the present invention will be described in more detail with reference to the following drawings. The drawings show the following: [Brief explanation of the drawing]

[0022] [Figure 1] This is a flowchart illustrating an exemplary embodiment. [Figure 2] This is a flowchart illustrating an exemplary embodiment. [Figure 3] FIG. is a diagram showing an exemplary system for obtaining information from a knowledge graph.

BEST MODE FOR CARRYING OUT THE INVENTION

[0023] Description of Embodiment Figure 1 shows a flowchart of Method 1000 according to an embodiment of the proposed method. In step 101, the embedded machine learning system generates embeddings of classes and properties of the knowledge graph ontology. In the next step 102, the embedded machine learning system generates embeddings of natural language input queries. In step 103, the associated classes and properties of the ontology are identified for the input query. This can be done by comparing the embedding of the input query with the embedding of classes and properties. In step 104, the context-based ontology is determined as a subset of the ontology containing the identified associated classes and properties. The context-based ontology may be given as a subset of the ontology containing the identified associated classes and properties and their respective n-hop neighbors, where the n-hop neighbors contain all classes and all properties in the ontology that contain classes at a maximum distance n from the identified associated class or property. Alternatively or additionally, the context-based ontology may be provided as a subset of the ontology, comprising identified related classes and related properties, and at least one module containing the related classes or related properties. In step 105, a structured query is determined based on the natural language input query and the supplied context-based ontology. This determination can be made by a first machine learning system, which can take the natural language query and the supplied context-based ontology as input and determine a structured query for information retrieval from the knowledge graph as output. The structured query is executable against the knowledge graph to perform information retrieval in response to the natural language query. Optionally, the context-based ontology can be encoded into a text representation that is understandable / processable by the first machine learning system before it is supplied as input to the first machine learning system.This may be, for example, in a table format, a list format, or a plain text format. In a further method step 106, by executing the determined structured form query against the knowledge graph, information is obtained from the knowledge graph that was queried by the input query. In an optional method step 100, natural language definitions and / or axioms for classes and properties from an ontology can be derived from the actual connections between classes and properties in the ontology, and by adding the generated definitions and / or axioms to the ontology, the class definitions and / or property definitions of the ontology can be enriched. The ontology thus enriched can be used in a subsequent method step 101. Note that steps 100 and step 101 may be executed only once for a given ontology, i.e., these steps are independent of the natural language input query at that point.

[0024] In certain embodiments, the ontology includes, as classes, concepts of machines, processes, materials, plants, production owners, and / or quality inspections, and, as properties, links between at least a subset of the aforementioned concepts. Thus, in an optional method step 107 related to such embodiments, the input query may include a request for information retrieval regarding a machine, a set of interconnected machines, and / or a manufacturing process executable by the machine or the set of machines, and based on the information obtained from the knowledge graph, a control signal can be determined in this method step  107. In a further optional method step 108, an actuator of a machine or a set of machines is controllable by the determined control signal, whereby one machine is replaced by another machine during the manufacturing process or the production process is interrupted.

[0025] Figure 2 shows a flowchart of an embodiment for retrieving information from Knowledge Graph 1 having a corresponding ontology 2. Optionally, ontology 2 can be enriched before context-based content reduction. Enrichment can be performed by generating natural language definitions (2a) and / or axioms (2a) for classes and properties from an ontology derived from the actual connections between classes and properties in the ontology, and enriching the class and / or property definitions of the ontology by adding the generated definitions and / or axioms. This enrichment can function as an optional step in extending the usability of contextual information. For example, an ontology lacking natural language definitions or descriptions of concepts or important axioms (e.g., rdfs:domain and rdfs:range) can first be enriched by automatically generating natural language definitions and axioms from the information available in the ontology. This can be done, for example, by automatically generating descriptions for classes and properties based on the ontology context. For example, a class can be described by its properties, and a property can be described by the domain (source class) and / or range (target class or data type) of its attribute. Furthermore, property axioms such as rdfs:domain and rdfs:range can often be automatically derived from the SHACL constraints or naming conventions used when creating the ontology. In addition to enriching the content with information provided by the ontology, the content can also be extended with knowledge gained from queries to large-scale language models, e.g., a first machine learning system or external sources (e.g., relevant domain documentation). The step of enriching the content further helps identify relevant ontological concepts for a given natural language question, as well as supplying potentially important context to the LLM to generate better structured queries (e.g., SPARQL queries) in order to retrieve information from the knowledge graph.In other words, context reduction, which reduces the context of the concepts of the relevant ontology, can also be further improved before calling the first machine learning system to determine the structured query for retrieving information from the knowledge graph. By embedding the machine learning system 10, vector embeddings for all classes and all properties (where properties may be relations or attributes) in ontology 2 can be determined. This allows labels and descriptions (either provided by the ontology or generated in a preceding ontology enrichment step) to be used when encoding entities of the ontology into the embedding space 4. The natural language query 3 is embedded in the same embedding space 4 by the embedded machine learning system 10. Using similarity search in embedding space 4, the most relevant entities / elements (i.e., classes and properties) of ontology 2 with respect to a given natural language query are identified. This identification involves comparing the embedding 300 of the input query 3 with the embeddings 201, 202, 203 of the classes and properties using a similarity metric. The similarity metric is, for example, cosine similarity. All classes and properties whose corresponding embeddings 201, 202, and 203 deviate from the input query embedding 300 by at most a predetermined value can be identified as related classes and related properties, respectively. In Figure 2, the embeddings of related classes and related properties are within a dashed-dotted circle around the input query embedding 300. Based on the similarity search results, the most relevant entities 201 and 203 of ontology 2 are extracted, and then context-based ontology 2A is constructed. For this purpose, the extracted related entities 201 and 203 can be considered as anchors for context-based ontology 2A (pruned relative to the "complete" ontology 2). In one embodiment, context-based ontology 2A can be determined by adding n-hop (e.g., 1-hop or 2-hop) related entities, related classes, and related properties of ontology 2 to the anchors.In other embodiments, the context-based ontology 2A can be determined by extracting modules from ontology 2, where modules include anchors, i.e., identified associated classes and associated properties. A first machine learning system 20 can be supplied with an input query 3 and the context-based ontology 2A, and the first machine learning system 20 can then determine a structured query 3a for retrieving information from the knowledge graph 1 based on the natural language input query 3 and the context-based ontology 2A. The determined structured query 3a is executable against the knowledge graph 1 for information retrieval in response to the natural language query. In this case, the information queried by the natural language input query 3 is retrieved from the knowledge graph 1 by executing the determined structured query 3a against the knowledge graph 1.

[0026] Figure 3 shows an exemplary embodiment of a system 70 for acquiring information from a knowledge graph, the system 70 comprising at least one processor 71 and at least one machine-readable storage medium 72, the machine-readable storage medium 72 including instructions, when executed by the processor 71, for causing the data processing system 70 to perform any method according to any aspect or embodiment of the present invention described herein.

Claims

1. A computer-implemented method (1000) for obtaining information from a knowledge graph, The above method involves the following steps, namely, - Step (101) of generating embedded classes and properties of the knowledge graph ontology using an embedded machine learning system, - The embedded machine learning system generates an embedding of a natural language input query (102), - A step (103) of identifying the associated classes and associated properties of the ontology for the input query by comparing the embedded input query with the embedded classes and properties, - A step (104) of determining a context-based ontology as a subset of the ontology that includes the identified related classes and related properties, - Step (105) of determining a structured query based on the natural language input query and the supplied context-based ontology using a first machine learning system, wherein the structured query is executable against the knowledge graph for information retrieval in response to the natural language query. - The steps (106) include: executing the determined structured query on the knowledge graph to obtain the information queried by the input query from the knowledge graph, A method (1000) including the following.

2. The above method further includes the following steps, namely, - A step (100) of generating natural language definitions (2a) and / or axioms (2a) for classes and properties from an ontology derived from the actual connections between classes and properties in the ontology, wherein the class definitions and / or property definitions of the ontology are enriched by adding the generated definitions and / or axioms. The method according to claim 1, including the method described in claim 1.

3. Before the first machine learning system determines the structured query, the added generated definitions and / or axioms are further supplied to the first machine learning system along with the context-based ontology. The method according to claim 2.

4. The aforementioned context-based ontology is The identified related class and / or related property, One of the following, namely, - Each corresponding n-hop neighborhood of an associated class or associated property comprises all classes and all properties within an ontology that have classes that are at least n distance from the identified associated class or associated property. - At least one module comprising the aforementioned related class and the aforementioned related property One of them, Determined as a subset of the ontology that includes, The method according to any one of claims 1 to 3.

5. The above method further, The first machine learning system performs the steps of encoding the context-based ontology into an understandable / processable text representation, The steps include supplying the text representation of the context-based ontology to the first machine learning system, The method according to any one of claims 1 to 4, including the method described in any one of claims 1 to 4.

6. The ontology includes, as classes, concepts of machines, processes, materials, plants, producers, and / or quality inspections, and as properties, links between at least subsets of such concepts. The method according to any one of claims 1 to 5.

7. The input query includes a request for information retrieval regarding a machine, a set of interconnected machines, and / or a manufacturing process that can be performed by the machine or set of machines, The above method further comprises the following steps, namely: - A step (107) of determining a control signal based on the information obtained from the knowledge graph, - A step (108) of controlling the actuators of the machine or set of machines by the determined control signal, thereby replacing one machine in the manufacturing process with another machine or interrupting the manufacturing process, The method according to claim 6, including the method described in claim 6.

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

9. A computer program that, when executed by a computer, includes instructions causing the computer to carry out the method described in any one of claims 1 to 7.

10. A computer-readable data carrier (72) storing the computer program described in claim 9.