“Jeju Island is the largest volcanic island in Korea. Officially called Jeju Special Self-Governing Province, this premier tourist destination boasts mild weather, as well as scenic beauties of beaches, waterfalls, cliffs and caves.” 1.)
According to WRFPM, Jeju is the biggest island in Korea(1845. 9km²), similar to the size Maui, with a population of 646,547 residents. Every year, over 13 million tourist visit the island. Jeju has recently won the Global Geopark certificate, and also has been selected as the New 7 Wonders of Nature. 1.)
Using the transportation data 2.) from the Island of Jeju, a relational database (RDB) and graph database (GDB) model will be employed. The transportation data link can be found at the reference. The Jeju transportation data includes information such as bus stations, bus service routes and bus route numbers.
Chart 1. Jeju Public Transportation 3.)
Problem : Bus routes are currently NOT optimized.
Solution : Employ Hybrid Database to optimize bus routes.
The relational database can create bus routes; however, the routes may not optimized. Using graph database helps to optimize the bus routes due to flexibility and visibility. Moreover, the hybrid model of using both relational model and graph model will optimize the bus routes completely.
You can search bus service routes as storing bus information in the database. You also can find optimized route guide service if you assign departure/arrival bus stations or locations.
To search for a bus service route, using a relational database may be able to accomplish the task, but it could be more complex to figure out the optimal route from departure to arrival because relational database does not support transferring system. To implement this modeling in RDB, Additional work may be required to support the optimized route guide service.
Using a graph database would be a much more elegant solution to finding the optimized route. You would store all information such as bus color, bus model, bus type (Local/Intercity) and bus plate information in each vertex of the Graph.
If you can store transportation information in AgensGraph, which is multi-model and supports both RDB and GDB you can make up for the shortcomings of Relational Database Management System (RDBMS) utilize both Graph Database Management System (GDBMS) and RDBMS.
Therefore, we will introduce data modeling for Jeju transportation as storing data in a multi-model graph database.
The information for station, route and bus are stored as STATION.csv, ROUTE.csv, BUS.csv in a row.
Each file has a header named special features.
The model is different depending on the purpose. There are three purposes in the project:
- Finding the optimized route from departure station to arrival station.
- Storing unique information for each bus
- Searching a route for each bus to travel
Using graph database, it is convenient to find an optimized route from the departure station to the arrival station thanks to its graph traversal performance. To satisfy the purposes mentioned above, we put station information on the vertex and generate edges between stations. This task has been applied to every bus in the database. In the vertex that has station information, we stored the station name, latitude, longitude and unique id for each station as a property. In the edge which is connecting each station, we stored the bus number, bus sub-number (some buses with same number have different route by time schedule in Jeju and the sub-number distinguishes them), Route ID and the distance between each station as a property.
The unique information for each bus is used to separate whether they are local or intercity. Since this information is not relationship focused, we can store them in table format using RDB.
Searching a travel route for each bus can be done by either GDB or RDB without any problems.
Based on the purpose, we determined how we can handle raw data in GDB and RDB. AgensGraph supports CSV file importing in the format of table first and then extracts data needed data as graph format and generates it as graph format. Therefore, in our project, we applied modeling No. 1 one to graph format (GDB) and modeling No. 2 to table format(RDB). Lastly, we can apply modeling No.3 to either table (RDB) or graph format (GDB).
Pictured below is a table generated by a CSV file. It shows how to transfer to graph data from table data. We can do the naming / generating / data insertion work using CSV filenames and transferring from table data to graph data. We can see the data that is transferred from table to graph data based on the color mapping.
We generated vertexes using data from STATION table and edges using data from ROUTE and BUS table.
Graph consists of vertexes which has a VLabel called STATION and Edge which is connecting between vertexes. In this case, the name of ELabel is ROUTE. STATIONID, STATIONNM, LOCALX and LOCALSTATION data in the column of vertex table format are stored as the property of vertex in graph format.
We can find one vertex that is the starting point of the edge and another vertex that is the ending point of edge using STATIONORD, STATIONID data in the column of ROUTE table. Edge is generated as setting up ROUTEID column as the property of Edge. ROUTEDIST column is also set up as the property of edge. ROUTEDIST displays the distance between station and the weight of edge also could be used for the same feature.
Lastly, ROUTENUM and ROUTENM columns are added to the property of the edge as finding proper edge using ROUTEID data in the column of BUS table.
In the next blog, we are going to cover how to generate graph modeling in real time following the description we explained in this blog. We will also focus on Cypher, SQL Query.
1.) “Discover Jeju Island, Korea“. (http://wrfpm2017.org/about/. WRFPM 2017 Secretariat
2.) Jeju Island Transportation Data. Retrieved on 6/6/2017 :
3.) Chart 2. Jeju Island Transportation :
비트나인, 그래프 데이터베이스 전문 기업