An alignment query method and system for spatiotemporal knowledge graphs

By determining the K nearest pairs of entities in the spatiotemporal knowledge graph and calculating the comprehensive distance, the problem of low efficiency of spatiotemporal knowledge graph alignment and fusion in the existing technology is solved, and a more efficient alignment query is achieved.

CN118427310BActive Publication Date: 2024-10-25HUNAN VISUAL ALBERT INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410881503.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-10-25
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

It is difficult for the existing technology to take into account the calculation of the closest spatio-temporal pairs when aligning spatio-temporal knowledge graphs, resulting in low efficiency of alignment and fusion.

Method used

By determining the K nearest pairs of entities between spatio-temporal knowledge graphs, the comprehensive distance of each entity pair is calculated, and the entity pair corresponding to the smallest comprehensive distance is selected as the query result, and alignment query is performed based on spatio-temporal attributes, names and relationship distances.

Benefits of technology

The efficiency of spatio-temporal knowledge graph alignment and fusion is improved. Alignment query is performed through comprehensive distance, which can take into account the calculation of spatio-temporal nearest pairs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118427310B_ABST
    Figure CN118427310B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of knowledge graph management, and discloses an alignment query method and system for spatiotemporal knowledge graphs. The method first determines the K closest pairs of entities between a first spatiotemporal knowledge graph and a second spatiotemporal knowledge graph; calculates the comprehensive distance of each entity pair in the K closest pairs of entities; and selects the entity pair corresponding to the smallest comprehensive distance as the final query result. In this way, alignment query is performed through comprehensive distance, and the calculation of the spatiotemporal closest pair can be taken into account when performing entity alignment, thereby improving the efficiency of spatiotemporal knowledge graph alignment fusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge graph management technology, and in particular to an alignment query method and system for spatiotemporal knowledge graphs. Background Art

[0002] The existing knowledge graph indexing method requires an alignment operation when fusing two spatiotemporal knowledge graphs. Specifically, the alignment operation is to find the closest entities in the two spatiotemporal knowledge graphs. Since each entity contains time, space, name, and relationship (associated with other entities), in addition to the traditional entity alignment algorithm, the calculation of the closest spatiotemporal pair is also required. However, in the existing technology, it is difficult to take into account the calculation of the closest spatiotemporal pair when aligning entities, which makes the efficiency of spatiotemporal knowledge graph alignment fusion low. Summary of the invention

[0003] The present invention provides an alignment query method and system for spatiotemporal knowledge graphs to solve the problem in the prior art that it is difficult to take into account the calculation of the closest spatiotemporal pairs when aligning entities, resulting in low efficiency in the alignment and fusion of spatiotemporal knowledge graphs.

[0004] In order to achieve the above object, the present invention is implemented by the following technical solutions:

[0005] In a first aspect, the present invention provides an alignment query method for spatiotemporal knowledge graphs, comprising:

[0006] S1: Determine the K closest pairs of entities between the first spatiotemporal knowledge graph and the second spatiotemporal knowledge graph;

[0007] S2: Calculate the comprehensive distance of each entity pair in the K closest pairs of entities;

[0008] S3: Select the entity pair corresponding to the smallest comprehensive distance as the final query result.

[0009] In a second aspect, the present application provides an alignment query system for a spatiotemporal knowledge graph, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.

[0010] Beneficial effects:

[0011] The alignment query method for spatiotemporal knowledge graphs provided by the present invention first determines the K closest pairs of entities between the first spatiotemporal knowledge graph and the second spatiotemporal knowledge graph; calculates the comprehensive distance of each entity pair in the K closest pairs of entities; and selects the entity pair corresponding to the smallest comprehensive distance as the final query result. In this way, by performing alignment query through comprehensive distance, the calculation of the spatiotemporal closest pair can be taken into account when performing entity alignment, thereby improving the efficiency of spatiotemporal knowledge graph alignment fusion.

[0012] In a further technical solution, a model formula for the nearest pair metric distance of the spatiotemporal knowledge graph is designed, which provides a mathematical tool for calculating the nearest distance. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a flowchart of an alignment query method for spatiotemporal knowledge graphs according to a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0014] The technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0015] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.

[0016] See also Figure 1 , the present application provides an alignment query method for spatiotemporal knowledge graphs, including:

[0017] S1: Determine the K closest pairs of entities between the first spatiotemporal knowledge graph and the second spatiotemporal knowledge graph;

[0018] S2: Calculate the comprehensive distance of each entity pair in the K closest pairs of entities;

[0019] S3: Select the entity pair corresponding to the smallest comprehensive distance as the final query result.

[0020] In this implementation, the first spatiotemporal knowledge graph and the second spatiotemporal knowledge graph both refer to knowledge graphs that satisfy the following conditions:

[0021] (1) It has entities, relationships, and spatiotemporal attributes. Let the spatiotemporal knowledge graph be STKG, the first knowledge graph be STKG1, and the second knowledge graph be STKG2;

[0022] (2) It is composed of multiple entities, and there are relationships between entities;

[0023] (3) The entity has a name attribute, as well as time t and space (x, y) attributes;

[0024] (4) The relation has a kind attribute cat, as well as time t and space (x, y) attributes.

[0025] Furthermore, in this implementation, the spatiotemporal knowledge graph recently describes the query capability as follows:

[0026] Given two spatiotemporal knowledge graphs, STKG1 and STKG2;

[0027] Query one entity each in STKG1 and STKG2. Suppose entity e is in STKG1 and entity g is in STKG2, so that the combined distance between e and g is the shortest among all entity pairs.

[0028] The comprehensive integrated distance considers the spatiotemporal attributes of two entities, their names, and other entities related by relations.

[0029] Optionally, the S1 includes:

[0030] S11: Establish a first R-tree for the spatial attribute values ​​of all entities in the first spatiotemporal knowledge graph to obtain R1, and establish a second R-tree for the spatial attribute values ​​of all entities in the second spatiotemporal knowledge graph to obtain R2;

[0031] S12: Starting from the root nodes of R1 and R2 at the same time, search layer by layer in the order from internal nodes to leaf nodes to obtain the K closest pairs of entities.

[0032] Further, the S12 includes:

[0033] S121: Starting from the root nodes of R1 and R2 at the same time, the distances of the minimum enclosing rectangle pairs of R1 and R2 are compared layer by layer in the order from the internal node to the leaf node, the minimum enclosing rectangle pair corresponding to the minimum distance is selected, and the search is continued downward along the minimum enclosing rectangle pair until both R1 and R2 enter the leaf node;

[0034] S122: Select a pair of entities with the closest distance from the leaf nodes of R1 and R2 as the closest entity pair;

[0035] S123: Eliminate the nearest entity pairs, and go to S121 to repeat the search step until K nearest entity pairs are obtained.

[0036] In this implementation, the distances of the minimum enclosing rectangle pairs of R1 and R2 are compared layer by layer in the order from the internal node to the leaf node. In one example, if at the L layer, R1 has N minimum enclosing rectangle pairs MBR, and R2 has M minimum enclosing rectangle pairs MBR, then there are N*M MBR pairs in total. For these N*M MBR pairs, the minimum distance MINMINDIST of each pair is obtained, and the MBR pair with the minimum value MINMINDIST is selected, and then the search is carried out downward along this pair of MBR until the leaf node is reached, and then the process goes to S122, otherwise the process goes to S121. In this way, a large number of branches can be pruned to speed up the search.

[0037] Optionally, the comprehensive distance includes time distance, space distance, name semantic distance and relationship distance, and the calculation method of the comprehensive distance satisfies the following relationship:

[0038] comd=α*dt+β*ds+γ*ss+δ*rs;

[0039] Where comd represents the comprehensive distance, dt represents the time distance, ds represents the spatial distance, ss represents the name semantic distance, rs represents the relationship distance, α, β, γ, δ are all constants, and α+β+γ+δ=1.

[0040] In this embodiment, a model formula for the nearest pair metric distance of the spatiotemporal knowledge graph is designed, which provides a mathematical tool for calculating the nearest distance.

[0041] The time distance satisfies the following relationship:

[0042] dt=|et-gt|;

[0043] In the formula, e represents the first entity, g represents the second entity, wherein the first entity is an entity in the first spatiotemporal knowledge graph, and the second entity is an entity in the second spatiotemporal knowledge graph.

[0044] The spatial distance is the Euclidean distance between a first entity and a second entity, wherein the first entity is an entity in a first spatiotemporal knowledge graph, and the second entity is an entity in a second spatiotemporal knowledge graph.

[0045] The name semantic distance is determined as follows:

[0046] All entity names in the first spatiotemporal knowledge graph and the second spatiotemporal knowledge graph are trained using the natural language processing model BERT to map each name into a vector, and the distance between the vectors corresponding to the first entity and the second entity is recorded as the name semantic distance, where the first entity is an entity in the first spatiotemporal knowledge graph and the second entity is an entity in the second spatiotemporal knowledge graph. BERT is a natural language processing model (Bidirectional Encoder Representation from Transformers).

[0047] The relationship distance is determined as follows:

[0048] Determine a first hop subgraph e.sub centered on the first entity and a second hop subgraph g.sub centered on the second entity;

[0049] The graph edit distance between the first hop subgraph e.sub and the second hop subgraph g.sub is calculated as the relationship distance, wherein the first entity is an entity in the first spatiotemporal knowledge graph, and the second entity is an entity in the second spatiotemporal knowledge graph.

[0050] The present application also provides an alignment query system for spatiotemporal knowledge graphs, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program. The alignment query system for spatiotemporal knowledge graphs can implement various embodiments of the alignment query method for spatiotemporal knowledge graphs described above, and can achieve the same beneficial effects, which will not be described in detail here.

[0051] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. An alignment query method for spatiotemporal knowledge graphs, characterized in that: include: S1: Determine the K closest pairs of entities between the first spatiotemporal knowledge graph and the second spatiotemporal knowledge graph; S2: Calculate the comprehensive distance of each entity pair in the K closest pairs of entities; S3: Select the entity pair corresponding to the smallest comprehensive distance as the final query result; The comprehensive distance includes time distance, space distance, name semantic distance and relationship distance, and the calculation method of the comprehensive distance satisfies the following relationship: comd=α*dt+β*ds+γ*ss+δ*rs; In the formula, comd represents comprehensive distance, dt represents time distance, ds represents space distance, ss represents name semantic distance, rs represents relation distance, α, β, γ, δ are all constants, and α+β+γ+δ=1; The S1 includes: S11: Establish a first R-tree for the spatial attribute values ​​of all entities in the first spatiotemporal knowledge graph to obtain R1, and establish a second R-tree for the spatial attribute values ​​of all entities in the second spatiotemporal knowledge graph to obtain R2; S12: Starting from the root nodes of R1 and R2 at the same time, search layer by layer in the order from internal nodes to leaf nodes to obtain K closest entities; The S12 includes: S121: Starting from the root nodes of R1 and R2 at the same time, the distances of the minimum enclosing rectangle pairs of R1 and R2 are compared layer by layer in the order from the internal node to the leaf node, the minimum enclosing rectangle pair corresponding to the minimum distance is selected, and the search is continued downward along the minimum enclosing rectangle pair until both R1 and R2 enter the leaf node; S122: Select a pair of entities with the closest distance from the leaf nodes of R1 and R2 as the closest entity pair; S123: Eliminate the nearest entity pairs, and go to S121 to repeat the search step until K nearest entity pairs are obtained.

2. The alignment query method for spatiotemporal knowledge graph according to claim 1 is characterized in that: The time distance satisfies the following relationship: dt=|et-gt|; In the formula, e represents the first entity, g represents the second entity, wherein the first entity is an entity in the first spatiotemporal knowledge graph, and the second entity is an entity in the second spatiotemporal knowledge graph.

3. The alignment query method for spatiotemporal knowledge graph according to claim 1, characterized in that: The spatial distance is the Euclidean distance between a first entity and a second entity, wherein the first entity is an entity in a first spatiotemporal knowledge graph, and the second entity is an entity in a second spatiotemporal knowledge graph.

4. The alignment query method for spatiotemporal knowledge graph according to claim 1, characterized in that: The name semantic distance is determined as follows: All entity names in the first spatiotemporal knowledge graph and the second spatiotemporal knowledge graph are trained using the natural language processing model BERT to map each name into a vector, and the distance between the corresponding vectors of the first entity and the second entity is recorded as the name semantic distance, where the first entity is an entity in the first spatiotemporal knowledge graph, and the second entity is an entity in the second spatiotemporal knowledge graph.

5. The alignment query method for spatiotemporal knowledge graph according to claim 1, characterized in that: The relationship distance is determined as follows: Determine a first hop subgraph e.sub centered on the first entity and a second hop subgraph g.sub centered on the second entity; The graph edit distance between the first hop subgraph e.sub and the second hop subgraph g.sub is calculated as the relationship distance, wherein the first entity is an entity in the first spatiotemporal knowledge graph, and the second entity is an entity in the second spatiotemporal knowledge graph.

6. An alignment query system for spatiotemporal knowledge graphs, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.