Device, computer program, and computer implemented method for training knowledge graph embedded model

JP2023004969A5Pending Publication Date: 2025-05-13ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2022101646
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-06-25
Filing Date
2022-06-24
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

Existing knowledge graph embedding models struggle to effectively answer queries on incomplete knowledge graphs without a systematic approach.

Method used

A computer-implemented method for training a knowledge graph embedding model using ontology-enhanced training queries, including strategic sampling based on ontology axioms, generalizations, and specializations to minimize distances between query embeddings and their responses, while maximizing distances from non-responses.

Benefits of technology

Enhances the ability of knowledge graph embedding models to accurately answer conjunctive queries on incomplete knowledge graphs by leveraging ontology-based training strategies, reducing computational effort, and improving response accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To provide a device, a computer program and a computer implemented method, that are for training a knowledge graph embedded model (208) of a knowledge graph (200) to be enhanced by ontology (202).SOLUTION: The present method includes (2) training a knowledge graph embedded model (208), in order to reduce, particularly to minimize, a distance between response embedding in the knowledge graph embedded model (208) and first training query embedding in the knowledge graph embedded model (208), using the first training query and a prescribed response to the first training query, and in order to reduce, particularly to minimize, a distance between the response embedding and second training query embedding in the knowledge graph embedded model (208), wherein (1) the second training query is determined from the first training query dependent on ontology (202).SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] background The present invention relates to an apparatus, a computer program, and a computer-implemented method for training a knowledge graph embedding model. [Background technology]

[0002] Knowledge graph embedding models can be trained to provide responses to queries. It is desirable to provide a method that has a systematic approach to responding to queries on incomplete knowledge graphs. [Overview of the project] [Means for solving the problem]

[0003] Disclosure of the invention A computer-implemented method for training a knowledge graph embedding model for an ontology-enhanced knowledge graph comprises training the knowledge graph embedding model using a first training query and a given response to the first training query to reduce, in particular to minimize, the distance between the response embedding in the knowledge graph embedding model and the embedding of the first training query in the knowledge graph embedding model, and to reduce, in particular to minimize, the distance between the response embedding and the embedding of a second training query in the knowledge graph embedding model, the second training query being determined from the first training query in an ontology-dependent manner. The second training query is a specialization of a given query having a response in the knowledge graph. This makes it possible to train the knowledge graph embedding model to respond to a conjunctive query for an incomplete knowledge graph. The training depends not only on the original knowledge graph but also on the ontology associated with the knowledge graph. The embedding of the second training query takes into account the ontology axioms used to determine the second training query.

[0004] To sample the first training query, the method may include determining a set of consecutive queries of single terms that are consistent according to the ontology, a set of entities and a set of relationships of the knowledge graph, and selecting the first training query from the set of consecutive queries of single terms. Instead of randomly sampling the queries for training, a method for strategically sampling queries depending on the ontology is provided.

[0005] The method may include determining the first training query according to a predetermined query shape. Instead of randomly sampling the queries, queries according to a predetermined query shape are considered. Randomly selected examples may not include any queries related to each other based on the ontology. This is avoided by ontology-based sampling.

[0006] The method may include sampling the queries, particularly randomly, determining the generalization of the queries using the ontology, and determining the second training query from the generalization, particularly from the specialization of the generalization. The generalization describes a plurality of specializations and enables determining many different training queries similar to the first training query according to the ontology.

[0007] The method may include providing a generalization depth and determining the generalization of the queries up to the generalization depth, and / or providing a specialization depth and determining the specialization of the queries up to the specialization depth. This is substantially for limiting the computational effort.

[0008] The method may include using a knowledge graph embedding model to provide a response to a conjunctive query.

[0009] The method may include training a knowledge graph embedding model to increase, in particular to maximize, the distance between an embedding of a first training query and at least one embedding of a given entity that is not a response to the first training query, and / or to increase, in particular to maximize, the distance between an embedding of a second training query and at least one embedding of a given entity that is not a response to the second training query. In this way, as a result of training, the embedding of the first training query will be closer to the embedding of the response to the first training query than to the embedding of the non-response to the first training query.

[0010] An apparatus for training a knowledge graph embedding model of an ontology-enhanced knowledge graph is configured to perform each step of this method.

[0011] A computer program, when executed by a computer, includes computer-readable instructions that cause the computer to perform this method.

[0012] Further advantageous embodiments can be derived from the following description and drawings. [Brief explanation of the drawing]

[0013] [Figure 1] This is a diagram showing knowledge graph patterns. [Figure 2] This figure shows a method for training a knowledge graph embedding model for a knowledge graph. [Figure 3] This figure shows a device for training a knowledge graph embedding model for a knowledge graph. [Modes for carrying out the invention]

[0014] A knowledge graph (KG) includes a set of entities and a set of relations. A KG describes facts about a particular domain of interest by representing those facts using at least one entity from the set of entities, and this at least one entity from the set of entities is interconnected with at least one other entity from the set of entities through at least one relation from the set of relations.

[0015] In the KG representation, entities are represented by KG nodes, and the relationship between two entities is represented by KG edges between these nodes.

[0016] A fact is a triple consisting of a subject, a predicate, and an object. In KG, the subject is an entity, the object is an entity, and the predicate is a relation.

[0017] In KGE (Knowledge Graph Embedding), entities are represented by embeddings. In KGE, relationships are represented by embeddings. A triple of subject embeddings, predicate embeddings, and object embeddings represents a fact in KGE.

[0018] KGE can be used to predict the relationship between a first given entity and a second given entity. The relationship can be selected from a set of relationships in a score-dependent manner. The score can be determined using a score function that maps the embedding of the first entity in KGE, the embedding of the second entity in KGE, and the embedding of the relationship in KGE to the score.

[0019] An embedding may be considered a vector in a vector space. Determining a score using a scoring function may involve determining a vector sum. Determining a vector sum may involve adding a vector representing a relation to a vector representing a first entity. Determining a score may involve determining the distance from the vector sum to a vector representing a second entity.

[0020] An entity embedding may be a vector in a first vector space. A relation embedding may be a vector in a second vector space. Determining a score may involve determining a mapping between a first vector representing a first entity in the first vector space and a first vector in the second vector space. Determining a score may involve determining a mapping between a second vector representing a second entity in the first vector space and a second vector in the second vector space. Determining a score using a score function may involve determining a vector sum. Determining a vector sum may involve adding a vector representing a relation in the second vector space to the first vector. Determining a score may involve determining the distance from the vector sum to the second vector.

[0021] In one example, the distance is the Euclidean distance.

[0022] To predict the relationship with KG, an input containing two given entities can be mapped to an output containing a relationship. The relationship can be selected from a set of relationships. In one example, the selected relationship results in a higher score than at least one other relationship in the set of relationships. Preferably, the relationship that results in the highest-scoring relationship in the set of relationships is selected.

[0023] A neural network can be trained to represent KGE. The neural network can be trained using training data that includes embedded triples. The training data may include triples that represent true facts of KG. The training data may also include triples that represent triples that do not represent true facts of KG.

[0024] A neural network can be trained to map a first embedding of a first given entity and a second embedding of a second given entity from a set of entities to a score for each relation in a set of relations. The relation score represents the probability that the relation is between the first given entity and the second given entity.

[0025] A neural network can be trained to map a given entity embedding and a given relation embedding from a set of relations to a score for each entity in the set of entities. The entity score represents the probability that this entity has a given relation to a given entity.

[0026] KG is widely used for natural question answering, web search, and data analysis. KG stores information on millions of facts.

[0027] KG can be built automatically, semi-automatically, or at least partially manually, for example, by using crowdsourcing methods.

[0028] In training, KG or KGE, particularly neural networks, can be trained using training data to represent available knowledge. Training data may include positive triples representing true facts and negative triples representing false facts.

[0029] KG or KGE, particularly neural networks, can be trained using positive and negative triples.

[0030] This method distinguishes between correct triples, i.e., positive triples, and incorrect triples, i.e., negative triples.

[0031] KG represents an interconnected collection of fact-based information. KG can be encoded as a set of (subject;predicate;object) triples, for example (john;worksAt;bosch). In such triples, the subject or object is called an entity, and the predicate is called a relation. The set of KG triples can be represented as a directed graph, and the vertices and edges of this directed graph are labeled. KG triples are called facts. KG facts can be represented as unary or binary base predicates, such as man(john) and worksAt(john;bosch).

[0032] In this example, the signature of KG G

number

number

number

[0033] KGE concerns embedding KG entities and relations into a continuous vector space of user-specified dimension n. More specifically, a KGE model takes a set of KG triples as input and aims to map the entities and relations into an n-dimensional vector space such that several features reflecting the KG structure are preserved. These features are captured by the objective function of each KGE model. In this way, a set of numerical vectors is obtained from relational data.

[0034] An ontology is a conceptualization of a domain of interest, expressed as a set of axioms. An ontology is a scheme that a KG should follow, for example,

number

[0035] The first axiom states that a person who works for a company is an employee, while the second axiom shows that the relation managerAt is more specific than the relation worksAt.

[0036] The present invention is based on DL-lite by Artale, A., Calvanese, D., Kontchakov, R., Zakharyaschev, M.: The DL-lite family and relations. CoRR abs / 1401.3487 (2014). A The ontology in this context is based on the absence of existential constraints on the right side of the rules. An overview of the supported exemplary rule forms is as follows: (1) type(X,A) → type(X,B) (2) p(X,Y) → type(X,A) (3) p(X,Y) → type(Y,A) (4) p(X,Y)→s(X,Y) (5) p(X,Y)→s(Y,X) That is the case.

[0037] The conjunction query is q(X1,X2,···,Xk )←B or <X1,X2,···,X k >←This is expressed in the form of B, where B is a body defined in the rules, X1, X2, ..., X k The response variable is the variable that holds the response to the query. A unary CQ (monadic conjunctive query) is a CQ that has a single response variable.

[0038] With respect to KG and Ontology O, a specific response to CQ is the response obtained to KG enhanced by all the facts resulting from KG and Ontology O.

[0039] Information needs formulated in natural language by users are translated into such formal CQs using the methods disclosed in, for example, Yahya, M., Berberich, K., Elbassuoni, S., Ramanath, M., Tresp, V., Weikum, G.: Deep answers for naturally asked questions on the web of data. In: Proceedings of the 21st World Wide Web Conference, WWW 2012, Lyon, France, April 16-20, 2012 (Companion Volume). pp. 445-449 (2012). For example, in the case of KG, which stores information about people and their workplaces, the user might be interested in all the people working in several IT departments at Bosch. Formally, such a query would be: Q(X)←workAt(X,bosch);employedIn(X,Y);type(Y,it_department) It should be formulated as follows, and this is a unary CQ.

[0040] Conjunction queries can be naturally expressed as KG patterns. An example KG pattern corresponding to the above query is shown in Figure 1.

[0041] The following describes a method for answering CQs for an incomplete KG. This method depends not only on the original KG but also on the ontology O associated with the KG.

[0042] This method includes an ontology-based training strategy, extends the loss function to enable consideration of ontology axioms, and uses the extended loss function. Such a loss function is described, for example, in Ren, H., Hu, W., Leskovec, J.: Query2box: Reasoning over knowledge graphs in vector space using box embedding. In: ICLR. OpenReview.net (2000).

[0043] Entities are embedded as points in a d-dimensional vector space.

[0044] Queries are embedded as boxes. A box in this context refers to an axis-aligned hyper-rectangle in a d-dimensional vector space.

[0045] (ΣG;Q G )'s d-dimensional embedding is

Number

Number

Number

[0046] Ontology rules B1,...,B n →H is B1,...,B n It is possible to inject the KGE model if the KGE model can be configured to force the retention of H whenever H is retained.

[0047] This method aims to embed CQs according to the condition that the set of points inside the query box corresponds to the set of response entities for the CQ. Since the left-hand and right-hand sides of each ontology rule can be converted into queries, injecting an ontology into a KGE model is equivalent to guaranteeing the mutual inclusion of the boxes corresponding to each query.

[0048] This method will be further explained with reference to Figure 2.

[0049] The inputs to this method are KG200 and ontology 202. An optional query depth of 204 is provided, as described below.

[0050] The training is based on positive sample 206-1 and negative sample 206-2. During training, the KGE model 208 is trained.

[0051] This method includes step 1.

[0052] Step 1 involves determining the positive and negative samples.

[0053] Positive samples include training queries and their responses. Training queries are determined according to the training strategy described below. Negative samples are structured similarly to positive samples, and are specifically sampled randomly from KG.

[0054] In this example, multiple positive samples and multiple negative samples are determined.

[0055] Step 2 is then carried out.

[0056] Step 2 involves training the KGE model 208 using positive and negative samples. In this example, the KGE model 208 is trained using multiple positive and multiple negative samples.

[0057] The training objectives, and in particular the loss function for training the KGE model 208, are described below.

[0058] The KGE model calculated as a result of Step 2 can be used to respond to a CQ.

[0059] The training strategy used in Step 1 is the KG200 signature Σ G Q is a set of possible unary CQs that can be formed using predicates and constants within it. G This is taken into consideration. Preferably, all possible unary CQs are considered.

[0060] In other words, this method uses the set of entities and the set of relationships that appear in the knowledge graph 200 to form a set of possible unary sequential queries Q that can be formed by the ontology, i.e., according to the ontology. G This may include determining the training queries.

[0061] Below are three examples of determining training queries guided by an ontology.

[0062] Sampling based on a specific response: Sampling based on specific responses includes randomly sampling queries and using those queries in training along with specific responses to those queries rather than standard responses.

[0063] If the ontology contains axioms in a language that can efficiently perform query responses, then it is practically feasible to generate training queries along with specific responses to those training queries. An exemplary language for sampling based on specific responses is disclosed in Artale, A., Calvanese, D., Kontchakov, R., Zakharyaschev, M.: The dl-lite family and relations. CoRR abs / 1401.3487 (2014).

[0064] For example, the KG200 has the following facts: hasAlumnus(u1,pete); worksFor(pete,ibm); hasAlumnus(u1,john); managerAt(john,bosch) It stores the following, and ontology O follows these rules: managerAt(X,Y) → worksAt(X,Y) And, a given query, especially one randomly selected: q1(X)←hasAlumnus(u1,X)^worksFor(X,Y) This includes, and the specific response to that query is, {john,pete} Let's assume that this is the case.

[0065] In this example, this query and its specific response define a positive sample for training step 2.

[0066] Sampling based on query rewriting: Sampling based on query rewriting adds the specialization and generalization of a randomly sampled set of queries. Query specializations are obtained considering ontology O. Query generalizations are obtained considering ontology O.

[0067] The specialization of a given query q is represented as Spec(q) below. The specialization incorporates information that may be useful in constructing a response to query q. The generalization of a given query q is represented as Gen(q). The generalization incorporates additional relevant entities that may be plausible but missing responses.

[0068] Query generalization

number

number

number

[0069] For example, the following axioms: type(X,assist_prof)→type(X,professor);teachesAt(X,Y)→worksAt(X,Y) And the following query: q(X)←type(X,assist_prof)^worksFor(X,Y) Given that, the first rule R1 is a generalization of query q as q'(X)←type(X,professor)^worksFor(X,Y) This brings about the third rule R3 as a specialization of query q'. q''(X)←type(X,assist_prof)^teachesAt(X,Y) It brings about.

[0070] This method may involve randomly sampling multiple queries along with their generalizations and specializations, and a training sample can be constructed using multiple queries and their generalizations and specializations.

[0071] To reduce computational effort, this method uses a generalization depth k g and / or specialization depth k s This may include providing this generalization depth k g and / or specialization depth k s Training queries are generated up to this point. In this example, the query depth of 204 input to this method corresponds to the generalization depth k. g and / or specialization depth k s Define.

[0072] By adding generalization and specialization to random queries, it becomes possible to capture some parts of the ontology's background knowledge.

[0073] Ontology-based strategic training: Ontology-based strategic training aims to find relevant queries based on ontology O.

[0074] This method may involve generating training queries by relying on ontology O.

[0075] The set of target queries is formulated by a directed acyclic graph (N,E), where N is the set of nodes and E is the set of directed edges. Such a directed acyclic graph (DAG) captures the query shape. This shape is then signed Σ by a relation R and a set of constants. G It can be instantiated from. Signature Σ G This refers to a relationship R or entity that still needs to be determined.

number

[0076] In this example, the query shape S is a tuple (N, E, A, n), and therefore (N, E) is a DAG, n ∈ N is a discriminant node of S, and A ⊆ N represents the set of anchor nodes in S. Signature Σ G Given a given set of relations and constants, the labeling function f is given by Σ from N∪E. G This is a mapping to ∪V, where V is a set of variables, and therefore each anchor node is mapped to a constant, each non-anchor node is mapped to either a variable or a constant, and each edge is mapped to the signature Σ G It is mapped to the relational symbol within it.

[0077] Signature Σ G And given query shape S, the set of CQs is,

number

number

[0078] In this example, the labeling function f is the following set:

number

[0079] In this example, with respect to the query shape S and ontology O, for each pair of edges e=(n1,n2) and e'=(n2,n3), If f(e')∈follows(f(e)), or, If f(e)=type, f(n²)=A and A∈dom(f(e')), or If p ∈ inv(f(e')) and A ∈ range(p), or, If f(e')∈type, f(n3)=A and A∈range(f(e)), or If p∈inv(f(e)) and A∈dom(p), The labeling function f is valid for S with respect to O.

[0080] In this example, with respect to the query shape S and ontology O, for each pair of edges e=(n1,n2) and e'=(n3,n2), f(e')∈inter r If (f(e)) is true, or If f(e)=type, f(n²)=A and A∈dom(f(e')), or If p ∈ inv(f(e')) and A ∈ range(p), or, f(e)=f(e')=type, f(n1)=A1, f(n3)=A2, and,

number

[0081] In this example, with respect to the query shape S and ontology O, for each pair of edges e=(n1,n2) and e'=(n1,n3), f(e')∈inter d If (f(e)) is true, or If f(e)=type, f(n²)=A and A∈dom(f(e')), or If p ∈ inv(f(e')) and A ∈ range(p), or, f(e)=f(e')=type, f(n2)=A1, f(n3)=A2, and,

number

[0082] The * symbol above reflects the fact that generalization can be performed through multiple axioms, for example, type(X,A)→type(X,A1)→type(X,A'1)→type(X,A''1)···type(X,A).

[0083] In this way, semantically meaningful queries are created.

[0084] For example, query shape S=({n1n2;n3},{e1=(n1n2),e2=(n2,n3)g},n1) and, f1(e1) = worksAt, and, f2(e2) = type, and, f3(e3)=worksAt Given a labeling function f1 that maps to a, the labeling function f1(n3)=company is valid with respect to ontology O, while the labeling functions f2(e1)=worksAt and f2(e2)=teachesAt are not valid with respect to ontology O because the range of worksAt and the domain of teachesAt do not intersect.

[0085] A training set containing multiple training queries is constructed, for example, by computing a valid labeling function for each query shape and adding data patterns not captured by ontology O. In this context, data patterns not captured by ontology O may be considered as its generalizations or specializations.

[0086] In this example, all labeled queries of a given shape S that have a response to KG are a set Q of unary CQs. G Therefore, the generalization of each query is determined, for example, by the rules R1 to R6 described above, using ontology O. The multiple training queries obtained in this example include all queries that can be constructed given ontology O and a set of data patterns.

[0087] This method may include selecting a subset of valid entities, particularly randomly, for each anchor node. That is, for each entity selected as an anchor, the resulting query generates a specific response to KG200.

[0088] Ren, H., Leskovec, J.: Beta embedding for multi-hop logical reasoning in knowledge graphs. In: Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual (2020) discloses an exemplary training method for training a knowledge graph embedding model using an objective function.

[0089] The KGE Model 208 is based on this training method. In contrast to this method, the objective function for training also takes into account the ontology axioms.

[0090] The method in this example aims to learn query representations, including query generalization and / or specialization, depending on ontology O.

[0091] The method in this example aims to decrease, preferably minimize, the distance between query embeddings and responses, i.e., embeddings representing positive samples, while increasing, particularly maximizing, the distance between query embeddings and non-responses, i.e., embeddings representing negative samples.

[0092] In this example, the distance is box q The L1 distance between and v is the query box.

number

number

[0093] In this example, the function

number

[0094] This method is used when a particular training query q is a generalization of another query q' that depends on ontology O, and then boxes for the training query q. q However, this box is for the other training query q'. q’ The aim is to guarantee that it includes [the specified element].

[0095] More generally, if a is the response entity to a training query q, this method aims to minimize not only the distance between response a and training query q, but also the distance between response a and the specialization of training query q.

[0096] In one example, a given training set of queries is provided along with the responses to the queries, and similarly, multiple generalizations of the queries or all generalizations of the queries are also provided.

[0097] For example, the set of all generalizations of query q is Gen(q) = {q1,···,q n The} is determined based on the ontology O. Then, given a training query q and a specific response v ∈ q[G,O] to this training query q with respect to the ontology O, the objective function may be the loss function for v. Two examples of loss functions, namely the first and second loss functions, are presented below.

[0098] The first loss function is the negative log-likelihood:

number

number

[0099] The second loss function is:

number

number

[0100] For example, Ontology O follows the following rules O={teachesAt(X,Y)→worksAt(X,Y);type(X,assist_prof)→type(X,professor)} It may include.

[0101] Next, the set of generalizations of q, Gen(q)={q1,q2,q3}, includes q1 obtained from q by replacing the conjunction teachesAt(X,Y) with worksAt(X,Y), q2 which is a query q with type(X,professor) instead of type(X,assist_prof), and q3 which has the first, second, and third conjunctions q, q1, q2 and the same as in each case.

[0102] If the ontology O gives a specific response q to the query q for KG G, then the training objective is to embed the function p v p And, the embedded box for query q q The distance between them is also embedded v p The goal is to minimize the distance between the boxes in the embedding space that correspond to the generalized queries q1, q2, and q3 of query q.

[0103] The knowledge graph embedding model 208 is trained depending on one of the two objective functions defined above and positive and negative query samples generated using one of the methods described above.

[0104] The acquired knowledge graph embedding model 208 can be used to respond to conjunctive queries against an incomplete KG with an ontology.

[0105] The knowledge graph 200, ontology 202, and / or embedded model 208 may relate to machine states, properties of objects in digital images, or responses to questions.

[0106] Knowledge graph 200 can represent knowledge about mapping machine status messages to machine states. This method may include receiving status messages and outputting machine states depending on the status messages. The state can be determined by predicting, using knowledge graph embedding model 208, whether a triple exists that includes a subject entity representing the status and an object entity representing the machine state. This method may include outputting the machine state.

[0107] In the case of digital image processing, the knowledge graph 200 may be a description of objects recognized in object recognition for an image. Entities in the knowledge graph 200 can represent objects and / or their properties. This method may include receiving objects and outputting descriptions that depend on the objects.

[0108] In Street View, objects may be cars, people, houses, or other parts of infrastructure. In Street View, the knowledge graph 200, ontology 202, and / or embedding model 208 can describe objects and / or, in particular, the relationships between objects and other objects in digital images. This method may include receiving objects and outputting descriptions that depend on the objects.

[0109] This method can be used to respond to complex queries against incomplete KGs enhanced by ontology. It is applicable, for example, in the context of digital twins in the manufacturing domain.

[0110] Figure 3 schematically illustrates at least a portion of the apparatus 300 for training a knowledge graph embedding model 208 of a knowledge graph 200 enhanced by an ontology 202. The apparatus 300 is configured to perform each step in the method.

[0111] The device 300 includes at least one storage device and at least one processor.

[0112] In this example, storage 302 is configured to store KG200, KGE model 208, ontology 202, positive sample 206-1, and negative sample 206-2.

[0113] In this example, the processor 304 is configured to perform the method described above. The storage 302 can store computer-readable instructions that cause the processor 304 to perform this method when executed by the processor 304. The processor 304 can be configured to receive a query depth 204 from, for example, the storage 302 or an interface (not shown).

Claims

1. 1. A computer-implemented method for training a knowledge graph embedding model (208) of a knowledge graph (200) augmented with an ontology (202), comprising: The method comprises: The knowledge graph embedding model (208) is trained using a first training query and a predetermined response to the first training query. to reduce, in particular minimize, the distance between the embedding of the response in the knowledge graph embedding model (208) and the embedding of the first training query in the knowledge graph embedding model (208); and To reduce, in particular to minimize, the distance between the embedding of the answer and the embedding of the second training query in the knowledge graph embedding model (208), Training (2) Including, The second training query is determined from the first training query depending on the ontology. A method comprising:

2. determining (1) a set of possible unary continuous queries that are consistent according to the ontology and a set of entities and relationships of the knowledge graph (200); selecting the first training query from the set of unary consecutive queries; The method according to claim 1 , characterized in that

3. The method includes determining the first training query according to a predetermined query shape.

3. The method according to claim 2 .

4. The method comprises: Sampling queries, especially randomly; determining a generalization of the query using the ontology (202); determining the second training query from the generalization, in particular a specialization of the generalization; Includes 2. The method according to claim 1 .

5. providing a generalization depth and determining a generalization of the query up to the generalization depth; and / or Providing a specialization depth and determining a specialization of the query up to the specialization depth. The method according to claim 4, characterized in that

6. Using the knowledge graph embedding model (208) to provide answers to conjunction queries The method according to claim 1 , characterized in that

7. to increase, in particular to maximize, the distance between the embedding of the first training query and at least one embedding of a given entity that is not a response to the first training query; and / or to increase, in particular to maximize, the distance between the embedding of the second training query and at least one embedding of a given entity that is not a response to the second training query; Training the knowledge graph embedding model (208). The method according to claim 1 , characterized in that

8. An apparatus (300) for training a knowledge graph embedding model (208) of a knowledge graph (200) augmented by an ontology (202), comprising: The device (300) is adapted to carry out each step of the method according to any one of claims 1 to 7. An apparatus (300).

9. A computer program comprising: The computer program comprises computer readable instructions which, when executed by a computer, cause the computer to carry out the method according to any one of claims 1 to 7. A computer program comprising: