Space-time knowledge graph construction method for rail transit stations
By building a spatio-temporal knowledge graph for rail transit stations, the problem of difficulty in integrating and utilizing spatio-temporal knowledge in rail transit stations is solved, and an in-depth analysis of the development characteristics of rail transit stations and an effective combination of the TOD model and station space construction is achieved.
Patent Information
- Application Number
- CN202510360325.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-27
AI Technical Summary
The existing technology is difficult to effectively integrate and utilize a large amount of time and space knowledge in rail transit stations, and cannot meet the needs of urban space development under the guidance of the TOD model.
A method for building a spatiotemporal knowledge graph for rail transit stations is proposed. By defining the ontology of rail transit stations, multi-source data is extracted, entity relationships and attribute triplets are constructed, and knowledge graphs are stored using Neo4j graph database.
The constructed spatiotemporal knowledge graph can integrate multiple spatiotemporal data sources, support the analysis of rail transit stations, help researchers study the development characteristics of rail transit stations, and promote the organic combination of TOD model and station space construction.
Smart Images

Figure CN120218211A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of knowledge graph construction, and particularly relates to a method for constructing a spatio-temporal knowledge graph for rail transit stations. Background Art
[0002] The urban rail transit system is an important component of the urban complex system and the main artery of the transportation system, connecting different functional areas of the city. In recent years, China has made great progress in rail transit construction, and rail transit is playing an increasingly important role in the daily production and life of residents. As an important part of the rail transit system, rail transit stations have an important impact on the urban spatial structure and functional construction. TOD (Transit-Oriented-Development) is an urban development model oriented by public transportation. The TOD model emphasizes taking the public transportation station as the core, optimizing the urban spatial layout and land use status to improve the accessibility of public transportation. Its essence is to combine transportation with the living needs of residents and synchronously improve the quality of residents' lives and the functional value of surrounding plots through scientific design. For large-scale cities, rail transit is an important supporting force in the urban transportation system. Combining the construction of rail transit stations and the surrounding station areas with the TOD model will play a crucial role in meeting the travel needs of the people and optimizing the urban industrial function planning. Rail transit stations not only have basic transportation functions but also are important nodes for promoting the high-quality development of the city. Therefore, further research on the development characteristics of rail transit stations is an important guarantee for realizing the high-quality development of the surrounding station areas of urban rail transit stations and the organic combination of the TOD model and the construction of station areas. A large amount of geographical spatio-temporal data is contained in the urban space around rail transit stations and their nearby station areas. Facing the refined development needs of the urban space around rail transit stations, it is necessary to start from the overall situation, build a data system, and establish an internal mechanism between relevant data and the development of station areas.
[0003] As a structured knowledge representation method, the knowledge graph can formally describe entities and relationships in the objective world. In recent years, with the continuous increase in the amount of geospatial data and the continuous development of knowledge graph technology, the knowledge graph is being increasingly widely used in fields such as geographic information systems and smart cities, and has good prospects in the organization of spatio-temporal data and applications based on spatio-temporal data.
[0004] In order to solve the problem that a large amount of spatio-temporal knowledge in rail transit stations is difficult to be efficiently integrated and utilized, and to meet the urgent needs of urban space development guided by the TOD model, it is necessary to construct a knowledge graph for rail transit stations by combining multi-source data.
[0005] In recent years, many researchers have begun to use geographic information data to construct spatio-temporal knowledge graphs or explore the applications of spatio-temporal knowledge graphs in practical scenarios. On the one hand, researchers have integrated open-source data such as OpenStreetMap to construct geographic knowledge graphs on a global scale. Representative works in this regard include YAGO2geo, WorldKG, CKGG, etc. These works enable a large amount of geographic information in maps and nature to be better organized and applied. In addition, many spatio-temporal knowledge graphs constructed for specific downstream tasks have emerged. This type of work usually constructs knowledge graph ontologies and collects data based on specific analysis requirements, and then constructs and applies knowledge graphs in specific cities. Liu et al. constructed the UrbanKG knowledge graph containing urban geographic information for Beijing and Shanghai. Ning et al. proposed UUKG and a framework for constructing urban knowledge graphs, constructed knowledge graphs for New York and Chicago respectively, and improved the performance of the original data in urban spatio-temporal prediction tasks through knowledge graph representation learning. Wang et al. constructed the STKG knowledge graphs for Beijing, Shanghai and New York and performed representation learning on the knowledge graphs.
[0006] However, most of the current urban knowledge graphs are broadly integrated at the city level or constructed for specific downstream tasks, and there is no spatio-temporal knowledge graph constructed for the granularity of rail transit stations, especially the spatio-temporal knowledge graph constructed for the station area space and nearby plots of rail transit stations. Therefore, it is impossible to provide data support for the downstream analysis tasks of rail transit stations and the specific requirements in the TOD analysis scenario. Based on the limitations of the existing methods, the present invention proposes a spatio-temporal knowledge graph construction framework for rail transit stations, which is a general framework for urban-level spatio-temporal knowledge graphs, and its steps can be used in the construction tasks of spatio-temporal knowledge graphs for rail transit stations in any domestic city. Summary of the Invention
[0007] The present invention specifically aims at the problems existing in the prior art and provides a method for constructing a spatio-temporal knowledge graph for rail transit stations, including the following steps. First, a spatio-temporal knowledge graph ontology is constructed based on the analysis requirements of rail transit stations. Based on the constructed ontology, the present invention obtains entities and their attributes of types such as rail transit stations, isochronous influence areas of rail transit stations, plots, POIs, and POI categories in each city through data from multiple sources, and constructs corresponding entity relationships, thereby forming a spatio-temporal knowledge graph. The spatio-temporal knowledge graph constructed based on the method of the present invention integrates spatio-temporal data information from multiple sources and can support the analysis of data related to rail transit stations, thereby helping researchers study the development characteristics of rail transit stations.
[0008] To achieve the above object, the technical solution adopted by the present invention is: a method for constructing a spatio-temporal knowledge graph for rail transit stations, asFigure 1 As shown below, it specifically includes the following steps:
[0009] S1. Definition of the rail transit station ontology: Based on the analysis requirements of rail transit stations, define a rail transit ontology structure with entity types and relationships. The entity types include rail transit stations, the isochronous influence domain of rail transit stations, plots, POIs, and POI categories. The relationship types include isoIncludeBlock, isoIntersectingIso, stationHaveIso, locateAtIso, locateAtBlock, stationLocateAtCity, and Type.
[0010] S2. Extraction of rail transit station entities: Use web crawler technology to collect and integrate entity data of rail transit stations, the isochronous influence domain of rail transit stations, plots, POIs, and POI categories from multi-source map data such as OpenStreetMap and Amap.
[0011] S3. Extraction of rail transit station relationships: On the basis of the ontology defined in S1 and the entities extracted in S2, construct relationship triples between entities. For the relationships of stationHaveIso, stationLocateAtCity, and Type, directly construct relationships between entities during the process of obtaining entities. For the relationships of isoIncludeBlock, isoIntersectingIso, locateAtIso, and locateAtBlock, use the geopandas library in Python to judge the geographical associations between entities and construct relationships between entities.
[0012] S4. Extraction of rail transit station entity attributes: Further extract direct attributes and indirect attributes for the entities extracted in S2 to form attribute triples of the entities. The direct attributes include name, location, area, etc., which can be directly obtained from the data source. The indirect attributes include function mixing degree, building area, etc., which need to be further calculated through formulas based on the existing data.
[0013] S5. Knowledge graph storage: Use the Neo4j graph database to store the relationship triples and attribute triples obtained through the steps of S1 - S4.
[0014] In the method for constructing a spatio-temporal knowledge graph for rail transit stations of the present invention, in step S1, based on the analysis requirements of rail transit stations, the entity types are defined as including rail transit stations (stations), isochronous influence areas of rail transit stations (station areas), plots, POIs, and POI categories. The relationship types include: isoIncludeBlock (IIB), which acts between the isochronous influence area and the plot, expressing that there is such a plot within the isochronous influence area of the station; isoIntersectingIso (III), which acts between isochronous influence areas, expressing that these two isochronous influence areas are intersecting; stationHaveIso (SHI), which acts between the station and the station area, indicating that the station has such an isochronous influence area; locateAtIso (LAI), which acts between the POI and the isochronous influence area, expressing that the POI is located within the isochronous influence area; locateAtBlock (LAB), which acts between the POI and the plot, expressing that the POI is located within the plot; stationLocateAtCity (SLAC), which acts between the station and the city, expressing that the station is located in the city; Type, which acts between the POI and the POI category, expressing which POI category the POI belongs to.
[0015] In the method for constructing a spatio-temporal knowledge graph for rail transit stations of the present invention, in step S2, the present invention extracts 6 types of entities, and their meanings and extraction methods are as follows: City (city): the city where the rail transit station is located, which can be directly obtained according to the extracted city. Rail transit station (station), abbreviated as station: the rail transit station is the main research object of the knowledge graph constructed by the present invention. For all cities in China, the present invention obtains the geographical locations of the rail transit stations and their entrances and exits in the city through the Gaode Open Platform. Isochronous influence area of rail transit station (station_isochrone), abbreviated as station area: the concept of isochronous influence area (isochrone) was first proposed by the American Planning Officials Association (ASPO), aiming to illustrate that what residents care most about is not the distance between residence and job, but the time to travel between the two places and the accessibility of the target point. For each rail transit station s∈S, the present invention uses the five-minute reach range and the ten-minute reach range as different research granularities, and respectively defines i5∈I and i 10∈I, as the five - minute and ten - minute isochronous influence areas of the rail transit station, where S and I represent the set of station entities and the set of isochronous influence area entities respectively. For each rail transit station, in the present invention, the five - minute walking isochronous influence area and the ten - minute walking isochronous influence area are respectively extracted for all entrances and exits of each station through the isochrone api of mapbox. Then, the union of the five - minute / ten - minute walking isochronous influence areas of each entrance and exit of each station is taken to obtain the complete five - minute / ten - minute walking isochronous influence area of the station. The present invention repeats this operation for each station in the city until the walking isochronous influence areas of all stations are obtained. Plot (block): In the present invention, the urban road network is used to divide plots through OpenStreetMap. Specifically, the present invention first extracts the urban road network using OpenStreetMap, sets buffers with different widths for different road categories in OpenStreetMap according to the specific situation of urban roads to restore the real road width, and then takes the closed figure surrounded by the road buffer as the urban plot and deletes the plots completely covered by the buffer. POI: The present invention extracts all POI data in the city within the rail transit isochronous influence area and the surrounding plot area. POI category (POI_type): This entity is used to describe the type of POI, such as "food service", "leisure and entertainment service", etc. For domestic cities, the present invention obtains the POI and its type in the city through the Amap open platform.
[0016] In the method for constructing a spatio-temporal knowledge graph for rail transit stations of the present invention, in step S3, the method for extracting the relationship triples between entities of the present invention is as follows. For the relationships of "stationHaveIso", "stationLocateAtCity", and "Type", they are directly constructed during the data acquisition process. For the "isoIncludeBlock" relationship, the present invention uses the geopandas library in Python to separately determine for each station area entity which plot entities it intersects with. If intersecting plots are found, an "isoIncludeBlock" relationship is constructed between the station area entity and the plot entity. For the "isoIntersectingIso" relationship, the present invention uses the geopandas library in Python to separately determine for each station area entity which other station area entities in the city it intersects with. If intersecting station areas are found, an "isoIntersectingIso" relationship is constructed between these two station areas. For the "locateAtIso" relationship, the present invention uses the geopandas library in Python to separately determine for each POI entity which station area entity it is located in, and constructs a "locateAtIso" relationship between these two entities. For the "locateAtBlock" relationship, the present invention uses the geopandas library in Python to separately determine for each POI entity which plot entity it is located in, and constructs a "locateAtBlock" relationship between these two entities. In this way, the present invention establishes associations between all entities.
[0017] In the method for constructing a spatio-temporal knowledge graph for rail transit stations of the present invention, in step S4, the present invention extracts the corresponding attribute information for each entity. The attributes of the entity are divided into direct attributes and indirect attributes. Direct attributes include attributes such as name, the number of station entrances and exits, location, plot / station area area, etc., which can be directly extracted from the data source. In particular, for the most basic spatio-temporal attribute of location, for geographical entities such as POIs that can be described by points, the present invention directly extracts their longitude and latitude on the map as their location; while for geographical entities such as station time influence areas and plots that need to be represented by surfaces, the present invention describes their location by arranging the longitude and latitude coordinates of their boundary points in a counterclockwise direction. Indirect attributes are attributes that need to be calculated based on existing attributes and are used for analysis functions, such as the plot function mix degree. For the plot function mix degree, the calculation method of the present invention is:
[0018]
[0019] where H b represents the function mix degree of plot b, n refers to the total number of POI categories in the plot, and Wi It refers to the proportion of the number of the i-th type of POI in the plot among the total number of all POIs in the plot.
[0020] In the method for constructing a spatio-temporal knowledge graph for rail transit stations of the present invention, in step S5, the present invention uses the Neo4j graph database to store triples. Specifically, we integrate a csv file for each type of entity, with each column in the file being the attributes of the entity, and provide a csv file composed of all relationship triples. Then, the entity attribute file and the relationship triple file are imported into the Neo4j graph database together, and the Neo4j can be used to store this spatio-temporal knowledge graph.
[0021] As an improvement of the present invention, in step S2, for foreign cities, in the process of obtaining POIs, in addition to using the information of OpenStreetMap, the open-source information of the government platform can also be referred to as a supplement. For example, for Singapore, the POI and category information can be downloaded based on the official onemap platform of Singapore (https: / / www.onemap.gov.sg / home / ); for each city in Japan, the corresponding building POI data can be obtained based on the data of the Japanese government platform (https: / / www.mlit.go.jp / plateau / open-data / ). In the process of obtaining subway stations and entrances and exits, based on the data attributes of OpenStreeMap, rules can be customized to determine and capture the subway stations and entrances and exits of the city. For example, for Singapore, the points whose tags in the other_tags attribute tags of all points in OpenStreetMap satisfy public_transportation => stop_position or railway => stop or station => subway or subway => yes or monorail => yes or station => monorail can be used as rail transit stations, and then the entrances and exits can be extracted using railway = subway_entrance, and the corresponding relationship between the stations and the entrances and exits can be comprehensively judged by name and distance. This method solves the problem of data sources for foreign cities, and further promotes the method described in the present invention to other cities worldwide.
[0022] As an improvement of the present invention, in step S4, more indirect attribute information can be added according to the original data situation and actual analysis requirements. For example, a POI density attribute can be added to the plot entity, and its calculation method is If the original data has AOI information (i.e., the POI data can be represented by a region rather than a single point), this invention refers to this part of AOI as a building. For entities of plot types, building density attributes and plot ratio attributes can be added. The calculation formula for building density is The calculation formula for plot ratio is where the building floor area refers to the sum of the ground projection areas of the buildings within the plot, and the total building area refers to the sum of the above-ground building areas of all buildings within the plot. Building density and plot ratio can be calculated together. When calculating building density and plot ratio, first, the Arcmap software is used to perform a projection operation on the plot and building layers, projecting the city onto the WGS_1984_UTM_Zone_48N coordinate system to obtain the plot projection file and the building projection file. After projection, the plot area, building floor area, and total building area are respectively counted in the files, and the statistical results are added as attributes to the plot projection file and the building projection file. Subsequently, the plot projection file is connected to the building projection file, and when performing the connection operation, the summary attribute method is selected as "sum", obtaining a transitional file that contains the building floor area and total building area within each plot range. Among them, when calculating the total building area, for data directly containing the number of floors, the building area can be directly obtained by multiplying the number of floors by the building floor area; for data without the number of floors but with building height data, the approximate number of floors can be estimated. Based on the building floor area, total building area, and plot area in the transitional file, the building density and plot ratio of each plot can be obtained respectively according to the calculation formulas for building density and plot ratio. It should be noted that for building data without the number of floors and height, the plot ratio cannot be calculated. For entities of station area types, this invention can add road network density type attributes and intersection density attributes. The calculation of road network density is similar to that of building density. When calculating road network density, first, the total length of the roads within each station area is statistically obtained through spatial connection, and then the Arcmap software is used to perform a projection operation on the layer elements and count the road length and station area. Finally, through Calculate the road network density. The intersection density is defined as the number of intersections per square kilometer in the station area, where intersections include crossroads and dead-end roads. A crossroad refers to the intersection of any two (or more) roads on the map, and a dead-end road refers to the endpoint where a road is not connected to other parts of the road network. When calculating the intersection density, to count the number of intersections, first use the Arcmap software to convert the road network layer into lines to avoid errors caused by discontinuous road elements. Subsequently, obtain all the endpoints (including intersection points and dead-end road points) in the road layer through the operation of converting vertices to points. Then, use the topological function of the Arcmap software to find the dead-end road points among the endpoints by setting the topological rule "no dangling points". The road endpoints excluding the dead-end road point part are the intersection points. Finally, count the number of the two types of intersections in each station area through the spatial join operation, and then calculate the corresponding intersection density. The calculation formula for the intersection density is
[0023] An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, it implements the method for constructing a spatio-temporal knowledge graph for rail transit stations as described above.
[0024] A computer-readable storage medium, on which a computer instruction is stored, and when the computer instruction is executed by a processor, it implements the method for constructing a spatio-temporal knowledge graph for rail transit stations as described above.
[0025] Compared with the prior art: The advantages of the present invention are as follows.
[0026] 1. The present invention proposes a method for constructing a spatio-temporal knowledge graph for rail transit stations. The spatio-temporal knowledge graph for rail transit stations constructed by this method can help researchers analyze the spatial development status of the station area around urban rail transit stations, and thus promote the organic combination of the TOD mode and the construction of the station area and the high-quality development of the city.
[0027] 2. The present invention defines the ontology for constructing the spatio-temporal knowledge graph for rail transit stations. The spatio-temporal knowledge graph constructed under this ontology definition can support the actual analysis needs of the specific field of rail transit stations and the TOD mode.
[0028] 3. The method for constructing a spatio-temporal knowledge graph for rail transit stations proposed by the present invention is a general knowledge graph construction framework. For any city, the spatio-temporal data can be collected and organized according to the steps described in the present invention, which provides technical support for large-scale construction of spatio-temporal knowledge graphs for rail transit stations.
[0029] 4. In the process of constructing the isochronous influence domain such as rail transit stations, the present invention constructs it based on the union of the isochronous influence domains of the entrances and exits of rail transit stations, rather than simply constructing the spatio-temporal isochronous influence domain for a certain coordinate point. This is more in line with the actual situation of daily life and also more meets the analysis requirements for the influence range of rail transit stations.
[0030] 5. The spatio-temporal knowledge graph constructed by the method of the present invention not only considers the attributes of the isochronous influence domain of rail transit stations, but also further considers the plots and their related attributes within the coverage of the isochronous influence domain of rail transit stations, which helps to further study and analyze the development characteristics of rail transit stations.
[0031] 6. The spatio-temporal knowledge graph constructed by the method of the present invention integrates the information of multiple high-quality spatio-temporal data sources, which simultaneously ensures the coverage and credibility of the knowledge within the knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a schematic diagram of the overall framework of the present invention,
[0033] Figure 2 is a schematic diagram of the ontology structure defined in step S1 of the method of the present invention,
[0034] Figure 3 is a schematic diagram of the isochronous influence domain and plots extracted in step S2 of the method of the present invention. Among them, the smaller and larger ranges surrounded by the blue curves respectively represent the five-minute and ten-minute isochronous influence domains of Xinjiekou Subway Station, and the green polygons represent the plots segmented by the road network.
[0035] Figure 4 is an instantiation example of the knowledge graph ontology in the embodiment of the invention. DETAILED DESCRIPTION OF THE INVENTION
[0036] The following further clarifies the present invention in conjunction with the drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and not to limit the scope of the present invention.
[0037] Embodiment
[0038] Taking Nanjing City as an example, a method for constructing a spatio-temporal knowledge graph for rail transit stations is as Figure 1 shown, and includes the following steps:
[0039] Step S1: Define the spatio-temporal knowledge graph ontology of Nanjing Rail Transit stations. The entity types include rail transit stations (stations), isochronous influence areas of rail transit stations (station areas), plots, POIs, and POI categories. The relationship types include: isoIncludeBlock (IIB), which acts between the isochronous influence area and the plot, indicating that there is such a plot within the isochronous influence area of the station; isoIntersectingIso (III), which acts between isochronous influence areas, indicating that these two isochronous influence areas intersect; stationHaveIso (SHI), which acts between the station and the station area, indicating that the station has such an isochronous influence area; locateAtIso (LAI), which acts between the POI and the isochronous influence area, indicating that the POI is located within the isochronous influence area; locateAtBlock (LAB), which acts between the POI and the plot, indicating that the POI is located within the plot; stationLocateAtCity (SLAC), which acts between the station and the city, indicating that the station is located in the city; Type, which acts between the POI and the POI category, indicating which POI category the POI belongs to.
[0040] Step S2: Extract entities from map platforms such as OpenStreetMap and Amap. In this embodiment, the urban entity is Nanjing. The station entities are derived from the poi points with type number 150500 in the Amap open platform, so as to obtain the names and location coordinates of stations such as Xinjiekou Subway Station and Sanshanjie Subway Station. For the station area entities, in this embodiment, the entrances and exits of each subway station and their longitude and latitude are obtained according to the poi points with number 150501 in the Amap open platform, and the mapbox api is called for each entrance and exit of each station to obtain its five-minute / ten-minute walking isochronous circle. In this embodiment, the union of the isochronous circles of each entrance and exit is used as the isochronous influence area of the station. For example, for Xinjiekou Subway Station, in this embodiment, 24 entrances and exits and their longitude and latitude coordinates are obtained through 150501 of the Amap open platform, and then the mapbox api is called on the coordinates of these 24 entrances and exits, the time is set to 5 and 10, and the travel mode is selected as walking, so as to obtain the five-minute / ten-minute walking isochronous circles corresponding to the entrances and exits respectively. The union of the five-minute / ten-minute walking isochronous circles of these 24 entrances and exits is used to obtain the complete five-minute / ten-minute isochronous influence area of Xinjiekou Subway Station. The contour of the five-minute / ten-minute isochronous influence area of Xinjiekou Station is as Figure 3As shown in the figure. For the plot entity, in this embodiment, the road network of the whole Nanjing is first obtained according to OpenStreetMap. Then, for roads of different levels, in this embodiment, buffer sizes are set for roads of different levels in OpenStreetMap according to the specific road conditions in Nanjing to restore the real road width. Specifically, in this embodiment, the buffer for motorway roads is set to 25, the buffer for trunk roads is set to 20, the buffer for primary roads is set to 18, the buffer for secondary roads is set to 15, the buffer for tertiary roads is set to 10, the buffer for residential roads is set to 7, and the buffer for unclassified roads is set to 9. After obtaining the buffers, in this embodiment, the closed figure surrounded by the road buffers is used as the urban plot, and the plots completely covered by the buffers are deleted. The divided plots are as shown in Figure 3 the green area. The POI data and POI categories are sourced from the Amap Open Platform. We obtained the POIs of the whole Nanjing, their categories, and geographical coordinate information through the Amap Open Platform. In this embodiment, the station area, plot, and poi files are all stored in files in the shp format. This format of file can store the geographical information of entities and supports the parsing of multiple gis software (QGIS, Arcmap, etc.) and python.
[0041] Step S3: Construct relationship triples based on the entities obtained in S2. In this embodiment, for the "stationLocateAtCity" relationship, it can be directly obtained during the process of extracting station entities. For example, "Xinjiekou Subway Station in Nanjing City" -- "stationLocateAtCity" -- "Nanjing City". For the "stationHaveIso" relationship, it can be directly obtained during the process of extracting station area entities. For example, "Xinjiekou Subway Station in Nanjing City" -- "stationHaveIso" -- "Nanjing_Xinjiekou Subway Station_5", where the entity "Nanjing_Xinjiekou Subway Station_5" refers to the five-minute walking isochrone influence area of Xinjiekou Subway Station in Nanjing City. For the "Type" relationship, it can be directly obtained during the process of extracting POI and POI category entities. For example, "89f5661c-b577-3033-8871-1c8961e3e13a" -- "Type" -- "Accommodation Service", where 89f5661c-b577-3033-8871-1c8961e3e13a is the unique identifier of this poi entity in Amap, and its corresponding real POI name is "Backpacker Youth Hostel (Xinjiekou Store)". For the "isoIncludeBlock" relationship, in this embodiment, the geopandas library of python is used to respectively judge which plot entities in Nanjing City each station area entity intersects with. If an intersecting plot is found, an "isoIncludeBlock" relationship is constructed between this station area entity and the plot entity. For example, "Nanjing_Xinjiekou Subway Station_10" -- "isoIncludeBlock" — "Nanjing_China_6912", where Nanjing_China_6912 is the unique identifier of the plot entity, referring to the 6912th plot entity of Nanjing City we obtained. For the "isoIntersectingIso" relationship, in this embodiment, the geopandas library of python is used to respectively judge which other station area entities in Nanjing City each station area entity intersects with. If an intersecting station area is found, an "isoIntersectingIso" relationship is constructed between these two station areas. For example, "Nanjing_Xinjiekou Subway Station_10" -- "isoIntersectingIso" -- "Nanjing_Fuqiao Subway Station_10". For the "locateAtIso" relationship, in this embodiment, the geopandas library of python is used to respectively judge which station area entity each POI entity is located in, and an "locateAtIso" relationship is constructed between these two entities. For example, "89f5661c-b577-3033-8871-1c8961e3e13a" -- "locateAtIso" -- "Nanjing_Xinjiekou Subway Station_10".For the "locateAtBlock" relationship, in this embodiment, the geopandas library of Python is used to determine which block entity each POI entity is located in respectively, and the "locateAtBlock" relationship is constructed between these two entities. For example, "89f5661c-b577-3033-8871-1c8961e3e13a" -- "locateAtBlock" -- "Nanjing_China_6912". In this way, this embodiment establishes associations between all entities.
[0042] Step S4: Further extract attribute triples based on the entities obtained in S2. Attributes include direct attributes and indirect attributes. For direct attributes such as names, in this embodiment, they are directly extracted from the entity data. For direct attributes such as plot / area of the station area, in this embodiment, the corresponding shp file is parsed through the geopandas library of Python to obtain them. For the direct attribute of location, in entities such as POIs that can be directly represented by points, their longitude and latitude coordinates are directly used as their location attributes. For geographical entities such as station areas and plots that need to be represented by surfaces, in this embodiment, the geopandas library of Python is used to parse their shp files, and the longitude and latitude coordinates of their boundary points are arranged in counterclockwise order as the location attributes of the geographical entity. For the plot function mixing degree, the calculation method of the present invention is:
[0043]
[0044] where H b represents the function mixing degree of plot b, n refers to the total number of POI categories in the plot, and W i refers to the proportion of the number of the i-th type of POI in the plot to the total number of POIs in the plot. In addition, the POIs in this embodiment have corresponding AOI surfaces. Therefore, this embodiment further calculates the building density attribute for each plot based on the AOI. The calculation formula of the building density is When calculating the building density, it is first necessary to use the Arcmap software to perform a projection operation on the plot and building layers, project the city onto the WGS_1984_UTM_Zone_48N coordinate system, and obtain the plot projection file and the building projection file. After projection, the plot area and the building footprint are respectively counted in the files, and the statistical results are added as attributes to the plot projection file and the building projection file. Subsequently, the plot projection file is connected to the building projection file, and when performing the connection operation, the summary attribute method is selected as "sum", and a transition file is obtained. This file contains the building footprint within each plot range. Based on the building footprint and the plot area in the transition file, the building density of each plot can be obtained according to the calculation formula of the building density. For entities of the station area type, in this embodiment, attributes of road network density type and intersection density are added. When calculating the road network density, first, the total length of the roads within each station area is statistically obtained through spatial join. After that, the Arcmap software is used to perform a projection operation on the layer features and count the road length and the station area. Finally, through calculate the road network density. When calculating the intersection density, in order to count the number of intersections, first, the Arcmap software is used to convert the road network layer into lines to avoid errors caused by discontinuous road features. Subsequently, all the endpoints (including intersection points and dead-end road points) in the road layer are obtained through the operation of converting vertices to points. Then, using the topological function of the Arcmap software, the dead-end road points among the endpoints are found by setting the topological rule "no dangling points". Removing the road endpoints of the dead-end road point part are the intersection points. Finally, through the spatial join operation, the number of two types of intersections in each station area is statistically obtained, and then the corresponding intersection density is calculated. The final calculation method is In this embodiment, entities of the plot type have attributes such as location, area, building density, etc.; entities of the station area type have attributes such as location, area, road network density, intersection density, etc.; entities of the POI type have attributes such as location, name, etc. After this step is completed, this embodiment has obtained the complete triple information. An instantiation example of the knowledge graph ontology in this embodiment is as Figure 4 shown.
[0045] Step S5: In this embodiment, the Neo4j graph database is used to store triples. Specifically, we integrate a file for each type of entity. Each column in the file represents an attribute of the entity, and a file composed of all relationship triples is provided. Then, the entity attribute file and the relationship triple file are imported into the Neo4j graph database together.
[0046] It should be noted that the above embodiments are not used to limit the protection scope of the present invention. Equivalent transformations or substitutions made on the basis of the above technical solutions all fall within the protection scope of the claims of the present invention.
Claims
1. A method for constructing a spatiotemporal knowledge graph for rail transit stations, characterized in that: The steps include: S1, rail transit station ontology definition: Based on the analysis requirements of rail transit stations, define a rail transit ontology structure with entity types and relationships. The entity types include rail transit station, rail transit station isotemporal impact domain, plot, POI, POI category, and the relationship types include isoIncludeBlock, isoIntersectingIso, stationHaveIso, locateAtIso, locateAtBlock, stationLocateAtCity, Type, S2, rail transit station entity extraction: using crawler technology to collect and integrate rail transit stations, rail transit stations, time-influenced domains, plots, POIs, and POI category entity data from OpenStreetMap and Amap multi-source map data, S3, rail transit station relationship extraction: Based on the ontology defined in S1 and the entities extracted in S2, the relationship triples between entities are constructed. For the stationHaveIso, stationLocateAtCity, and Type relationships, the relationships between entities are constructed directly in the process of obtaining the entities. For the isoIncludeBlock, isoIntersectingIso, locateAtIso, and locateAtBlock relationships, the geopandas library of Python is used to determine the geographical associations between entities and to construct relationships between entities. S4, rail transit station entity attribute extraction: further extract direct attributes and indirect attributes for the entities extracted in S2 to form the attribute triples of the entities. Direct attributes include name, location, and area, which are directly obtained from the data source. Indirect attributes include functional mixing degree and building area, which need to be further calculated and obtained by formulas on the existing data. S5, knowledge graph storage: use the Neo4j graph database to store the relationship triples and attribute triples obtained through steps S1-S4.
2. A method for constructing a spatiotemporal knowledge graph for rail transit stations as claimed in claim 1, characterized in that: In step S1, based on the analysis requirements of rail transit stations, entity types are defined, including rail transit stations (stations), rail transit station isochronous influence domains (station domains), plots, POIs, and POI categories. Relationship types include: isoIncludeBlock (IIB), which acts between isochronous influence domains and plots, and expresses that the plot exists within the isochronous influence domain of the station; isoIntersectingIso (III), which acts between isochronous influence domains, and expresses that the two isochronous influence domains are intersecting; stationHaveIso (SHI), which acts between isochronous influence domains, and expresses that the two isochronous influence domains are intersecting; Used between sites and station domains, expressing that the site owns the isochronous influence domain; locateAtIso(LAI), acts between POI and isochronous influence domain, expressing that the POI is located in the isochronous influence domain; locateAtBlock(LAB), acts between POI and land block, expressing that the POI is located in the land block; stationLocateAtCity(SLAC), acts between sites and cities, expressing that the site is located in the city; Type, acts between POI and POI category, expressing which POI category the POI belongs to.
3. A method for constructing a spatiotemporal knowledge graph for rail transit stations as claimed in claim 2, characterized in that: In step S2, six types of entities are extracted, and their meanings and extraction methods are as follows: city (city): the city where the rail transit station is located, which is directly obtained based on the extracted city; rail transit station (station): the rail transit station is the main research object of the constructed knowledge graph. For all cities in China, the geographical locations of the rail transit stations and their entrances and exits in the city are obtained through the AutoNavi open platform; rail transit station isochronous influence domain (station_isochrone), referred to as station domain: the isochronous influence domain (isochrone) aims to explain that what residents are most concerned about is not the distance between their residence and their jobs, but the time it takes to travel between the two places and the accessibility of the target point. For each rail transit station s∈S, the five-minute reachable range and the ten-minute reachable range are used as different research granularities, and i5∈I and i6∈I are defined respectively. 10 ∈I, as the five-minute isochronous influence domain and the ten-minute isochronous influence domain of the rail transit station, where S and I represent the set of station entities and the set of isochronous influence domain entities respectively. For each rail transit station, the isochronous influence domain of mapbox is used to calculate the isochronous influence domain of the rail transit station. The api extracts the five-minute walking isochronous impact domain and the ten-minute walking isochronous impact domain for all entrances and exits of each station, and then takes the union of the five-minute / ten-minute walking isochronous impact domains of each entrance and exit of each station to obtain the complete five-minute / ten-minute walking isochronous impact domain of the station. Repeat this operation for each station in the city until the walking isochronous impact domain of all stations is obtained. Block: The city road network is divided into blocks through OpenStreetMap. Specifically, first use OpenStreetMap to extract the city road network, and then delete the roads with unclear definition or too low level according to the road classification label to avoid over-segmentation. According to the specific situation of the city road, different widths of buffer zones are set for different road categories in OpenStreetMap to restore the actual road width, and then the closed figure surrounded by the road buffer zone is used as the city block and the blocks completely covered by the buffer zone are deleted. POI: Extract all POI data in the city within the rail transit isochronous impact domain and the surrounding blocks. POI category (POI_type): used to describe the category of POI.
4. A method for constructing a spatiotemporal knowledge graph for rail transit stations as claimed in claim 3, characterized in that: In step S3, the method for extracting the relationship triples between entities is as follows: for the "stationHaveIso", "stationLocateAtCity", and "Type" relationships, they are directly constructed in the process of acquiring data; for the "isoIncludeBlock" relationship, the geopandas library of python is used to determine which plot entities each station domain entity has an intersection with; if a plot with an intersection is found, an "isoIncludeBlock" relationship is constructed between the station domain entity and the plot entity; for the "isoIntersectingIso" relationship, the geopandas library of python is used to determine which plot entities each station domain entity has an intersection with; Which other station domain entities in the city have intersections? If station domains with intersections are found, an "isoIntersectingIso" relationship is established between the two station domains. For the "locateAtIso" relationship, the geopandas library of python is used to determine which station domain entity each POI entity is located in, and a "locateAtIso" relationship is established between the two entities. For the "locateAtBlock" relationship, the geopandas library of python is used to determine which plot entity each POI entity is located in, and a "locateAtBlock" relationship is established between the two entities. In this way, associations are established between all entities.
5. A method for constructing a spatiotemporal knowledge graph for rail transit stations as claimed in claim 4, characterized in that: In step S4, the corresponding attribute information is extracted for each entity. The attributes of the entity are divided into direct attributes and indirect attributes. The direct attributes include name, number of station entrances and exits, location, and plot / station area. They are attributes directly extracted from the data source. The indirect attributes are attributes that need to be further calculated based on the existing attributes and are used as analysis functions. For the mixed degree of plot functions, the calculation method is: Among them, H b represents the functional mixing degree of plot b, n refers to the total number of POI categories in the plot, and W i It refers to the ratio of the number of POIs of the i-th category in the plot to the number of all POIs in the plot.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements a method for constructing a spatiotemporal knowledge graph for a rail transit station as described in any one of claims 1 to 5 above.
7. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instruction is executed by the processor, a method for constructing a spatiotemporal knowledge graph for a rail transit station as described in any one of claims 1-5 is implemented.