A method for constructing a geographic entity application platform based on graph database

By converting the geographical entity database into a graph database and building WebGIS, the problem of basic surveying and mapping results being difficult to meet the needs of materialization, three-dimensionalization, and semantics has been solved, the efficient management and analysis capabilities of geographical information data have been achieved, and users' needs for personalization have been satisfied. demand for geographic information products.

CN118349617BActive Publication Date: 2024-09-17JIANGSU PROVINCE SURVEYING & MAPPING ENG INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410775161.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-17
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Existing basic surveying and mapping results are difficult to meet the needs of physical, three-dimensional, semantic, structured, full-space, and human-machine compatible geographical information, and there are limitations in data management and analysis.

Method used

Using a graph database-based method, we parse the geographic entity database, convert it from RDB database format to RDF file format, import the graph database, develop geographic entity WebGIS, build a visual knowledge graph, and use Cypher query language for query and statistics.

Benefits of technology

It achieves efficient management and conversion of geographical entity data, improves data comprehensibility and storage and retrieval efficiency, provides users with deeper information mining and analysis capabilities, and meets users' needs for personalized, diverse and standardized geographical information products. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118349617B
    Figure CN118349617B
Patent Text Reader

Abstract

The present invention discloses a method for constructing a geographic entity application platform based on a graph database, and relates to the field of surveying and mapping geographic information technology. The method for constructing a geographic entity application platform based on a graph database comprises the following steps: parsing a geographic entity database, converting the geographic entity database from an RDB database format to an RDF file format; importing the converted RDF file format into a graph database; developing a geographic entity WebGIS based on the graph database; and constructing a visual knowledge graph based on the geographic entity WebGIS. The present invention realizes efficient management and conversion of geographic entity data by combining a graph database and a geographic information method, so that semantic relationships can be clearly expressed, which not only improves the comprehensibility of data, but also provides a richer context for intelligent applications, making data storage and retrieval more efficient, and providing users with a deeper level of information mining and analysis capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of surveying and mapping geographic information technology, and in particular to a method for constructing a geographic entity application platform based on a graph database. Background Art

[0002] Geographic entities are geographic objects that occupy a certain and continuous spatial position and range in the real world and have the same attributes or complete functions. They can be naturally formed or artificially constructed objects, such as water systems, transportation, buildings and site facilities, pipelines, place names, addresses, courtyards, etc. Geographic entities have the same attributes or complete functions, and include spatial characteristics, attribute characteristics and time characteristics. Spatial characteristics describe the absolute spatial position of the geographic entity and its spatial relationship with other entities; attribute characteristics are also called non-spatial characteristics, involving qualitative and quantitative indicators of geographic entities, such as semantic information and statistical information; time characteristics refer to the time or period of geographic data collection or geographic phenomenon.

[0003] In the Geographic Information System (GIS), geographic entities can be further subdivided into point entities, line entities, surface entities and volume entities. These entities are usually a collection of independent simple entities with a closed boundary between them. Basic geographic entities are geographic entities collected and expressed through basic surveying and mapping. They are the positioning framework and carrier basis for other geographic entities and related information. Geographic entity data is the digital description of geographic entities in the computer system, including three parts: primitives, entity attributes and entity relationship data.

[0004] With the development of the economy and society, the problems of the original basic surveying and mapping in terms of product form, technical methods, and management methods have become increasingly prominent. On the one hand, the existing basic surveying and mapping results are implemented in accordance with the standards of simulated paper topographic maps, which are abstract expressions of the real world in terms of elements and scales. Although they can be recognized by the human eye, they are difficult for machines to understand, and there are great limitations in spatial analysis and decision-making. On the other hand, with the deep integration of technologies such as big data, cloud computing, and artificial intelligence with surveying and mapping, the demand for basic surveying and mapping results has changed, requiring the provision of "substantial, three-dimensional, semantic, structured, full-space, and human-machine compatible" geographic information products.

[0005] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention

[0006] In view of the problems in the related technology, the present invention proposes a method for constructing a geographic entity application platform based on a graph database to overcome the above-mentioned technical problems existing in the existing related technology.

[0007] To this end, the specific technical solution adopted by the present invention is as follows:

[0008] A method for constructing a geographic entity application platform based on a graph database, the method for constructing a geographic entity application platform based on a graph database comprising the following steps:

[0009] S1, parsing the geographic entity database, converting the geographic entity database from the RDB database format to the RDF file format;

[0010] S2, import the converted RDF file format into the graph database;

[0011] S3, develop geographic entity WebGIS based on graph database;

[0012] S4. Build a visual knowledge graph based on geographic entities WebGIS.

[0013] Optionally, parsing the geographic entity database and converting the geographic entity database from the RDB database format to the RDF file format includes the following steps:

[0014] S11. Use arcpy to parse geographic entity database;

[0015] S12, traversing the entity attribute table in the geographic entity database, extracting entity classification, entity coding and attribute field information, and cyclically writing entity attribute RDF files;

[0016] S13, traversing the primitive layers in the geographic entity database, extracting the recorded tag names, primitive codes and attribute field information, and cyclically writing the primitive attribute RDF file;

[0017] S14, traverse the records in the entity and graphic element relationship table, extract entity classification, entity code and graphic element code, and write the entity and graphic element RDF files in a loop;

[0018] S15, traverse the records in the entity and entity relationship table, extract entity classification, entity code and relationship name, and write the entity and entity RDF file in a loop;

[0019] S16. Obtain entity attribute RDF file, graphic element attribute RDF file, entity and graphic element RDF file, and entity and entity RDF file to obtain the converted RDF file format.

[0020] Optionally, importing the converted RDF file format into the graph database includes the following steps:

[0021] S21. Based on the converted RDF file format, use py2neo to traverse the RDF file and create a Node object connection graph database;

[0022] S22, traverse the entity attribute table file, parse the entity attribute information, build the entity node and submit the transaction to the graph database;

[0023] S23, traverse the graph attribute table file, parse the graph attribute information, build the graph node and submit the transaction to the graph database;

[0024] S24, traverse the entity and graphic element relationship table file, parse the entity and graphic element relationship information, build the entity and graphic element relationship and submit the transaction to the graph database;

[0025] S25. Traverse the entity and entity relationship table file, parse the entity information, build the entity and entity relationship and submit the transaction to the graph database.

[0026] Optionally, traversing the entity attribute table file, parsing the entity attribute information, building the entity node and submitting the transaction to the graph database includes the following steps:

[0027] S221. Use py2neo to traverse the RDF file and obtain the classification and encoding information of the entity;

[0028] S222, according to the creation of the Node object, the classification and coding information of the entity is used as the Label of the Node object;

[0029] S223, adding entity attributes to the Node object to construct an entity node;

[0030] S224. Use py2neo to start a graph database transaction. After building 1,000 entity nodes, submit a transaction to the graph database.

[0031] Optionally, traversing the graph attribute table file, parsing the graph attribute information, constructing the graph node and submitting the transaction to the graph database includes the following steps:

[0032] S231. Use py2neo to traverse the RDF file and obtain the classification and coding information of the graphic element;

[0033] S232, according to the creation of the Node object, the classification and coding information of the graphic element is used as the Label of the Node object;

[0034] S233, adding the primitive attributes to the Node object to construct the primitive node;

[0035] S234. Use py2neo to start a graph database transaction. After building 1,000 graph nodes, submit a transaction to the graph database.

[0036] Optionally, traversing the entity-element relationship table file, parsing the entity-element relationship information, constructing the entity-element relationship and submitting the transaction to the graph database includes the following steps:

[0037] S241. Use py2neo to traverse the RDF file and obtain the mapping relationship between entities and primitives;

[0038] S242, extracting entity codes and primitive codes according to the mapping relationship between entities and primitives;

[0039] S243, obtaining entity Node objects and graph element Node objects from the graph database, and constructing a Relationship object;

[0040] S244. Use py2neo to start a graph database transaction. After building 1,000 Relationship objects, submit a transaction to the graph database.

[0041] Optionally, traversing the entity and entity relationship table file, parsing the entity information, building the entity and entity relationship, and submitting the transaction to the graph database includes the following steps:

[0042] S251. Use py2neo to traverse the RDF file and obtain the mapping relationship between entities;

[0043] S252, extracting entity codes according to the mapping relationship between entities;

[0044] S253, obtain the entity Node object from the graph database and construct a Relationship object;

[0045] S254. Use py2neo to start a graph database transaction. After building 1,000 Relationship objects, submit a transaction to the graph database.

[0046] Optionally, based on the graph database, developing a geographic entity WebGIS includes the following steps:

[0047] S31, based on graph database, adopts B / S architecture design, and builds geographic entity WebGIS with front-end and back-end technologies;

[0048] S32. Use the Cypher query language in the graph database to perform WebGIS queries and statistics on geographic entities.

[0049] Optionally, the geographic entity WebGIS query includes keyword query, geographic entity directory query and query by spatial range;

[0050] Among them, keyword query is used to query all entities with keywords in their names and their attribute information;

[0051] Geographic entity directory query, used to display the name and main attributes of geographic entities;

[0052] Query by spatial range, used to query geographic entities by spatial range.

[0053] Optionally, based on the geographic entity WebGIS, constructing a visual knowledge graph includes the following steps:

[0054] S41, based on the developed geographic entity WebGIS, use scy and kg to connect the graph database to obtain node and relationship data;

[0055] S42, rendering the acquired node and relationship data into a web page;

[0056] S43, displaying geographic entity knowledge graph by writing the interaction logic between nodes and relationship data in the web page;

[0057] S44. Dynamically render the display of geographic entity knowledge graph through three-dimensional force graph.

[0058] The beneficial effects of the present invention are:

[0059] 1. The present invention realizes the efficient management and conversion of geographic entity data by combining graph database and geographic information methods, so that semantic relationships can be clearly expressed, which not only improves the comprehensibility of data, but also provides a richer context for intelligent applications, making data storage and retrieval more efficient, and providing users with deeper information mining and analysis capabilities.

[0060] 2. Through the visualization knowledge graph module, the present invention enables users to obtain a more intuitive and comprehensive presentation of geographic information, which not only helps users better understand and fully utilize spatial data, but also provides them with a more intuitive and in-depth display of geographic information, and provides users with personalized, diversified and standardized geographic information products, so as to better meet their needs in specific fields and application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0062] Figure 1 is a flow chart of a method for constructing a geographic entity application platform based on a graph database according to an embodiment of the present invention;

[0063] Figure 2 It is an E and R graph of the semantic relationship of a road segment entity in a method for constructing a geographic entity application platform based on a graph database according to an embodiment of the present invention;

[0064] Figure 3It is an RDF model diagram of the semantic relationship of road segment entities in a method for constructing a geographic entity application platform based on a graph database according to an embodiment of the present invention;

[0065] Figure 4 It is a diagram of the geographic entity WebGIS architecture in a method for constructing a geographic entity application platform based on a graph database according to an embodiment of the present invention. DETAILED DESCRIPTION

[0066] To further illustrate each embodiment, the present invention provides drawings, which are part of the disclosure of the present invention and are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in the field should be able to understand other possible implementations and advantages of the present invention. The components in the figures are not drawn to scale, and similar component symbols are generally used to represent similar components.

[0067] According to an embodiment of the present invention, a method for constructing a geographic entity application platform based on a graph database is provided.

[0068] The present invention is further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to the method for constructing a geographic entity application platform based on a graph database according to an embodiment of the present invention, the method for constructing a geographic entity application platform based on a graph database includes the following steps:

[0069] S1. Parse the geographic entity database and convert the geographic entity database from the RDB database format to the RDF file format.

[0070] It should be noted that the D2R conversion of geographic entity data is the process of converting the structured relational database (RDB) structure into the RDF data structure. RDF is usually stored in the form of a triple of <entity A, relationship, entity B>. The triple structure is expanded into a text file with four RDF structures: entity attributes, primitive attributes, entity-primitive relationships, and entity-entity relationships.

[0071] Optionally, parsing the geographic entity database and converting the geographic entity database from the RDB database format to the RDF file format includes the following steps:

[0072] S11. Use arcpy to parse the geographic entity database.

[0073] It should be noted that arcpy is a Python module provided by ArcGIS software, which is used to access and process ArcGIS data and tools in the Python environment. It provides functions such as spatial data access and management, geographic processing and spatial analysis, mapping and spatial data visualization, workflow orchestration and automation, etc.

[0074] S12. Traverse the entity attribute table in the geographic entity database, extract entity classification, entity code and attribute field information, and write the entity attribute RDF file in a loop.

[0075] It should be noted that, referring to the category classification in the "Technical Documents on New Basic Surveying and Mapping and Real-life 3D China Construction", combined with the actual application needs of Pei County, geographic entities are divided into twelve major categories and forty minor categories, which are saved in the File GDB database as Table type. The conversion program is developed using arcpy, and the arcpy.ListTables("STJBB_*") method is used to traverse all entity attribute tables in the geographic entity database, and then arcpy.da.SearchCursor is used to traverse the data records in each table, extract the entity classification, entity code and each attribute field information of each record, and combine them into the format of "<Entity A classification: <Entity A code: Entity A code value, attribute 1: attribute 1 value, attribute 2: attribute 2 value...>>", and write the entity attribute RDF file in a loop to realize the conversion of entity attribute table information.

[0076] S13, traversing the primitive layers in the geographic entity database, extracting the recorded tag names, primitive codes and attribute field information, and cyclically writing them into the primitive attribute RDF file.

[0077] It should be noted that the feature is the geometric unit of geographic entity data, which is saved in the File GDB database as FeatureClass type. The conversion program is developed using arcpy, and the arcpy.ListFeatureClasses() method is used to traverse all feature layers in the geographic entity database. Then arcpy.da.SearchCursor is used to traverse the attribute information in each feature layer, and the label name, feature code and attribute field information of each record are extracted, and combined into the format of "<feature A layer: <feature A code: feature A code value, attribute 1: attribute 1 value, attribute 2: attribute 2 value... >>", and the feature attribute RDF file is written in a loop to realize the conversion of feature attribute table information.

[0078] S14, traverse the records in the entity and graphic element relationship table, extract entity classification, entity code and graphic element code, and write the entity and graphic element RDF files in a loop.

[0079] It should be noted that an entity can contain one or more point, line, and surface graphics, so there is a one-to-many relationship between entities and graphics. The relationship between entities and graphics is saved in the GLB table of the File GDB database. The arcpy.da.SearchCursor method is used to traverse the records in the GLB table, extract the format of "<entity A code, graphics A code, entity A classification, graphics A layer>", and write it into the RDF file in a loop, thereby realizing the conversion of entity and graphics relationship information.

[0080] S15. Traverse the records in the entity and entity relationship table, extract entity classification, entity code and relationship name, and write the entity and entity RDF file in a loop.

[0081] It should be noted that entity relationship data describes the relationships between entities, including spatial relationships, category relationships, time association relationships, and geometric composition relationship data. Entities and entity relationships are stored in the GXB table of the File GDB database. The arcpy.da.SearchCursor method is used to traverse the records in the GXB table, extract the format of "<entity A code, entity B code, relationship name, entity A classification, entity B classification>", and write it into the RDF file in a loop, thereby realizing the conversion of entity and entity relationship information.

[0082] S16. Obtain entity attribute RDF file, graphic element attribute RDF file, entity and graphic element RDF file, and entity and entity RDF file to obtain the converted RDF file format.

[0083] It is necessary to add that, if Figure 2 As shown in the figure, geographic entity data is stored in File GDB format, which is a spatial database format of ArcGIS software. Surveying and mapping departments generally use ArcGIS software to process entity information tables, entity relationship tables, and metadata of geographic entities. These are structured relational database data. Relational databases model the relationships among geographic entities in a "tabular structure". Their strict modeling constraints make it difficult to adapt to dynamically changing data structure relationships. In processing the semantic relationships between entities, relational databases need to operate tables through "foreign key" connections, which also makes their query efficiency low. Taking the road segment entity as an example, using the relational database structure, separate tables must be created for roads, road segments, service areas, bridges, and administrative areas, and the tables are related to each other through foreign keys.

[0084] In addition, if Figure 3As shown in the figure, the RDF model is a data model commonly used in current knowledge graphs. Its full name is Resource Description Framework. It officially became the recommended standard of the World Wide Web Consortium in 2004. It uses the RDF structure to store semantic relationships. It only needs to create various geographic entity objects. There is no need for primary keys, foreign keys, or intermediate tables between objects. Only necessary attributes need to be retained. Each object directly expresses the complex relationships between entities through relationship pointing. Therefore, the complex relationships between data can be described more concisely and clearly.

[0085] S2. Import the converted RDF file format into the graph database.

[0086] It should be noted that a graph database is a database specifically used to store and operate graph-structured data. In a graph database, data is represented in the form of a graph, consisting of nodes (entities) and edges (relationships). This type of database is particularly suitable for processing complex relationships and networks. Neo4j is one of the most popular graph databases currently. It has high performance, uses the Cypher query language, supports ACID transactions, and has a rich ecosystem, so it is widely used.

[0087] Optionally, importing the converted RDF file format into the graph database includes the following steps:

[0088] S21. Based on the converted RDF file format, use py2neo to traverse the RDF file and create a Node object connection graph database.

[0089] It should be noted that semantic relationship information is stored in the neo4j database through py2neo, each entity is mapped to a node in neo4j, and each relationship is mapped to an edge in neo4j. py2neo is a Python module that can be used to operate Neo4j nodes, relationships, attributes and other objects in Python, and perform transaction management on the graph database.

[0090] S22. Traverse the entity attribute table file, parse the entity attribute information, build the entity node and submit the transaction to the graph database.

[0091] Optionally, traversing the entity attribute table file, parsing the entity attribute information, building the entity node and submitting the transaction to the graph database includes the following steps:

[0092] S221. Use py2neo to traverse the RDF file and obtain the classification and encoding information of the entity.

[0093] S222. According to the creation of the Node object, the classification and coding information of the entity is used as the Label of the Node object.

[0094] S223. Add entity attributes to the Node object to construct an entity node.

[0095] S224. Use py2neo to start a graph database transaction. After building 1,000 entity nodes, submit a transaction to the graph database.

[0096] S23. Traverse the graph attribute table file, parse the graph attribute information, build the graph node, and submit the transaction to the graph database.

[0097] Optionally, traversing the graph attribute table file, parsing the graph attribute information, constructing the graph node and submitting the transaction to the graph database includes the following steps:

[0098] S231. Use py2neo to traverse the RDF file and obtain the classification and encoding information of the graphics elements.

[0099] S232. Based on the creation of the Node object, the classification and coding information of the graphic element is used as the Label of the Node object.

[0100] S233. Add the primitive attributes to the Node object to construct the primitive node.

[0101] S234. Use py2neo to start a graph database transaction. After building 1,000 graph nodes, submit a transaction to the graph database.

[0102] S24. Traverse the entity and graphic element relationship table file, parse the entity and graphic element relationship information, build the entity and graphic element relationship and submit the transaction to the graph database.

[0103] Optionally, traversing the entity-element relationship table file, parsing the entity-element relationship information, constructing the entity-element relationship and submitting the transaction to the graph database includes the following steps:

[0104] S241. Use py2neo to traverse the RDF file and obtain the mapping relationship between entities and graphics elements.

[0105] S242. Extract entity codes and primitive codes according to the mapping relationship between entities and primitives.

[0106] S243. Obtain entity Node objects and graph Node objects from the graph database, and construct a Relationship object.

[0107] S244. Use py2neo to start a graph database transaction. After building 1,000 Relationship objects, submit a transaction to the graph database.

[0108] S25. Traverse the entity and entity relationship table file, parse the entity information, build the entity and entity relationship and submit the transaction to the graph database.

[0109] Optionally, traversing the entity and entity relationship table file, parsing entity information, building entity and entity relationship, and submitting the transaction to the graph database includes the following steps:

[0110] S251. Use py2neo to traverse the RDF file and obtain the mapping relationship between entities.

[0111] S252. Extract entity codes according to the mapping relationship between entities.

[0112] S253. Get the entity Node object from the graph database and construct a Relationship object.

[0113] S254. Use py2neo to start a graph database transaction. After building 1,000 Relationship objects, submit a transaction to the graph database.

[0114] S3. Develop geographic entity WebGIS based on graph database.

[0115] It should be noted that geographic entity query and statistics is a very important function in the application platform. According to the traditional method, geographic entities are published as services through ArcGIS Server, which can be completed by calling the query interface of ArcGIS Server service. However, the cross-service and cross-layer query performance of ArcGIS Server service has always been its shortcoming, and it is impossible to query through the semantic relationship between layers. Through the Cypher query language provided by neo4j, the query and statistics of geographic entities are realized.

[0116] Optionally, based on the graph database, developing a geographic entity WebGIS includes the following steps:

[0117] S31. Based on graph database, adopt B / S architecture design, and build geographic entity WebGIS with front-end and back-end technologies.

[0118] It is necessary to add that, if Figure 4 As shown, the geographic entity WebGIS adopts B / S architecture, and adopts modular and component-based ideas in design to achieve software configurability and reserve interfaces for future expansion of the system. The overall architecture is divided from bottom to top into: infrastructure layer, data layer, service layer and application layer.

[0119] Infrastructure layer: The infrastructure layer is the bottom layer of the geographic entity WebGIS construction and is also the infrastructure of the entire geographic entity WebGIS. It mainly includes network and communication facilities, host servers and storage systems, as well as operating systems, database management systems, etc. These are the most basic operating environments of the system.

[0120] Data layer: Data is the core of the entire geographic entity WebGIS operation. In the geographic entity WebGIS platform, various types of data are processed, handled, standardized, transmitted, and stored to form a platform database, providing the system with a scientific, efficient, and accurate data environment. The data layer mainly includes image slice data, terrain data, geographic entity data, geographic entity semantic relationship data, 3D Tiles three-dimensional models, mesh three-dimensional models and other data.

[0121] Service layer: The service layer solves the "information island" problem in information sharing to the greatest extent by providing application integration services and data integration services, maximizes the use of historical and existing data resources, and provides guarantees for efficient and reliable operation of the system. The data service layer mainly includes: image services, terrain services, geographic entity services, map output services, etc.

[0122] Presentation layer: The presentation layer is presented in the form of a geographic entity WebGIS site that links two-dimensional maps and three-dimensional maps. The two-dimensional map is developed based on the leaflet library and can call image services and geographic entity services. The three-dimensional map is developed based on the cesium library and can call image services and terrain services to display 3DTiles three-dimensional models and mesh three-dimensional models.

[0123] In addition, it should be noted that the developed geographic entity WebGIS front-end is built with the Vue3.0+TypeScript+vite technology stack, in which the leaflet library is used for the two-dimensional map part and the cesium library is used for the three-dimensional map part; different geographic entity WebGIS back-end construction solutions are adopted for different types of data. Image slices and geographic entity services are produced using ESRI's arcgis series software, so they are published using arcgis server, while geographic entity data, geographic entity semantic relationship data, 3DTiles three-dimensional models, mesh three-dimensional models and other data are published using Nginx software through the https protocol.

[0124] S32. Use the Cypher query language in the graph database to perform WebGIS queries and statistics on geographic entities.

[0125] It should be noted that graph databases represent the relationship between entities through nodes and edges. In neo4j, geographic entities such as roads and buildings are represented as nodes, and the spatial / semantic relationship between entities is represented as edges. On this graph structure, complex path queries and pattern matching can be performed to analyze the association between entities. The Cypher query language provided by neo4j realizes the query and statistics of geographic entities in WebGIS.

[0126] In addition, geographic entity classification statistics are used to count the number, distribution, density and other characteristic indicators of geographic entities under each category, conduct peer comparisons, evolution analysis, etc., and provide visual expressions to provide decision support. The application platform often uses the statistical values ​​of the number, length or area of ​​a certain type of geographic entity in a certain administrative area. Taking the statistics of the area of ​​lakes in a certain administrative area as an example, the Cypher statement is designed as follows:

[0127] MATCH (c:town),(n:${ename})

[0128] WHERE (p)-[:WITHIN]->(c)

[0129] RETURN sum(toFloat(n.Area)) AS TotalArea

[0130] Town is an administrative division, and the sum function is used to sum the area attributes of nodes that meet the conditions.

[0131] Optionally, the geographic entity WebGIS query includes keyword query, geographic entity directory query and query by spatial range;

[0132] Among them, keyword query is used to query all entities with keywords in their names and their attribute information.

[0133] It should be noted that keyword query is used to query all entities and their attribute information with a keyword in the name. If you use ArcGIS Server service query, you need to explicitly submit the layer ID as a parameter. If the layer order is changed, the code must be updated accordingly. The Cypher statement is as follows:

[0134] MATCH (n) WHERE n.STMC CONTAINS '${text}' RETURN n LIMIT 100

[0135] text is the keyword string to be queried. The type of geographic entity is not specified in the expression. The query object is all geographic entities in the neo4j graph database.

[0136] Geographic entity directory query is used to display the name and main attributes of geographic entities.

[0137] It should be noted that the geographic entity directory query is mainly used to display the name and main attributes of a certain type of geographic entity. The Cypher statement is as follows:

[0138] MATCH (n:${ename}) RETURN n

[0139] ename is the name of the geographic entity type to be displayed. The expression specifies the type of geographic entity, and the query object is the geographic entity of this type in the neo4j graph database.

[0140] Query by spatial range, used to query geographic entities by spatial range.

[0141] It should be noted that neo4j-spatial is a spatial extension plug-in for the Neo4j graph database, which provides the ability to store and query spatial data in Neo4j. Based on neo4j-spatial, the Cypher statement for querying by spatial range is designed as follows:

[0142] MATCH (n:${ename})

[0143] WHERE (n)-[:WITHIN]->(:Circle {radiusInKm: 10, latitude: ${lat},longitude: ${lon}})

[0144] RETURN

[0145] ename is the name of the geographic entity type to be displayed, lat and lon are the longitude and latitude coordinates of the query location, radiusInKm:10 means a radius of 10km. This Cypher statement is used to query geographic entities within 10km around the longitude and latitude coordinates (lat, lon) and whose entity type is ename.

[0146] S4. Build a visual knowledge graph based on geographic entities WebGIS.

[0147] It should be noted that the knowledge graph is a graphical structure used to organize, represent and reason about knowledge. It is a semantic network that describes the relationships and attributes between entities (such as people, places, and things). This kind of information is difficult to express with line graphs, bar graphs or pie charts, but it is very clear when presented in the form of a force-directed graph. There are many force-directed graph visualization front-end frameworks that support graph databases, such as Neovis.js, Cytoscape.js, and Vis.js abroad, and Baidu's Echart and Ant Financial's G6.js in China. They all have one thing in common, that is, the backend graph database is highly coupled and the style is highly customized. Although it can be used out of the box, it is difficult to meet some personalized needs. Therefore, the knowledge graph visualization modules scy and kg are developed to realize the visualization of the knowledge graph between geographic entities.

[0148] Optionally, based on the geographic entity WebGIS, constructing a visual knowledge graph includes the following steps:

[0149] S41. Based on the developed geographic entity WebGIS, use scy and kg to connect the graph database to obtain node and relationship data.

[0150] S42: Render the acquired node and relationship data into a web page.

[0151] S43. Display geographic entity knowledge graph by writing the interaction logic between nodes and relationship data in the web page.

[0152] S44. Dynamically render the display of geographic entity knowledge graph through three-dimensional force graph.

[0153] It should be noted that the attributes and semantic relationships of geographic entities are stored in the graph database. To build a visualization module for the knowledge graph, we must first connect to the graph database and obtain graph data. The scy-kg module encapsulates the Neo4jDriver, which is used to connect to the graph database and obtain graph data. Neo4j Driver is the official driver for interacting with the Neo4j graph database. It provides a client library for communicating with the Neo4j database in various programming languages. Based on it, the scy-kg module obtains node and relationship data from the Neo4j database through user authentication and instantiates it into json format. The data mainly includes the id, label, and attributes of the geographic entity node; the source node id, target node id, type, and attributes of the relationship.

[0154] In addition, it should be noted that 3d-force-graph is an open source JavaScript library for creating interactive 3D force-directed graphs. It is based on D3.js and Three.js and provides a simple and powerful way to visualize and explore complex relationship networks. The scy-kg module encapsulates 3d-force-graph for the display of knowledge graphs.

[0155] In summary, with the aid of the above technical solutions of the present invention, the present invention realizes efficient management and conversion of geographic entity data by combining graph databases and geographic information methods, so that semantic relationships can be clearly expressed, which not only improves the comprehensibility of data, but also provides a richer context for intelligent applications, making data storage and retrieval more efficient, and providing users with deeper information mining and analysis capabilities. Through the visualization knowledge graph module, the present invention enables users to obtain a more intuitive and comprehensive presentation of geographic information, which not only helps users better understand and fully utilize spatial data, but also provides them with a more intuitive and in-depth display of geographic information, and provides users with personalized, multi-standardized geographic information products, so as to better meet the needs of their specific fields and application scenarios.

[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for constructing a geographic entity application platform based on a graph database, characterized in that: The method for constructing the geographic entity application platform based on the graph database includes the following steps: S1, parsing the geographic entity database, converting the geographic entity database from the RDB database format to the RDF file format; S2, import the converted RDF file format into the graph database; S3, develop geographic entity WebGIS based on graph database; S4. Construct a visual knowledge graph based on geographic entity WebGIS; The parsing of the geographic entity database and converting the geographic entity database from the RDB database format to the RDF file format comprises the following steps: S11. Use arcpy to parse geographic entity database; S12, traversing the entity attribute table in the geographic entity database, extracting entity classification, entity coding and attribute field information, and cyclically writing entity attribute RDF files; S13, traversing the primitive layers in the geographic entity database, extracting the recorded tag names, primitive codes and attribute field information, and cyclically writing the primitive attribute RDF file; S14, traverse the records in the entity and graphic element relationship table, extract entity classification, entity code and graphic element code, and write the entity and graphic element RDF files in a loop; S15, traverse the records in the entity and entity relationship table, extract entity classification, entity code and relationship name, and write the entity and entity RDF file in a loop; S16, obtaining an entity attribute RDF file, a graphic element attribute RDF file, an entity and graphic element RDF file, and an entity and entity RDF file to obtain a converted RDF file format; The step of importing the converted RDF file format into the graph database comprises the following steps: S21. Based on the converted RDF file format, use py2neo to traverse the RDF file and create a Node object connection graph database; S22, traverse the entity attribute table file, parse the entity attribute information, build the entity node and submit the transaction to the graph database; S23, traverse the graph attribute table file, parse the graph attribute information, build the graph node and submit the transaction to the graph database; S24, traverse the entity and graphic element relationship table file, parse the entity and graphic element relationship information, build the entity and graphic element relationship and submit the transaction to the graph database; S25, traverse the entity and entity relationship table file, parse the entity information, build the entity and entity relationship and submit the transaction to the graph database; The development of geographic entity WebGIS based on the graph database includes the following steps: S31, based on graph database, adopts B / S architecture design, and builds geographic entity WebGIS with front-end and back-end technologies; S32. Use the Cypher query language in the graph database to perform WebGIS query and statistics on geographic entities; The construction of a visual knowledge graph based on the geographic entity WebGIS includes the following steps: S41, based on the developed geographic entity WebGIS, use scy and kg to connect the graph database to obtain node and relationship data; S42, rendering the acquired node and relationship data into a web page; S43, displaying geographic entity knowledge graph by writing the interaction logic between nodes and relationship data in the web page; S44. Dynamically render the display of geographic entity knowledge graph through three-dimensional force graph.

2. According to the method for constructing a geographic entity application platform based on a graph database according to claim 1, it is characterized in that: The traversal of the entity attribute table file, parsing the entity attribute information, building the entity node and submitting the transaction to the graph database includes the following steps: S221. Use py2neo to traverse the RDF file and obtain the classification and encoding information of the entity; S222, according to the creation of the Node object, the classification and coding information of the entity is used as the Label of the Node object; S223, adding entity attributes to the Node object to construct an entity node; S224. Use py2neo to start a graph database transaction. After building 1,000 entity nodes, submit a transaction to the graph database.

3. The method for constructing a geographic entity application platform based on a graph database according to claim 1, characterized in that: The traversal of the graph attribute table file, parsing the graph attribute information, constructing the graph node and submitting the transaction to the graph database includes the following steps: S231. Use py2neo to traverse the RDF file and obtain the classification and coding information of the graphic element; S232, according to the creation of the Node object, the classification and coding information of the graphic element is used as the Label of the Node object; S233, adding the primitive attributes to the Node object to construct the primitive node; S234. Use py2neo to start a graph database transaction. After building 1,000 graph nodes, submit a transaction to the graph database.

4. According to the method for constructing a geographic entity application platform based on a graph database as described in claim 1, it is characterized in that: The traversal of the entity and graphic element relationship table file, parsing the entity and graphic element relationship information, constructing the entity and graphic element relationship and submitting the transaction to the graph database includes the following steps: S241. Use py2neo to traverse the RDF file and obtain the mapping relationship between entities and primitives; S242, extracting entity codes and primitive codes according to the mapping relationship between entities and primitives; S243, obtaining entity Node objects and graph element Node objects from the graph database, and constructing a Relationship object; S244. Use py2neo to start a graph database transaction. After building 1,000 Relationship objects, submit a transaction to the graph database.

5. The method for constructing a geographic entity application platform based on a graph database according to claim 1, characterized in that: The traversal of entity and entity relationship table files, parsing entity information, building entity and entity relationships, and submitting transactions to the graph database include the following steps: S251. Use py2neo to traverse the RDF file and obtain the mapping relationship between entities; S252, extracting entity codes according to the mapping relationship between entities; S253, obtain the entity Node object from the graph database and construct a Relationship object; S254. Use py2neo to start a graph database transaction. After building 1,000 Relationship objects, submit a transaction to the graph database.

6. The method for constructing a geographic entity application platform based on a graph database according to claim 1, characterized in that: The geographic entity WebGIS query includes keyword query, geographic entity directory query and query by spatial range; The keyword query is used to query all entities with keywords in their names and their attribute information; The geographic entity directory query is used to display the name and main attributes of the geographic entity; The query by spatial range is used to query geographic entities by spatial range.