A method and system for constructing and querying a fine-grained geospatial knowledge graph
By constructing FineGeoKG and applying spatial interconnection algorithms, the problem of missing fine-grained semantics in geospatial knowledge graphs was solved, enabling efficient spatial relationship querying and recognition, and improving query efficiency in the field of geoinformatics.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2026-04-14
AI Technical Summary
Existing knowledge graphs lack fine-grained semantic information in geospatial applications, failing to effectively describe the spatial consistency between ground objects, resulting in low query efficiency.
We construct a fine-grained geospatial knowledge graph, FineGeoKG, which describes the spatial relationships between geometric objects using the DE-9IM model, defines strong geospatial relationships (SGR), and employs spatial interconnection algorithms and indexing techniques to distinguish between exact and approximate queries. We also optimize queries using GNN and R-Tree algorithms.
It improves the query efficiency and accuracy of geospatial knowledge graphs, enabling rapid identification and matching of spatial relationships between geographic objects and supporting efficient spatial relationship queries.
Smart Images

Figure CN116860994B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geographic information technology, and in particular to a method and system for constructing and querying fine-grained geospatial knowledge graphs. Background Technology
[0002] Knowledge graphs have developed rapidly in recent years and are becoming a new force leading technological innovation. Researchers generally believe that knowledge graphs are a breakthrough in realizing computer cognitive capabilities. Knowledge graphs organically integrate knowledge entities and relationships in a way that is easily understood by humans—knowledge triples—and leverage computers' strength in processing graph structures, becoming a bridge for both humans and computers to jointly understand and describe knowledge. Knowledge graph technology has shown tremendous advantages and potential in knowledge storage, retrieval, visualization, and reasoning; however, research and application of geospatial knowledge graphs in China are still very limited.
[0003] Existing knowledge graph technologies do not adequately emphasize geospatial semantics, which limits their application in geographic information systems, mobile recommendation systems, and location-based services (LBS). In recent years, researchers have done extensive work on the acquisition and extraction of spatiotemporal knowledge. To construct geospatial knowledge graphs, researchers extract triples from OpenStreetMap, establish interfaces between the WorldKG ontology and the DBpedia ontology, and then integrate their spatiotemporal knowledge. Based on the GeoSPARQL ontology, some researchers have extended the concepts of geographic entities and attributes, constructing spatiotemporal knowledge graphs that include geographically partitioned entities and their spatial relationships. A common thread in these techniques is the addition of coarse-grained spatiotemporal information (e.g., geographic coordinates) to general knowledge graphs. These knowledge graphs lack fine-grained information and cannot describe the spatial consistency between ground objects. Some researchers have investigated how to use graph structures to describe relationships between ground targets in remote sensing images, but they focus on specific scenarios (e.g., airports) and small targets (e.g., aprons, runways). Pa-padakis et al. used an intersection matrix to determine whether a basic spatial topological relationship exists between two geographic entities based on their intersection relationship. From the perspective of query processing technology for geospatial knowledge graphs, researchers have proposed a variety of indexing techniques and query algorithms, such as SS-Tree, Hilbert-Encoding, and RisoTree. Summary of the Invention
[0004] This invention provides a method and system for constructing and querying fine-grained geospatial knowledge graphs, solving the problem of fine-grained geospatial semantics in existing knowledge graphs.
[0005] To achieve the aforementioned objectives, the present invention provides the following technical solution: a method for constructing and querying a fine-grained geospatial knowledge graph, characterized by the following steps:
[0006] S1. Obtain the dataset and express and calculate the spatial relationships using the DE-9IM model. Describe the spatial relationships between each pair of geometric objects in the dataset using the DE-9IM model.
[0007] S2. Define the fine-grained geospatial knowledge graph FineGeoKG and the strong geospatial relationship SGR; based on the defined fine-grained geospatial knowledge graph FineGeoKG and the strong geospatial relationship SGR, extract the target information from the dataset and obtain the knowledge graph ontology structure.
[0008] S3. Using spatial interconnection algorithms, multiple strong geospatial relationships (SGRs) are obtained from the dataset to construct a fine-grained geospatial knowledge graph, FineGeoKG.
[0009] S4. Define SGR queries, dividing them into exact queries and approximate queries; perform exact queries on the FineGeoKG using an exact query algorithm; and perform approximate queries on the FineGeoKG using an approximate query algorithm.
[0010] Preferably, in step S2, FineGeoKG includes a quintuple (E, R, L, P, V), where set E represents fine-grained geographic object entities, set R represents the SGR between two entities, set L represents the category of entities and relationships, set P represents attributes, and set V represents the value corresponding to P; in FineGeoKG, an entity can have multiple labels, and a relationship should have at least one sgr label to represent the spatial relationship;
[0011] A strong geospatial relationship (SGR) is defined as follows: if two geographic entities ox and oy are close to each other in two-dimensional Euclidean space, then they have a strong geospatial relationship (SGR).
[0012] Preferably, in step S2, the target information in the dataset is extracted, including:
[0013] Identify SGRs while building the mapping table, rather than building the mapping table in advance;
[0014] The objects are inspected in the order of "point → line → surface"; the objects are the data in the dataset. 。
[0015] Preferably, in step S4, the SGR query includes: given a FineGeoKG and a query graph P, an SGR query refers to finding all object groups [O1, O2, ..., Ok] in the knowledge graph that can satisfy the query graph P.
[0016] Preferably, step S4 includes:
[0017] Both exact and approximate queries include two query methods: structured queries and semantic queries;
[0018] Among them, the structure query is a structure query algorithm based on GNN; the semantic query is a semantic query algorithm based on R-Tree.
[0019] Preferably, the structure query includes:
[0020] Given a FineGeoKG and a query graph P, an SGR structure query is to find all object groups [O1, O2, ..., Ok] that satisfy the query graph P from the knowledge graph;
[0021] There are no restrictions on the edges in the query graph P, and the vertex types are limited to points, lines, and faces.
[0022] Preferably, the semantic query includes:
[0023] Given a FineGeoKG and a query graph P, an SGR structure query is to find all object groups [O1, O2, ..., Ok] that satisfy the query graph P from the knowledge graph;
[0024] Among them, at least one edge in the query graph P has a quantitative constraint on strong geospatial relationships, and the vertex types are not limited to points, lines, and polygons.
[0025] Preferably, in step S4, the precise query includes:
[0026] Based on the data structure characteristics of FineGeoKG, an SGR edge index is established to quickly find different types of SGR edges, while defining a normalized edge search order.
[0027] Preferably, in step S4, the SGR edge index has six types of SGR relationships. The SGR edge index includes six sub-indexes, which are: face-face sub-index, face-line sub-index, face-point sub-index, line-line sub-index, line-point index, and point-point index. Each sub-index organizes the SGR edges according to the corresponding vertex type.
[0028] A system for constructing and querying fine-grained geospatial knowledge graphs, the system being used in the aforementioned method for constructing and querying fine-grained geospatial knowledge graphs, the system comprising:
[0029] The spatial relationship module is used to acquire the dataset and express and calculate the spatial relationships using the DE-9IM model. It describes the spatial relationship between each pair of geometric objects in the dataset using the DE-9IM model.
[0030] The ontology structure construction module is used to define the fine-grained geospatial knowledge graph FineGeoKG and the strong geospatial relationship SGR; based on the defined fine-grained geospatial knowledge graph FineGeoKG and the strong geospatial relationship SGR, the target information in the dataset is extracted to obtain the ontology structure of the knowledge graph.
[0031] The knowledge graph construction module is used to extract multiple strong geospatial relationships (SGRs) from the dataset using spatial interconnection algorithms, and construct a fine-grained geospatial knowledge graph, FineGeoKG.
[0032] The SGR query module is used to define SGR queries, dividing them into exact queries and approximate queries. It performs exact queries on the FineGeoKG geospatial knowledge graph using an exact query algorithm, and approximate queries on the FineGeoKG geospatial knowledge graph using an approximate query algorithm.
[0033] On the one hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the above-described method for constructing and querying a fine-grained geospatial knowledge graph.
[0034] On the one hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-described method for constructing and querying a fine-grained geospatial knowledge graph.
[0035] The above technical solution has at least the following advantages compared with the existing technology:
[0036] The above-mentioned solution effectively solves the problem of spatial relationship representation and query in the field of geographic information science by utilizing computer technology. The fine-grained geospatial knowledge graph (FineGeoKG) and related algorithms proposed in this invention adopt newer technical means and methods, which improve the efficiency of solving spatial relationship-related problems in geospatial areas and provide a solution that can be used as a reference for similar problems. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1This is a schematic diagram of the construction and query method of fine-grained geospatial knowledge graph provided in the embodiments of the present invention;
[0039] Figure 2 These are six types of SGR relationship diagrams between geographic objects provided in this embodiment of the invention;
[0040] Figure 3 This is the ontology graph of the geospatial knowledge graph provided in the embodiments of the present invention;
[0041] Figure 4 This is a flowchart of the FGI algorithm provided in an embodiment of the present invention;
[0042] Figure 5 This is a cell diagram provided by an embodiment of the present invention for calculating the number of cells traversed by line segment S;
[0043] Figure 6 This is the FineGeoKG map based on Shanghai geographic data in Neo4J provided in this embodiment of the invention;
[0044] Figure 7 This is an index structure diagram of the SGR edge index provided in the embodiments of the present invention;
[0045] Figure 8 This is a graph of the SGR edge indexing algorithm provided in an embodiment of the present invention;
[0046] Figure 9 This is a flowchart of the IBJ algorithm provided in an embodiment of the present invention;
[0047] Figure 10 This is a G-Match structure diagram provided in an embodiment of the present invention;
[0048] Figure 11 This is a flowchart of the G-Match query process provided in an embodiment of the present invention;
[0049] Figure 12 This is a flowchart of the R-Match query process provided in an embodiment of the present invention;
[0050] Figure 13 This is a block diagram of the fine-grained geospatial knowledge graph construction and query system provided in this embodiment of the invention;
[0051] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0053] This invention addresses the problem of missing fine-grained geospatial semantics in existing knowledge graphs by defining and constructing a fine-grained geospatial knowledge graph (FineGeoKG). It also proposes precise and approximate algorithms for spatial pattern queries on FineGeoKG, providing a method and system for constructing and querying fine-grained geospatial knowledge graphs. The aim is to improve the efficiency of spatial relationship-related problems in geospatial environments and to offer a reference solution for similar problems.
[0054] like Figure 1 As shown, this embodiment of the invention provides a method for constructing and querying a fine-grained geospatial knowledge graph, which can be implemented by an electronic device. Figure 1 The flowchart shown illustrates the construction and query method for a fine-grained geospatial knowledge graph. The processing flow of this method may include the following steps:
[0055] S101. Obtain the dataset and express and calculate the spatial relationship using the DE-9IM model. Describe the spatial relationship between each pair of geometric objects in the dataset using the DE-9IM model.
[0056] In one feasible implementation, the spatial relationship between two geometric objects can be quickly determined using the DE-9IM matrix.
[0057] In one feasible implementation, spatial indexing technology is used to effectively store and retrieve large amounts of spatial data, accelerating spatial query operations and making the query speed faster and the response time shorter.
[0058] S102. Define the Fine-Grained Geospatial Knowledge Graph (FineGeoKG) and the Strong Geospatial Relationships (SGR); based on the defined FineGeoKG and SGR, extract the target information from the dataset to obtain the ontology structure of the knowledge graph.
[0059] In one feasible implementation, in S102, FineGeoKG includes a quintuple (E, R, L, P, V), where set E represents a fine-grained geographic object entity, set R represents the SGR between two entities, set L represents the category of the entity and the relationship, set P represents the attribute, and set V represents the value corresponding to P. In FineGeoKG, an entity can have multiple labels, and a relationship should have at least one "sgr" label to represent the spatial relationship.
[0060] In one feasible implementation, the dataset contains point-type objects, line-type objects, and polygon-type objects. Define the FineGeoKG ontology. FineGeoKG primarily contains three categories of geographic objects: points, lines, and polygons. Different types of geographic objects have different attributes, as shown in the dashed box in the figure. Furthermore, these three object categories are further divided into specific real-world geographic objects. For example, polygon objects are subdivided into specific lakes, sports fields, and residential areas, while point objects are subdivided into specific rivers and railways. There are six types of relationships between objects, as follows: Figure 2 The attributes listed, besides line relationships, each contain two types of attributes: distance relationships and location relationships. Based on this, the ontology of the geospatial knowledge graph is defined as follows: Figure 3 As shown.
[0061] A strong geospatial relationship (SGR) is defined as follows: if two geographic entities, ox and oy, are close to each other in two-dimensional Euclidean space, then they have a strong geospatial relationship (SGR). Furthermore, it varies depending on the type of geographic object (polygon, polyline, point). Figure 2 The six different SGRs shown are shown.
[0062] In one feasible implementation, SGR (Spatial Geospatial Relationship) extraction is performed. To more quickly identify SGRs from the dataset, this invention proposes Algorithm 1: FGI (Fast Geospatial Interlinking), which improves upon Grid-Index-based algorithms in three aspects. First, this paper identifies SGRs while constructing the mapping table, rather than constructing the mapping table beforehand. Second, objects are examined in the order of "point → line → surface". Third, to find covering cells as accurately as possible, a method is proposed that can accurately find cells traversed by line segments of geometric shapes. The algorithm flow of FGI is as follows: Figure 4 Algorithm 1 shown; the method for accurately finding line segments traversed by geometric shapes is as follows: Figure 5 Algorithm 2 is shown.
[0063] S103. Using spatial interconnection algorithms, obtain multiple strong geospatial relationships (SGRs) from the dataset and construct a fine-grained geospatial knowledge graph (FineGeoKG).
[0064] In one feasible implementation, after extracting SGRs from the dataset using the method in step five, the map is constructed according to the ontology defined in S102 and stored in Neo4J. A FineGeoKG map based on Shanghai geographic data constructed using this method is shown below. Figure 6 .
[0065] S104. Define SGR queries, dividing them into exact queries and approximate queries; perform exact queries on the FineGeoKG using an exact query algorithm; and perform approximate queries on the FineGeoKG using an approximate query algorithm.
[0066] In one feasible implementation, in S104, the SGR query includes: given a FineGeoKG and a query graph P, an SGR query refers to finding all object groups [O1, O2, ..., Ok] in the knowledge graph that can satisfy the query graph P.
[0067] In one feasible implementation, S104 further includes:
[0068] Both exact and approximate queries include two query methods: structured queries and semantic queries;
[0069] Among them, the structure query is a structure query algorithm based on GNN; the semantic query is a semantic query algorithm based on R-Tree.
[0070] In one feasible implementation, the structure query includes:
[0071] Given a FineGeoKG and a query graph P, an SGR structure query is to find all object groups [O1, O2, ..., Ok] that satisfy the query graph P from the knowledge graph;
[0072] In this query, the edges in graph P have no restrictions, and the vertex types are limited to points, lines, and polygons. The restrictions include quantitative limitations on strong geospatial relationships, such as the length range of the boundary between two polygons with a strong geospatial relationship, and the directional range between the two polygons.
[0073] In one feasible implementation, the semantic query includes:
[0074] Given a FineGeoKG and a query graph P, an SGR structure query is to find all object groups [O1, O2, ..., Ok] that satisfy the query graph P from the knowledge graph;
[0075] Among them, at least one edge in the query graph P has a conditional constraint, and the vertex types are not limited to points, lines, and faces.
[0076] In one feasible implementation, precise querying includes:
[0077] Based on the data structure characteristics of FineGeoKG, an SGR edge index is established to quickly find different types of SGR edges, while defining a normalized edge search order.
[0078] In one feasible implementation, the SGR edge index has six types of SGR relationships, including six sub-indexes: face-face sub-index, face-line sub-index, face-point sub-index, line-line sub-index, line-point sub-index, and point-point sub-index. Each sub-index organizes SGR edges according to the corresponding vertex type. The corresponding vertex types are: face-face sub-index for indexing edges where both vertices are face type objects; face-line sub-index for indexing edges where the vertices are face type objects and the line type objects; face-point sub-index for indexing edges where the vertices are face type objects and the point type objects; line-line sub-index for indexing edges where all vertices are line type objects; line-point sub-index for indexing edges where the vertices are line type objects and the point type objects; and point-point sub-index for indexing edges where all vertices are point type objects.
[0079] In one feasible implementation, an accurate query algorithm is designed. This invention proposes the IBJ algorithm (improved Binary Join), which effectively improves upon Binary Join. Based on the data structure characteristics of FineGeoKG, an SGR edge index is established to quickly find different types of SGR edges. At the same time, a normalized edge search order is defined to reduce redundant Join operations, thereby reducing the time complexity of the algorithm.
[0080] The index structure of the SGR edge index is as follows: Figure 7 As shown. The algorithm for constructing the SGR edge index is as follows. Figure 8 Algorithm 3.
[0081] To improve the speed of Binary Join, this invention proposes an improved algorithm based on the aforementioned index. With the support of the index, this algorithm can select edges faster and reduce the number of natural joins, while performing edge matching operations according to edge priority. When processing SGR queries, if an edge in the query graph has not yet been queried, its priority is higher. The vertex set VS records the vertices of the edges that have been processed. For an edge x, if neither of its two vertices is in VS, its priority is 2; if only one vertex is not in VS, its priority is 1; and if both vertices are in VS, its priority is 0. Initially, VS is empty, and each edge in the query graph has a highest priority of 2. Any edge can be selected as the first edge for matching. After each edge matching operation, VS is updated, and the next edge with the highest priority is selected for matching. The algorithm flow is as follows: Figure 9 Algorithm 4.
[0082] In one feasible implementation, the present invention proposes as follows: Figure 10 The GR-Match (improved Binary Join) algorithm shown is much faster than the exact match algorithm. GR-Match mainly consists of two parts: G-Match and R-Match.
[0083] G-Match solves structured queries in approximate queries. Its core principle is to decompose the target graph (GT) and the query graph (GQ) into many small overlapping graphs, and then embed these graphs using a graph neural network (GNN). This allows for rapid determination of whether one graph is a subgraph of another without semantic information, thus solving structured queries. The G-Match method consists of two phases: an embedding phase and a query phase. In the embedding phase, the target graph GT is decomposed into multiple subgraphs: for each node u∈GT, a k-hop neighborhood subgraph around u is extracted, and u is embedded using a GNN to integrate u's neighbor information. In the query phase, the same operation is performed on each node q in the query graph GQ: q is embedded using a GNN to integrate its neighbor information. Then, all embeddings of nodes q and u are compared to determine whether GQ is a subgraph of GT.
[0084] R-Match solves semantic queries in approximate queries. The core idea of R-Match is to represent query conditions as rectangles in a two-dimensional space, and then use an R*-Tree to index these rectangles. This allows for the abstract representation of semantic information in the query graph. Meanwhile, the results of the previous structural query stage are graphs that are isomorphic to the query graph but do not contain semantic information. These graphs will participate in the semantic query as a candidate set. The semantic information of each graph in the candidate set is matched with the query range of the query graph. The candidate graphs that pass the matching are the result graphs that satisfy the query conditions.
[0085] G-Match uses the following loss function for training:
[0086]
[0087]
[0088] After training, G-Match can represent whether two graphs are subgraphs in the embedding space, thus enabling fast structure lookup:
[0089]
[0090] Where D is the embedding dimension.
[0091] Therefore, the query process of G-Match is as follows: Figure 11 Algorithm 5. Where f(zq,zu): Given the embedding zu (u∈GT) of a node u in a target graph and a center node q (q∈GQ), the subgraph prediction function f(zq,zu) can determine whether the k-hop neighborhood subgraph Gu of u is isomorphic to the k-hop neighborhood subgraph Gq of q. This prediction function makes its decision based solely on the embeddings zu and zq of u and q.
[0092] In addition, R-Match mainly solves the SGR semantic query problem through the following steps:
[0093] (1) The query condition of the abstract query graph is a two-dimensional rectangle set R;
[0094] (2) Index R using R*-Tree;
[0095] (3) Traverse the candidate set and abstract the SGR attribute of the candidate graph as a two-dimensional point set P;
[0096] (4) Match R and P in R*-Tree, and then use semantic query to complete the matching.
[0097] The matching algorithm of R-Match is as follows: Figure 12 Algorithm 6.
[0098] In this embodiment of the invention, (1) FineGeoKG is defined and a graph construction algorithm is proposed. This paper defines six strong geospatial relationships (SGRs) to describe the spatial adjacency relationships and features of objects. Based on this, the entities and relationships of FineGeoKG are defined. The FGI algorithm is proposed to quickly find the SGR relationships between objects so as to quickly complete the construction of the knowledge graph.
[0099] (2) The exact subgraph query problem on FineGeoKG is defined and a query algorithm is proposed. The SGR query is essentially a subgraph matching problem, which searches for a set of objects in FineGeoKG that match a given spatial pattern P. This paper proposes an exact subgraph matching algorithm for FineGeoKG. The algorithm utilizes the SGR edge index to quickly find the set of edges that match P and further finds the optimal matching path.
[0100] (3) The spatial pattern approximation query problem on FineGeoKG is defined and a query algorithm is proposed. Due to the high time complexity of exact query, this paper further defines the approximation query problem and proposes an algorithm based on graph neural networks (GR-Match). The algorithm decomposes FineGeoKG into several k-hop subgraphs, trains the embedding vectors of the subgraphs, uses the model to embed the query graph, selects candidate subgraphs that meet the structural features in the embedding space, and uses the R-Match method to abstractly represent the query conditions.
[0101] In this embodiment of the invention, computer technology is used to effectively solve the problem of spatial relationship representation and query in the field of geographic information science. The fine-grained geospatial knowledge graph (FineGeoKG) and related algorithms proposed in this invention adopt newer technical means and methods, which improves the efficiency of solving spatial relationship-related problems in geospatial areas and provides a solution that can be used as a reference for similar problems.
[0102] Figure 13 This is a schematic diagram of a fine-grained geospatial knowledge graph construction and query system according to the present invention. The system 200 is used for the construction and query of the aforementioned fine-grained geospatial knowledge graph. The system 200 includes:
[0103] The spatial relationship module 210 is used to acquire the dataset and express and calculate the spatial relationship through the DE-9IM model. Each pair of geometric objects in the dataset is described using the DE-9IM model to describe the spatial relationship between them.
[0104] The ontology structure construction module 220 is used to define the fine-grained geospatial knowledge graph FineGeoKG and the strong geospatial relationship SGR; based on the defined fine-grained geospatial knowledge graph FineGeoKG and the strong geospatial relationship SGR, the target information in the dataset is extracted to obtain the ontology structure of the knowledge graph.
[0105] The knowledge graph construction module 230 is used to obtain multiple strong geospatial relationships (SGRs) from the dataset using a spatial interconnection algorithm, and construct a fine-grained geospatial knowledge graph, FineGeoKG.
[0106] SGR query module 240 is used to define SGR queries, dividing SGR queries into exact queries and approximate queries; it performs exact queries on the FineGeoKG geospatial knowledge graph using an exact query algorithm; and it performs approximate queries on the FineGeoKG geospatial knowledge graph using an approximate query algorithm.
[0107] Preferably, the ontology structure construction module 220, further used in FineGeoKG, includes: a quintuple (E, R, L, P, V), where set E represents a fine-grained geographic object entity, set R represents the spatial relation (SGR) between two entities, set L represents the category of the entity and relation, set P represents an attribute, and set V represents the value corresponding to P; in FineGeoKG, an entity can have multiple labels, and a relation should have at least one "sgr" label to represent a spatial relation;
[0108] A strong geospatial relationship (SGR) is defined as follows: if two geographic entities ox and oy are close to each other in two-dimensional Euclidean space, then they have a strong geospatial relationship (SGR).
[0109] Preferably, the ontology structure construction module 220 is further used to identify SGRs while constructing the mapping table, rather than constructing the mapping table in advance;
[0110] The objects are examined in the order of "point → line → surface"; the objects are the data in the dataset.
[0111] Preferably, the SGR query module 240 is further used for SGR query including: given a FineGeoKG and a query graph P, an SGR query refers to finding all object groups [O1, O2, ..., Ok] in the knowledge graph that can satisfy the query graph P.
[0112] Preferably, the SGR query module 240 is further used for
[0113] Both exact and approximate queries include two query methods: structured queries and semantic queries;
[0114] Among them, the structure query is a structure query algorithm based on GNN; the semantic query is a semantic query algorithm based on R-Tree.
[0115] Preferably, the structure query includes:
[0116] Given a FineGeoKG and a query graph P, an SGR structure query is to find all object groups [O1, O2, ..., Ok] that satisfy the query graph P from the knowledge graph;
[0117] There are no restrictions on the edges in the query graph P, and the vertex types are limited to points, lines, and faces.
[0118] Preferably, the semantic query includes:
[0119] Given a FineGeoKG and a query graph P, an SGR structure query is to find all object groups [O1, O2, ..., Ok] that satisfy the query graph P from the knowledge graph;
[0120] Among them, at least one edge in the query graph P has a quantitative constraint on strong geospatial relationships, and the vertex types are not limited to points, lines, and polygons.
[0121] Preferably, the SGR query module 240 is further used for precise querying, including:
[0122] Based on the data structure characteristics of FineGeoKG, an SGR edge index is established to quickly find different types of SGR edges, while defining a normalized edge search order.
[0123] Preferably, the SGR query module 240 is further configured to have six types of SGR relationships in the SGR edge index, which includes six sub-indexes: face-face sub-index, face-line sub-index, face-point sub-index, line-line sub-index, line-point sub-index, and point-point sub-index; each sub-index organizes the SGR edges according to the corresponding vertex type.
[0124] In this embodiment of the invention, computer technology is used to effectively solve the problem of spatial relationship representation and query in the field of geographic information science. The fine-grained geospatial knowledge graph (FineGeoKG) and related algorithms proposed in this invention adopt newer technical means and methods, which improves the efficiency of solving spatial relationship-related problems in geospatial areas and provides a solution that can be used as a reference for similar problems.
[0125] Figure 14This is a schematic diagram of the structure of an electronic device 300 provided in an embodiment of the present invention. The electronic device 300 can vary considerably due to differences in configuration or performance. It may include one or more central processing units (CPUs) 301 and one or more memories 302. The memories 302 store at least one instruction, which is loaded and executed by the processors 301 to implement the steps of the following method for constructing and querying a fine-grained geospatial knowledge graph:
[0126] S1. Obtain the dataset and express and calculate the spatial relationships using the DE-9IM model. Describe the spatial relationships between each pair of geometric objects in the dataset using the DE-9IM model.
[0127] S2. Define a fine-grained geospatial knowledge graph (FineGeoKG) and a strong geospatial relationship (SGR); based on the defined fine-grained geospatial knowledge graph (FineGeoKG) and strong geospatial relationship (SGR), extract the target information from the dataset to obtain the knowledge graph ontology structure.
[0128] S3. Using a spatial interconnection algorithm, obtain multiple strong geospatial relationships (SGRs) from the dataset and construct a fine-grained geospatial knowledge graph (FineGeoKG).
[0129] S4. Define SGR queries, dividing them into exact queries and approximate queries; perform exact queries on the FineGeoKG using an exact query algorithm; and perform approximate queries on the FineGeoKG using an approximate query algorithm.
[0130] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions that can be executed by a processor in a terminal to complete the above-described method for constructing and querying a fine-grained geospatial knowledge graph. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.
[0131] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
Claims
1. A method for constructing and querying a fine-grained geospatial knowledge graph, characterized in that, The method steps include: S1. Obtain the dataset and express and calculate the spatial relationships using the DE-9IM model. Describe the spatial relationships between each pair of geometric objects in the dataset using the DE-9IM model. S2. Define a fine-grained geospatial knowledge graph (FineGeoKG) and a strong geospatial relationship (SGR); based on the defined fine-grained geospatial knowledge graph (FineGeoKG) and strong geospatial relationship (SGR), extract the target information from the dataset to obtain the knowledge graph ontology structure. S3. Using a spatial interconnection algorithm, obtain multiple strong geospatial relationships (SGRs) from the dataset and construct a fine-grained geospatial knowledge graph (FineGeoKG). S4. Define SGR queries, dividing them into exact queries and approximate queries; perform exact queries on the FineGeoKG using an exact query algorithm; and perform approximate queries on the FineGeoKG using an approximate query algorithm. In step S2, the FineGeoKG includes a quintuple (E, R, L, P, V), where set E represents fine-grained geographic object entities, set R represents the spatial relation (SGR) between two entities, set L represents the category of entities and relations, set P represents attributes, and set V represents the value corresponding to P. In FineGeoKG, an entity can have multiple labels, and a relation should have at least one SGR label to represent the spatial relationship. The strong geospatial relationship SGR is defined as follows: if two geographic entities ox and oy are close to each other in two-dimensional Euclidean space, then they have a strong geospatial relationship SGR. In step S2, extracting target information from the dataset includes: Identify SGRs while constructing the mapping table; The objects are examined in the order of "point → line → surface"; the objects are the data in the dataset.
2. The method according to claim 1, characterized in that, In step S4, the SGR query includes: given a FineGeoKG and a query graph P, an SGR query refers to finding all object groups [O1, O2, ..., Ok] that can satisfy the query graph P from the knowledge graph.
3. The method according to claim 2, characterized in that, Step S4 includes: Both exact and approximate queries include two query methods: structured queries and semantic queries; The structure query is a structure query algorithm based on GNN; the semantic query is a semantic query algorithm based on R-Tree.
4. The method according to claim 3, characterized in that, The structure query includes: Given a FineGeoKG and a query graph P, an SGR structure query is to find all object groups [O1, O2, ..., Ok] that satisfy the query graph P from the knowledge graph; There are no restrictions on the edges in the query graph P, and the vertex types are limited to points, lines, and faces.
5. The method according to claim 3, characterized in that, The semantic query includes: Given a FineGeoKG and a query graph P, an SGR structure query is to find all object groups [O1, O2, ..., Ok] that satisfy the query graph P from the knowledge graph; Among them, at least one edge in the query graph P has a quantitative constraint on strong geospatial relationships, and the vertex types are not limited to points, lines, and polygons.
6. The method according to claim 5, characterized in that, In step S4, the precise query includes: Based on the data structure characteristics of FineGeoKG, an SGR edge index is established to quickly find different types of SGR edges, while defining a normalized edge search order.
7. The method according to claim 6, characterized in that, In step S4, the SGR edge index has six types of SGR relationships. The SGR edge index includes six sub-indexes, namely: face-face sub-index, face-line sub-index, face-point sub-index, line-line sub-index, line-point index, and point-point index; each sub-index organizes the SGR edges according to the corresponding vertex type.
8. A system for constructing and querying fine-grained geospatial knowledge graphs, characterized in that, The system is used for the construction and querying method of fine-grained geospatial knowledge graph as described in any one of claims 1 to 7, and the system includes: The spatial relationship module is used to acquire the dataset and express and calculate the spatial relationships using the DE-9IM model. It describes the spatial relationship between each pair of geometric objects in the dataset using the DE-9IM model. The ontology structure construction module is used to define the fine-grained geospatial knowledge graph FineGeoKG and the strong geospatial relationship SGR; based on the defined fine-grained geospatial knowledge graph FineGeoKG and the strong geospatial relationship SGR, the target information in the dataset is extracted to obtain the ontology structure of the knowledge graph. The knowledge graph construction module is used to extract multiple strong geospatial relationships (SGRs) from the dataset using spatial interconnection algorithms, and construct a fine-grained geospatial knowledge graph, FineGeoKG. The SGR query module is used to define SGR queries, dividing them into exact queries and approximate queries. It performs exact queries on the FineGeoKG geospatial knowledge graph using an exact query algorithm, and approximate queries on the FineGeoKG geospatial knowledge graph using an approximate query algorithm.
Citation Information
Patent Citations
GraphDB-based space-time knowledge graph construction method and device, medium and equipment
CN112732939A
Geospatial information knowledge service method and device based on semantic network
CN116226302A