## 3 Case Study
### Extraction of Ship Behavior Characteristics Graph  
To extract the key waypoints, the key waypoints of ship navigation lanes were determined for each ship trajectory using the DP algorithm (see Figure 3 and Table 2 for the theoretical concept). Taking the \"Xinhong 998\" ship as an example, the historical trajectory of the ship for a certain period of time was first obtained from the MySQL database. Due to the dense trajectory, it is not convenient to perform data analysis. Therefore, the DP algorithm was used to optimize the ship's historical trajectory. The following figure shows the optimization effect of the ship's trajectory under different threshold conditions. As part of this process, sub-line segments were extracted using the DP algorithm with \(\varepsilon=0.0025\) (see Figure 12). For each ship trajectory, the K-means algorithm is used to cluster and analyze whether the ship has multiple abnormal trajectories (theoretical concepts are shown in Figure 8 and Table 3). In order to determine whether the \"Xinhong 998\" ship has multiple trajectory features, the K-means algorithm is used to cluster and analyze the optimized ship's historical trajectory, quickly identifying the multiple trajectory features of the ship. As shown in Figure 13, two types of trajectories can be found during the same period of the ship, indicating the existence of multiple trajectory features. Based on Mysql and neo4j fusion calculation, the K-means clustering algorithm is used to identify multiple abnormal features of ship trajectory in the study area, and the acquired features are added into the ship behavior feature graph; based on specific ship ontology, the fusion calculation (subgraph inference, Mysql aggregation, and correlation query) is used to obtain ship data with abnormal features such as key monitored ships, expired ship certificate, inconsistent ship trajectory and reported port, etc., and the feature information is improved into the ship behavior feature graph. The ship data with abnormal features, such as ship certificate expired, ship trajectory inconsistent with reported port, ship not reported  
Figure 12: Key waypoints determination using DP algorithm with the various threshold parameters. port for a long time, etc., are obtained through fusion calculation (subgraph inference, Mysql aggregation, and correlation query) to form a complete ship behavior feature graph. The calculation process is shown in Table 4.  
The subgraph search based on ship knowledge graph can quickly extract static features of ships, such as basic information of ships (including MMSI, ship name, ship type), validity of ship certificate, whether the ship is focused on tracking and the reasons for tracking, etc., and add them to the static feature graph of ship behavior; combined with dynamic port reporting information and ship AIS information, it can extract dynamic features of ships that combine motion and static, and realize the full domain mastery. By analyzing  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**No. ** & **Features** & **Calculation Methods** & **Procedures** \\ \hline \multirow{2}{*}{1} & \multirow{2}{*}{Multiple ship tracks} & K-means multiple trajectory clustering & 1. Calculate the ship history trajectory; 2. Obtain the number of ship multiple trajectories by K-means multiple trajectory clustering method. \\ \hline \multirow{2}{*}{2} & \multirow{2}{*}{\ \begin{tabular}{c} Maritime key \\ monitoring ships \\ \end{tabular}  } & \multirow{2}{*}{Subgraph inference} & 1. Mysql retrieves data on ships that have been classified as maritime priority monitoring; 2. neo4 queries and identifies ship entities on the retrieved result data. \\ \hline \multirow{2}{*}{3} & \multirow{2}{*}{ \begin{tabular}{c} Ships with expired \\ certificates \\ \end{tabular}  } & \multirow{2}{*}{Subgraph inference} & 1.