*Article* **Ontological Ship Behavior Modeling Based on COLREGs for Knowledge Reasoning**

**Shubin Zhong <sup>1</sup> , Yuanqiao Wen 2,3, Yamin Huang 2,3,\* , Xiaodong Cheng 2,3 and Liang Huang 2,3**


**Abstract:** Formal expression of ship behavior is the basis for developing autonomous navigation systems, which supports the scene recognition, the intention inference, and the rule-compliant actions of the systems. The Convention on the International Regulations for Preventing Collisions at Sea (COLREGs) offers experience-based expressions of ship behavior for human beings, helping the humans recognize the scene, infer the intention, and choose rule-compliant actions. However, it is still a challenge to teach a machine to interpret the COLREGs. This paper proposed an ontological ship behavior model based on the COLREGs using knowledge graph techniques, which aims at helping the machine interpret the COLREGs rules. In this paper, the ship is seen as a temporal-spatial object and its behavior is described as the change of object elements in time spatial scales by using Resource Description Framework (RDF), function mapping, and set expression methods. To demonstrate the proposed method, the Narrow Channel article (Rule 9) from COLREGs is introduced, and the ship objects and the ship behavior expression based on Rule 9 are shown. In brief, this paper lays a theoretical foundation for further constructing the ship behavior knowledge graph from COLREGs, which is helpful for the complete machine reasoning of ship behavior knowledge in the future.

**Keywords:** COLREGs; ship object; ship behavior; formal expression

#### **1. Introduction**

Ship behavior refers to the movement of the ship in response to the traffic situation, which usually reflects the intention of the officer on watch (OOW) at present and influences the trajectory of the ship in the future. Hence, the recognition of ship behavior is the key to judging the intention of the OOW and predicting the movement of ships in dangerous encounters, which benefits the safety and efficiency of autonomous navigation and traffic management [1]. From the perspective of traffic management, the vessel traffic service operators (VTSO) need to judge the development of the situation based on the analysis of the ship behavior and identify the near-miss as early as possible; from the perspective of ship navigation, the OOW or intelligent systems need to infer the intention of other ships and predict their trajectories based on the observed ship behavior before taking evasive actions [2]. In brief, to improve the intelligence level of VTS and ships, the study of ship behavior has become an essential topic.

In order to help the machine understands the behavior of the ship based on COLREGs, the techniques from the knowledge graph are introduced and the methodology of ontological ship behavior modeling is developed by using Resource Description Framework (RDF), function mapping, and set expression methods. The concept of ship object and ship behavior described in COLREGs rules are incorporated in the proposed method. The ship is seen as a temporal-spatial object containing attribute elements and relational elements;

**Citation:** Zhong, S.; Wen, Y.; Huang, Y.; Cheng, X.; Huang, L. Ontological Ship Behavior Modeling Based on COLREGs for Knowledge Reasoning. *J. Mar. Sci. Eng.* **2022**, *10*, 203. https://doi.org/10.3390/ jmse10020203

Academic Editor: Dracos Vassalos

Received: 11 January 2022 Accepted: 30 January 2022 Published: 2 February 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

the behavior, then, is described as the changes of the elements in time-spatial scales. Based on these techniques, the proposed method can be used to identify the intentions of the ships and their violation behavior, which has the potential of improving the autonomy level of the ships and decision support system in VTS.

In summary, the main contribution of this paper is developing a knowledge model of ship behavior according to the rules from COLREGs, which could be used to realize ship behavior knowledge expression in the machine. The rest of this paper is organized as follows: the studies on ship behavior modeling are overviewed in Section 2; Section 3 introduces the definitions of ship objects, attribute elements, and relational elements, followed by a conceptual model of ship behavior and the formal expression of ship behaviors according to the COLREGs in Section 4; case studies, discussion, and conclusions are addressed in Sections 5–7, respectively.

#### **2. Literature Review**

Studies on ship behavior modeling fall into the following two categories: data-driven behavior modeling and knowledge-driven behavior modeling. In addition, due to the recent focus on rule-compliant collision avoidance, many researchers studied ship behavior in encounters, which are also overviewed.

#### *2.1. Data-Driven Behavior Modelling*

Data-driven behavior modeling usually utilizes ship trajectory data to learn the ship's behavior. A group of researchers proposed to learn the characteristics of ship behavior from traffic data from a certain region and use the characteristics to predict the trajectory of the ship in the future [3]. Specifically, researchers obtained ship motion trajectories from AIS data [4], analyzed characteristics of trajectory [5], and concluded the distribution of ship state in history that reflects the characteristics of ship behavior [6]. The characteristics of ship behavior, then, are used to predict the trajectories of the ships. Some typical methods to predict the trajectory are Kalman filter [7], Long Short-Term Memory Neural Network (LSTM) [8], Bayesian networks [9], backpropagation neural network (BP) [10], etc.

Some researchers focus on the identification of abnormal behavior of ships by learning historical trajectory data. Patroumpas et al. [11] designed a method to identify the flow of ship events through AIS data, and on this basis, performed cognitive inferences on abnormal behavior of ships. Zouaoui et al. [12] introduced the Hidden Markov model and formal language for analyzing the ship movement data in the harbor to get the normal ship behavior and abnormal ship behavior. Lei et al. [13] proposed the MT-MAD framework, which can automatically detect abnormal behavior based on the evaluation of the ship's historical sub-trajectory data, and defines the ship's activity space, behavior sequence, and behavior characteristics.

Another group of researchers concentrates on ship behavior prediction. Zissis et al. [14] used machine learning, especially artificial neural networks, as a tool to increase the predictive ability of ship behavior. The developed systems can learn and accurately predict in real-time the future behavior of any ship, in a relatively low computing time, which can be used as the basis of prediction for various intelligent systems, e.g., ship collision prevention, ship route planning, ship operation, etc. Perera et al. [15] proposed a ship behavior recognition module in autonomous ships using historical ship trajectory data, which is also used to predict ship trajectory in the future.

In short, the data-driven ship behavior model is usually based on the observed traffic data, e.g., AIS data, etc., which are used to predict the trajectories of ships based on the characteristics of the majority and identify "abnormal behaviors" that are different from the majority. However, it is not easy for these models to infer the behavior of the ship that is rule-compliant or not (i.e., reasoning the knowledge of ship behavior). In particular, the machine lacks knowledge about rule-compliant behavior.

#### *2.2. Knowledge-Driven Behavior Modeling*

Knowledge-driven behavior modeling accepts that the ship cannot move freely but follows certain regulations/rules (i.e., prior knowledge). Thus, researchers intend to gain knowledge of ship behavior from semantic knowledge. Expert systems [16], expression logic [17], semantic network [18], the Resource Description Framework (RDF) [19], ontology [20], etc. are popular methods to construct knowledge and realize knowledge reasoning.

The semantic network is a popular tool to describe ship behavior in recent years. The information loss is inevitable when the researchers use trajectory data only for recognizing ship behavior [21]; thus, some researchers tried to enrich the semantic information of the trajectory. Parent et al. [22] proposed the semantic modeling method and defined the semantic model of the ship trajectory.

In addition, the ontology model of ship behavior becomes popular, which can realize knowledge expression for machines. Nogueira et al. [23] used ontology tools to combine the ship's trajectory motion characteristics, such as velocity and acceleration, to express the ship's trajectory. Lamprecht et al. [24] used the ontology's knowledge organization ability and reasoning function to realize the cognition of the conceptual modeling of ship behavior. Wen et al. [25] introduced a dynamic Bayesian network, combined with a semantic network to carry out dynamic uncertainty reasoning and knowledge expression of ship behavior in port waters. Huang et al. [26] combined machine learning and semantic behavior for pattern recognition. Adibi et al. [27] predicted ship behavior, analyzed and discovered ship behavior at the semantic level, and improved maritime supervisors' understanding of water traffic. However, these semantic models lack consideration of the influence of environmental disturbance and do not fully consider the constraints of COLREGs on ship behavior.

The knowledge-driven approach presents tools to model behaviors for behavior inference. The reasoning process uses techniques such as rule-based systems, case-based reasoning, and ontological reasoning to produce activity models. Knowledge-driven approaches can represent the context of the environments at multiple levels of abstraction to create generalized and personalized behavior modeling. In particular, ontologies have been widely used to represent semantic concepts and their relationships in a structural manner. Advantages of ontologies include the ability to express knowledge in a clearly organized and structured manner, machine-readable expression, and the expressive power to support the reasoning process.

#### *2.3. Behavior Modeling of COLREGs*

To our best knowledge, traditional methods basically considered some key rules from COLREGs and designed the rule-based expert system that helps the machine to recognize the traffic scene and apply certain reaction rules [28].

Some researchers use a question-and-answer method to construct an expert system of ship collision avoidance and give an avoidance plan in the form of question and answer. Others focus on quantifying the COLREGs rules. Many descriptions from COLREGs are ambiguous, vague, and unquantified, which made them difficult for the machine to use in practice. Thus, many researchers proposed quantification methods that quantified the conditions for each encounter [29] (e.g., heading, crossing, and overtaking) and addressed the link between encounters conditions and reaction rules with the help of captains and fuzzy theory [30]. Xu et al. [31] clarified the concepts of "head-on ship", "give-way ship", "overtaking", "crossing" and "heading" according to COLREGs, set up a corresponding reward function for each concept and designed the reward function. In the deep learning algorithm, the optimal collision-avoidance strategy is finally obtained. He et al. [32] put forward the COLREGs quantitative model by combining the ship domain model and the ship heading control system based on the four-stage theory of the ship encounter process. Eriksen H et al. [33] introduced a three-layer hybrid collision-avoidance (COLAV) system for surface unmanned boats, which complies with Articles 8 and 13 to 17 of the COLREGs. The performance of the COLAV system is tested by numerical simulations of three different challenge scenarios (i.e., heading, crossing, and overtaking).

These studies can be used to develop the MASS that follows the rules inputted by developers, but it is challenging to enumerate all the possible scenarios and reaction rules. To develop a practical rule-compliant ship, the developers need to enumerate the scenes that one ship might encounter and design the reaction rules. However, it is almost impossible to address all the scenes one ship might encounter. Thus, adding additional reaction rules become necessary. For example, in a crossing encounter, one ship that is on the portside of another ship is usually seen as a "give-way" ship, whereas if the first ship is a fishing ship, the ship becomes the "stand-on" ship. To handle this exception, additional reaction rules would be needed, which address the special arrangements when the ship encounters fishing ships. However, it is hard to list the endless exceptions.

In this paper, we propose another way to handle this issue. Instead of humans adding patches for exceptions, we proposed the ontological knowledge model helping the machine to deconstruct the conditions and reactions, extract the common concepts, and define the relationships among concepts. With the help of the ontological model, the machine not only can perform the reactions based on the explicit rules but also can infer the implicit rules, i.e., interpretation of rules from COLREGs. It offers a new line of thought to develop a rule-complaint MASS.

#### **3. Conceptual Modeling of Ship Object from COLREGs**

The COLREGs, formulated by the International Maritime Organization (IMO), define different types of ships, different scenes one ship might encounter, and obligations of the ship in these scenes [34]. The ship is the core concept, and the formal expression (i.e., formulaic and structured expression) of the ship object introduced in this section is a prerequisite for the machine to understand the ship behavior described by COLREGs.

#### *3.1. Conceptual Modeling of Ship Object*

Ships usually have many spatiotemporal characteristics, e.g., velocity, course, position, etc., which implies that the ship is a spatiotemporal object. Thus, in this paper, the ship object is defined as Definition 1:

**Definition 1.** *Ship object is a spatiotemporal object with the characteristics in time and space scales, which can be expressed in the form of data, models, rules, logic, or knowledge by computers in cyberspace.*

In general, one ship has many characteristics helping us to distinguish one ship from another ship, and these characteristics are usually named as an "attribute" of the ship. By the type and values of the attributes, one can distinguish the ship from different objects.

Among these attributes, the attributes that describe the characteristics of the ship independent from the surrounding objects, e.g., the ship name, position, velocity, types, etc., are named as "attribute elements" in this paper, whereas other attributes rely on surrounding objects to express its characteristics, e.g., the bearing of objects, relative distance between objects and the relative speed, etc., are named as "relational elements". The formal definitions of attribute elements and relational elements are shown as Definition 2 and Definition 3:

**Definition 2.** *The ship's attribute elements are the expression of the specific characteristics of the ship object that are independent of other objects., e.g., ship name, velocity, course, flag state, etc.*

**Definition 3.** *Ship's relational elements are to describe the association relationship between objects (e.g., ship objects and environment objects), e.g., relative velocity, relative heading, relative location between the ship and the environment or between one ship and another ship, etc.*

In order to facilitate the understanding of the definitions in the paper, we have made Figure 1 to show that the entities (e.g., ships, channels, etc.) in the physical space are extracted and modeled in cyberspace, named as objects. Each object has attribute elements and relational elements that help us distinguish one from another. These elements might vary as time moves on, such as the course, the velocity of ship A, the relative distance, and relative bearing from *ti*−1 to *ti+*1.

**Figure 1.** Abstract schematic diagram of Ship entity.

According to Definitions 1–3, the ship object has attribute elements and relational elements that might vary as time moves on or with the changes of positions. For instance, in an encounter scenario, relational elements (e.g., relative distance) of the ship would change as time moves on; in a curved channel, attribute elements (e.g., course) of the ship will be diverse according to the curvature of the channel. In brief, the values of attribute elements and relational elements have a time or spatial "stamp". Thus, each ship object can be expressed in the form of a triple-element model:

$$\text{shipObject} = \{ \text{Attribute elements}, \text{Relational elements}, \text{Time\\_Space} \} \tag{1}$$

where *shipObject* represents the ship object, *Attribute elements* represents the attribute elements of objects, *Relational elements* represent the relational elements of objects, and *Time\_Space* represents the time and space scales.

Each element of the ship object can be formally expressed by a cell containing "*Type*", "*Value*", and "*t*", named as "*Object.parameter*" and defined as:

$$\text{Object.}\,\text{parameter} = (\text{Type}\_{\text{ti}\,\nu}\,\text{Value}\_{\text{ti}\,\nu}\,\text{t}\_{\text{i}}) \,\text{(}i \in \text{N}^{+}\text{)}\tag{2}$$

where *Object.parameter* represents the smallest unit describing the elements of the specific ship object (say "*Object*"), "*Type*" represents the type of attribute elements or relational elements of the specific ship object; "*Value*" represents the value of the "*Type*", and *t* represents the moment when the "*Type*" has the "*Value*".

Based on these definitions, all characteristics of one object (with attribute elements and relational elements) can be collected in a set of the *Object.Parameter*, i.e.,

$$\text{Object.Parameter} = \left\{ \text{Object. parameter}\_1^{\text{Type}}, \dots, \text{Object. parameter}\_n^{\text{Type}} \right\} \tag{3}$$

where *Type* represents the type of *Object.parameters*, such as velocity, course, relative distance, relative bearing, etc. Additionally, the parameters relating to the attribute elements are collected in *Object.Parameterattribute*, and the parameters relating to the relational elements between *Object* and *Object*<sup>2</sup> are collected in [*Object*1, *Object*2]. *Parameterrelation*. Thus, Equation (3) can be expressed as:

*Object*.*Parameter* = n *Object*.*ParameterAttribute* , . . . , [*Object*1,*Object*<sup>2</sup> i .*ParameterRelation*<sup>o</sup> (4)

The Parameter of object can be expressed as Example 1:

**Example 1.** *Take the scene in Figure 1. as an example. The Parameter of ship A can be expressed as formula as:*

$$\begin{array}{lcl} \mathit{skipA.Parameter} &= \left\{ \mathit{skipA.parameter}\_{3} \mathit{velocity}\_{\prime} [\mathit{skipA.shape}], \mathit{sparname}\_{3} \mathit{distance}\_{3}^{\mathit{distance}} \right\} \\ &= \left\{ \begin{array}{l} (\mathit{velocity}, 10, t\_{i-1}), (\mathit{velocity}, 15, t\_{i}), (\mathit{velocity}, 20, t\_{i+1}), \\ (\mathit{distance}, 5, t\_{i-1}), (\mathit{distance}, 1, t\_{i}), (\mathit{distance}, 4, t\_{i+1}) \end{array} \right\} \end{array} \tag{5}$$

#### *3.2. Expression of Elements of Ship Object*

#### 3.2.1. Attribute Elements

According to COLREGs, the ship object has various attribute elements, and these attribute elements might influence the role of the ship and its obligations in a certain traffic scene. According to the feature of these elements, attribute elements can be categorized into two types, namely static attribute elements and dynamic attribute elements, see Figure 2.

The static attribute elements describe the attributes that are usually relatively invariant, such as ship name, ship type, ship size, etc., while the dynamic attribute elements are the attributes that might change over time, such as the ship's position, heading, velocity, ship's draft, etc.

#### 3.2.2. Relational Elements

According to COLREGs and Definition 2, the ship also has many relational elements; some relational elements, such as the position and relative distance between two ships, can be used to determine the encounter scene of the two ships (overtaking, crossing, and heading scenes). Additionally, the obligation of one ship might change as the relational element changes. For example, when two ships are in a crossing scene, one of the ships has the obligation to give way to the other ship. When the two ships pass by, this obligation is relieved.

The relational elements between objects are categorized into three types, namely, spatial relations, temporal relations, and semantic relations.

(1) Spatial relational elements

The spatial relations among the objects in COLREGs include topological, bearing, and distance relations. The regional link calculus model [35] has been introduced to describe the topological relation between objects, e.g., ship object–ship object, ship object– area object, and area object–area object. The topological relation includes separation, inclusion, intersection, coincidence, inscribed, and circumscribed, which are shown in Figure 3a–f.

**Figure 3.** Topological relations of entity elements contains (**a**–**f**).

According to the statement from the COLREGs, the topological relation between two ship objects includes separation and circumscribe. The topological relation between one ship object and one area object includes the following four types: separation, inclusion, inscribed, circumscribe, and intersection. The topological relation between two area objects includes the following six types: separation, inclusion, inscribed, circumscribed, intersection and coincidence.

The bearing relation mainly describes the relative bearing between two ships. This paper constructs the ship coordinate system, which forms four directional regions by the intersection of the ship's headline and the ship's transverse line. For example, the coordinate system of ship A and ship B is shown in Figure 4. Ship B is in front of the starboard transverse 45◦ of ship A, while ship A is in front of the port side transverse 30◦ of ship B.

**Figure 4.** Bearing relational elements of ship objects.

The distance relation describes the distance between two ship objects, including quantitative expression and qualitative expression.

The quantitative expression refers to the Euclidean distance between two ship objects, as shown in Equation (6).

$$D = \sqrt{\left( (\mathbf{x}\_A - \mathbf{x}\_B)^2 + (y\_A - y\_B)^2 \right)} \tag{6}$$

where *D* represents the distance between ship *A* and ship *B*, (*xA,yA*), (*xB,yB*) represents the position coordinates of ship *A* and ship *B*. According to COLREGs (Rule 7, Rule 8, Rule 13, Rule 15), the relative distance is divided into the following four stages: safety distance, urgent situation, risk of collision, According to COLREGs (Rule 7, Rule 8, Rule 13, Rule 15), the relative distance is divided into the following four stages: safety distance, urgent situation, risk of collision, According to COLREGs (Rule 7, Rule 8, Rule 13, Rule 15), the relative distance is divided into the following four stages: safety distance, urgent situation, risk of collision, and collision. The criteria for dividing these stages are depending on the encounter scenes. According to COLREGs (Rule 7, Rule 8, Rule 13, Rule 15), the relative distance is divided into the following four stages: safety distance, urgent situation, risk of collision, and collision. The criteria for dividing these stages are depending on the encounter scenes. *J. Mar. Sci. Eng.* **2022**, *10*, x FOR PEER REVIEW 8 of 21 where *D* represents distance between *A*and ship (*xA,yA*(represents the position coordinates of ship *A* and ship *B*. According to COLREGs (Rule 7, Rule 8, Rule 13, Rule 15), the relative distance is divided into the following four stages: safety distance, urgent situation, risk of collision, and collision. criteria dividing these stages are depending the scenes.

where *D* represents the distance between ship *A* and ship *B*, (*xA,yA*), (*xB,yB*) represents the

where *D* represents the distance between ship *A* and ship *B*, (*xA,yA*), (*xB,yB*) represents the

where *D* represents the distance between ship *A* and ship *B*, (*xA,yA*), (*xB,yB*) represents the

where *D* represents the distance between ship *A* and ship *B*, (*xA,yA*), (*xB,yB*) represents the

*J. Mar. Sci. Eng.* **2022**, *10*, x FOR PEER REVIEW 8 of 21

*J. Mar. Sci. Eng.* **2022**, *10*, x FOR PEER REVIEW 8 of 21

*J. Mar. Sci. Eng.* **2022**, *10*, x FOR PEER REVIEW 8 of 21

*J. Mar. Sci. Eng.* **2022**, *10*, x FOR PEER REVIEW 8 of 21

position coordinates of ship *A* and ship *B*.

position coordinates of ship *A* and ship *B*.

position coordinates of ship *A* and ship *B*.

position coordinates of ship *A* and ship *B*.

According to COLREGs (Rule 7, Rule 8, Rule 13, Rule 15), the relative distance is divided into the following four stages: safety distance, urgent situation, risk of collision, and collision. The criteria for dividing these stages are depending on the encounter scenes. For the readers interested in the studies on the quantitative analysis of these criteria, the readers are encouraged to see the paper [36]. Although the quantitative analysis of the scenes is not the focus, the qualitative result, i.e., the stage of the encounter, is crucial for the subsequent deduction. Thus, a qualitative expression of the relative distance is introduced: and collision. The criteria for dividing these stages are depending on the encounter scenes. For the readers interested in the studies on the quantitative analysis of these criteria, the readers are encouraged to see the paper [36]. Although the quantitative analysis of the scenes is not the focus, the qualitative result, i.e., the stage of the encounter, is crucial for the subsequent deduction. Thus, a qualitative expression of the relative distance is introduced: safety distance, Dn D ≤ and collision. The criteria for dividing these stages are depending on the encounter scenes. For the readers interested in the studies on the quantitative analysis of these criteria, the readers are encouraged to see the paper [36]. Although the quantitative analysis of the scenes is not the focus, the qualitative result, i.e., the stage of the encounter, is crucial for the subsequent deduction. Thus, a qualitative expression of the relative distance is introduced: safety distance, Dn D ≤ For the readers interested in the studies on the quantitative analysis of these criteria, the readers are encouraged to see the paper [36]. Although the quantitative analysis of the scenes is not the focus, the qualitative result, i.e., the stage of the encounter, is crucial for the subsequent deduction. Thus, a qualitative expression of the relative distance is introduced: safety distance, Dn D ≤ For the readers interested in the studies on the quantitative analysis of these criteria, the readers are encouraged to see the paper [36]. Although the quantitative analysis of the scenes is not the focus, the qualitative result, i.e., the stage of the encounter, is crucial for the subsequent deduction. Thus, a qualitative expression of the relative distance is introduced: safety distance, Dn D ≤ For the interested in on the quantitative of these the readers are encouraged to see the paper [36]. Although the quantitative analysis of the scenes is not the focus, the qualitative result, i.e., the stage of the encounter, is crucial for the subsequent deduction. Thus, a qualitative expression of the relative distance is introduced: safety distance, Dn D ≤

$$Dt = \begin{cases} \text{safety distance,} & Dn \le D \\ \text{urgent situation,} & Dm \le D \le Dn \\ \text{risk of collision,} & Dl \le D \le Dm \\ \text{collision,} & D \le Dm \end{cases} \tag{7}$$
  $\text{area D represents the distance between skin objects, D, is a qualitative expression of } {}^{\mu}D^{\nu}$ 

where *D* represents the distance between ship objects, *D<sup>t</sup>* is a qualitative expression of "*D*", and *Dn*, *Dn, D<sup>l</sup>* are the threshold that defines the distance between ship objects. where *D* represents the distance between ship objects, *Dt* is a qualitative expression of "*D*", and *Dn*, *Dn, Dl* are the threshold that defines the distance between ship objects. where *D* represents the distance between ship objects, *Dt* is a qualitative expression of "*D*", and *Dn*, *Dn, Dl* are the threshold that defines the distance between ship objects. where *D* represents the distance between ship objects, *Dt* is a qualitative expression of "*D*", and *Dn*, *Dn, Dl* are the threshold that defines the distance between ship objects. where *D* represents the distance between ship objects, *Dt* is a qualitative expression of "*D*", and *Dn*, *Dn, Dl* are the threshold that defines the distance between ship objects. "*D*and *DnDn, Dl* the threshold defines the ship objects.

(2) Time relational elements (2) Time relational elements (2) Time relational elements (2) Time relational elements (2) Time relational elements

The time relation is the expression of the ship's behavior and events in the time scales, which usually contain two forms, namely points and periods. The time point describes a specific moment. For instance, the time point when the ship performs a left turn, the time when two ships collide, etc. The time period is a range of time. For instance, when the ship is anchored at the anchorage, the ship passes through the narrow space, the time of the ship in the waterway, etc. The time relation is the expression of the ship's behavior and events in the time scales, which usually contain two forms, namely points and periods. The time point describes a specific moment. For instance, the time point when the ship performs a left turn, the time when two ships collide, etc. The time period is a range of time. For instance, when the ship is anchored at the anchorage, the ship passes through the narrow space, the time of the ship in the waterway, etc. The time relation is the expression of the ship's behavior and events in the time scales, which usually contain two forms, namely points and periods. The time point describes a specific moment. For instance, the time point when the ship performs a left turn, the time when two ships collide, etc. The time period is a range of time. For instance, when the ship is anchored at the anchorage, the ship passes through the narrow space, the time of the ship in the waterway, etc. The time relation is the expression of the ship's behavior and events in the time scales, which usually contain two forms, namely points and periods. The time point describes a specific moment. For instance, the time point when the ship performs a left turn, the time when two ships collide, etc. The time period is a range of time. For instance, when the ship is anchored at the anchorage, the ship passes through the narrow space, the time of the ship in the waterway, etc. The time relation is the expression of the ship's behavior and events in the time scales, which usually contain two forms, namely points and periods. The time point describes a specific moment. For instance, the time point when the ship performs a left turn, the time when two ships collide, etc. The time period is a range of time. For instance, when the ship is anchored at the anchorage, the ship passes through the narrow space, the time of the ship in the waterway, etc. (2)Time relational elements The time relation the of ship's behavior and the time which usually contain two forms, namely points and periods. The time point describes a specific moment. For instance, the time point when the ship performs a left turn, the time when two ships collide, etc. The time period is a range of time. For instance, when the ship is the the ship space, the time of the ship the waterway, In Rule 13 of COLREGs, the definition of the two ships overtaking scene is given as follows: "A vessel shall be deemed to be overtaking when coming up with another vessel

In Rule 13 of COLREGs, the definition of the two ships overtaking scene is given as follows: "A vessel shall be deemed to be overtaking when coming up with another vessel from a direction more than 22.5 degrees abaft her beam, that is, in such a position with reference to the vessel she is overtaking, that at night she would be able to see only the stern light of that vessel but neither of her sidelights." In this rule, there is actually a time relationship. For instance, the overtaking "begins at" the moment of catching up with the previous ship and "ends at" the time when the two ships pass by. In COLREGs, we can conclude the time-related concepts into five types, namely "earlier than", "later than", "between", "beginning at", and "ending at", which can be described by time points or time periods. The details see Table 1. In Rule 13 of COLREGs, the definition of the two ships overtaking scene is given as follows: "A vessel shall be deemed to be overtaking when coming up with another vessel from a direction more than 22.5 degrees abaft her beam, that is, in such a position with reference to the vessel she is overtaking, that at night she would be able to see only the stern light of that vessel but neither of her sidelights." In this rule, there is actually a time relationship. For instance, the overtaking "begins at" the moment of catching up with the previous ship and "ends at" the time when the two ships pass by. In COLREGs, we can conclude the time-related concepts into five types, namely "earlier than", "later than", "between", "beginning at", and "ending at", which can be described by time points or time periods. The details see Table 1. In Rule 13 of COLREGs, the definition of the two ships overtaking scene is given as follows: "A vessel shall be deemed to be overtaking when coming up with another vessel from a direction more than 22.5 degrees abaft her beam, that is, in such a position with reference to the vessel she is overtaking, that at night she would be able to see only the stern light of that vessel but neither of her sidelights." In this rule, there is actually a time relationship. For instance, the overtaking "begins at" the moment of catching up with the previous ship and "ends at" the time when the two ships pass by. In COLREGs, we can conclude the time-related concepts into five types, namely "earlier than", "later than", "between", "beginning at", and "ending at", which can be described by time points or time periods. The details see Table 1. In Rule 13 of COLREGs, the definition of the two ships overtaking scene is given as follows: "A vessel shall be deemed to be overtaking when coming up with another vessel from a direction more than 22.5 degrees abaft her beam, that is, in such a position with reference to the vessel she is overtaking, that at night she would be able to see only the stern light of that vessel but neither of her sidelights." In this rule, there is actually a time relationship. For instance, the overtaking "begins at" the moment of catching up with the previous ship and "ends at" the time when the two ships pass by. In COLREGs, we can conclude the time-related concepts into five types, namely "earlier than", "later than", "between", "beginning at", and "ending at", which can be described by time points or time periods. The details see Table 1. In Rule 13 of COLREGs, the definition of the two ships overtaking scene is given as follows: "A vessel shall be deemed to be overtaking when coming up with another vessel from a direction more than 22.5 degrees abaft her beam, that is, in such a position with reference to the vessel she is overtaking, that at night she would be able to see only the stern light of that vessel but neither of her sidelights." In this rule, there is actually a time relationship. For instance, the overtaking "begins at" the moment of catching up with the previous ship and "ends at" the time when the two ships pass by. In COLREGs, we can conclude the time-related concepts into five types, namely "earlier than", "later than", "between", "beginning at", and "ending at", which can be described by time points or time periods. The details see Table 1. from a direction more than 22.5 degrees abaft her beam, that is, in such a position with reference to the is night she would able see only the stern but neither of sidelights." In this there is actually a time relationship. For instance, the overtaking "begins at" the moment of catching up with the previous ship and "ends at" the time when the two ships pass by. In COLREGs, we can conclude the time-related concepts into five types, namely "earlier than", "later than", "between", "beginning at", and "ending at", which can be described by time points or time The details see Table 1.


**Table 1.** Time relational elements of ship objects in COLREGs. **Table 1.** Time relational elements of ship objects in COLREGs. **Table 1.** Time relational elements of ship objects in COLREGs. **Table 1.** Time relational elements of ship objects in COLREGs. **Table 1.** Time relational elements of ship objects in COLREGs. **Table 1.** elements objects COLREGs.

#### (3) Semantic relational elements (3) Semantic relational elements (3) Semantic relational elements (3) Semantic relational elements (3)relational (3) Semantic relational elements

Semantic relational elements are used to describe the semantic relational elements between ship objects. For example, for the message that the name ship A is "007", there

is a relationship ("hasName") between ship A and "007". We call "hasName" is a semantic relational element, ship A is the domain of the semantic relational element, and "007" is the value range of semantic relational elements. The semantic relationship is described as a triple structure <domain, relation, range> using the Resource Description Framework (RDF).

The COLREGs contain many semantic relations, and some typical semantic relations from COLREGs are concluded in Table 2.


**Table 2.** Time relational elements of ship objects in COLREGs.

#### **4. Conceptual Modeling of Ship Behavior and Its Expression**

Ship behavior is another important concept from the COLREGs. Specifically, COLREGs address the promoted and non-promoted behavior in different traffic scenes with different ship objects. According to Section 3, the ship entity in COLREGs is expressed as a ship object, and its element composition is expressed as attribute elements and relational elements for the machine. Based on that, ship behavior can be defined as the changes of elements in time and space scales, and the formal expression of ship behavior is presented in this section.

#### *4.1. Conceptual Modeling of Ship Behavior*

In general, "behavior" refers to the activities of spatiotemporal objects caused by external influences or internal action. In order to clearly classify and model the behavior of ship objects, and further express and reason about ship behavior, the definition of the ship behavior is introduced as Definition 4:

**Definition 4.** *Ship behavior refers to the change of the ship object's attribute elements and relational elements in time and space scales.*

Based on Definition 4, the ship behavior can be defined as ship behavior can be divided into attribute behavior and relational behavior, the definitions are introduced as Definition 5 and Definition 6 The ship behavior is formulated as:

$$\text{Object.Bhelavior} = \left\{ \text{Behavior}^{\text{Attribute}}, \text{Behavior}^{\text{Relation}} \right\} \tag{8}$$

**Definition 5.** *Ship's attribute behavior refers to the change of ship object attribute information, e.g., ship's position, course, velocity and light type, denoted as BehaviorAttribute .*

**Definition 6.** *Ship's relational behavior refers to changes in ship relational elements over time, including spatial relationships, temporal relationships, semantic relationships, also including the generation, change, and demise of relationships, denoted as BehaviorRelation .*

Similarly to Equation (2), each characteristic of ship behavior (either attribute behavior or relational behavior) can be expressed by a cell, named as "*Behavior.parameter*":

$$Belavior.parameter = (dType, dValue, T)\tag{9}$$

where "*dType*" represents types of changes in specific object elements, "*dValue*" is the amount of change in the value of the same element at different times, the value of "*dValue*"

can be calculated by *Valueti-Valueti*−1, *T* represents the period when the "*dType*" has the "*dValue*", *T* can be represented by [*ti*−1*, t<sup>i</sup>* ].

Similarly to Equation (3), *ObjectBehavior.Parameter* is a set of *Behavior.parameters* that change their values during *T<sup>s</sup>* , which is formulated as:

$$\begin{array}{rcl} \text{ObjectBhavior.Parameter} & = f(\text{Object.Parameter})\\ & = \{ (dType, dValue, \text{T}\_{\sf s}) | dValue \neq \oplus \} \end{array} \tag{10}$$

where *ObjectBehavior.Parameter* represents a set of *Behavior.parameters*, *f*(·) is the function that finds the "*dType*" that "*dValue*" is non-empty from *ti*−<sup>1</sup> to *t<sup>i</sup>* . Then, the *Object.Behavior* can be expressed by the following formula:

$$\begin{array}{l} \text{Object.Behavior} & = \text{g} \, (\text{ObjectBehavior.Parameter}) \\ &= \text{(dType, BehaviorSemantic\_\*)} \end{array} \tag{11}$$

where *g*(·) is the function that input the "*dType*" that has non-empty "*dValue*" and output the semantical meaning of the behavior (*BehaviorSemantic*), see Table 3.

**Table 3.** The semantics of behavior.


The object.Parameter can be expressed as example 2:

**Example 2.** *Take the scene in Figure 1 as an example. The shipA.Parameter is expressed:*

$$\text{shipA.Parameter} = \{ (\text{velocity}, 10, t\_{i-1}), (\text{velocity}, 15, t\_i) \} \tag{12}$$

*according to Equation (11), the behavior of ship A can be expressed as:*

$$\begin{array}{lcl} skipA.Belavior &= \text{g} \left( f(shipA.Parameter) \right) \\ &= \{ (dvelectity, "accelerate", [t\_{i-1}, t\_i]) \} \end{array} \tag{13}$$

*Equation (13) means that the ship A is accelerated from the time ti*−<sup>1</sup> *to t<sup>i</sup> .*

#### *4.2. Formal Expression of Ship Behavior*

Since the machines can only understand characterized, formulaic, and structured knowledge, it is necessary to express the knowledge of ship behavior in the way machines can "read", and such process is named as "formal expression". Thus, the definition of formal expression of ship behavior is shown as Definition 7.

**Definition 7.** *Formal expression of ship behavior is a formulaic and structured expression of ship behavior using methods, such as functions and sets.*

#### 4.2.1. Attribute Behavior

According to Definition 5, attribute behavior is the change of the attribute elements, which include the changes of ship's position, velocity, course, and signal, etc. Some typical attribute behaviors are shown as follows:


Based on Equation (11), the attribute behavior can be formulated as:

$$\text{Object.Behavior}^{Attribute} = \g(f(\text{Object.Parnometer}^{Attribute})) \tag{14}$$

Therefore, it is necessary to input multiple attribute element values at different times for the *<sup>f</sup>*(·) function, and *Object.Parameterattribute* can be formally expressed as:

$$\{Objective.Parameter^{Attribute} = \left\{ (dType\_{l\_j}, dValue\_{l\_j}, t\_j) \right\}, (j \in N^+) \tag{15}$$

where *Object.Parameterattribute* represents the smallest unit describing the attribute elements of the specific ship object, "*Type*" represents the type of attribute elements or relational elements of the specific ship object; "*Value*" represents the value of the "*Type*", *t* represents the moment when the "*Type*" has the "*Value*".

#### 4.2.2. Relational Behavior

In COLREGs, the relational behavior (e.g., variable relative distance and bearing) of ship objects are mainly used to determine the criteria of certain scenes and ships obligations. Some typical relational behaviors are shown as follows:


Based on Equation (12), the relational behavior can be formulated as:

$$\text{Object.Behavior}^{\text{Relation}} = \text{g}(f([\text{Object}\_1.\text{Object}\_2].\text{Parameter}^{\text{Relation}})) \tag{16}$$

It is necessary to input multiple relation element values at different times for the *f*(·) function, the *Object.ParameterRelation* can be formally expressed as:

$$\{\text{Object}\_1, \text{Object}\_2\}. Parameter^{\text{Relation}} = \{\left(dType\_{l\_k}, dValue\_{l\_{k'}}t\_k\right)\}. \left(k \in N^+\right) \tag{17}$$

where [*Object*1*, Object*2] *ParameterRelation* represents the smallest unit describing the relational elements of the specific ship object, "*Type*" represents the type of relational elements of the specific ship object; "*Value*" represents the value of the "*Type*", *t* represents the moment when the "*Type*" has the "*Value*".

#### **5. Case Analysis**

In order to demonstrate the proposed models, Rule 9 (the Narrow Channel clause) from COLREGs is introduced (the content of Rule 9 is shown in the Table A1), and the ontological behavior model based on Rule 9 is used. The Narrow Channel clause (Rule 9) addresses the promoting or non-promoting behavior when the ship object (e.g., *Oship*\_*in*) enters, leaves, and navigates in a narrow channel.

#### *5.1. Ontological Expression of Ship Object Based on Rule 9*

By analyzing the text information from Rule 9, there are two types of objects, namely the ship object and the waterway object, specifically, sailboats, ships less than 20 m in length, vessels engaged in fishing, narrow channel, etc., that are shown in Table 4.


**Table 4.** Objects under the Narrow Channel clause.

For the ship object, the attribute elements contain static attributes and dynamic attributes, which are listed in Table 5.

**Table 5.** Attribute elements between water traffic objects in the Narrow Channel clause.



For the waterway object, the attribute elements also include static attributes and dynamic attributes, which are shown in Table 5.


According to Section 3.2.2, the relational elements among these objects (ships and the waterway) can be analyzed from the following three aspects: time, space, and semantic. Table 6 lists different objects, the relationships between objects, and the semantic expressions of the relationships.


**Table 6.** Relational elements of objects in the Narrow Channel clause.


#### *5.2. Formal Expression of Ship Behavior Based on Rule 9*

The text information of Rule 9 addresses the attribute and relational elements of objects. Table 7 lists the attribute elements of one ship at different moments in time. By comparing the attribute elements at different moments, the ship's attribute behavior is inferred, and the attribute behavior is concluded in the last column of the table. Based on Table 7, the machine can reason about the behavior of the ship by analyzing or comparing the values of position, velocity, heading, and other ship attributes in a narrow channel at different moments. Specifically, the machine can judge whether the ship has moved, accelerated, decelerated, and turned in the period between the two moments.


**Table 7.** Relational elements of objects in the Narrow Channel clause.

Table 8 lists the relational elements of one ship w.r.t. other objects (i.e., the ship and the waterway). By comparing the relational elements at different moments, the ship's relational behavior is inferred, and the relational behavior is expressed semantically. Based on Table 8, the machine can reason about the behavior of the ship by analyzing the topological relationship, and the spatial topological behaviors including sailing in, sailing out, and crossing can be inferred. By analyzing the spatial bearing relationship and spatial distance relationship between ships, the pursuit and crossing behavior between ships in the narrow channel can be inferred.

**Table 8.** Ship relational behaviors in the Narrow Channel clause.


#### *5.3. Reasoning Based on the Proposed Method*

Based on the above formal expression of the behavior of ships in the narrow channel terms of COLREGs, a formal expression of ship behavior can be applied in conjunction with AIS data and nautical chart data.

In Figure 5, we introduce a scene where two ships encountered in a narrow channel. Ship B is navigating in the starboard channel and move towards the north; Ship A is navigating in the port channel and move towards the south.

**Figure 5.** Application of formal expression of ship behavior in narrow channel scenarios.

By analyzing the changes of the attribute elements and relational elements of ship A and ship B at the moments of time *t*1,*t*2*,* and *t*3, and expressing the attribute behavior and relational behavior of the ships formally in this way, the machine can finally judge whether the ship behavior complies with the COLREGs.

According to the above research on the expression of ship objects and ship behavior, the attribute elements, relational elements of ship objects, and the ship's attribute behavior and relational behavior can be expressed as follows:

(a) The expression of the attribute elements of the *ship A*

*shipA.parameterAttribute* = n *shipA.parametervelocity* ,*shipA.parametercourse*<sup>o</sup> = (*velocity*, 10, *t*1),(*velocity*, 15, *t*2),(*velocity*, 20, *t*3), (*course*, 220, *t*1),(*course*, 220, *t*2),(*course*, 150, *t*3) (18)

(b) The expression of the attribute elements of the *ship B*

$$\begin{aligned} \text{shipB.parameter}^{\text{Attribute}} &= \left\{ \text{shipB.parameter}^{\text{velocity}}, \text{shipB.parameter}^{\text{course}} \right\} \\ &= \left\{ \begin{array}{l} (\text{velocity}, 18, t\_1), (\text{velocity}, 0, t\_2), (\text{velocity}, 0, t\_3), \\ (\text{course}, 60, t\_1), (\text{course}, 60, t\_2), (\text{course}, 60, t\_3) \end{array} \right\} \end{aligned} \tag{19}$$

(c) The expression of the relational elements between *ship A* and *ship B*

$$\begin{aligned} \{ \text{skipA}, \text{skipB} \} \color[rgb]{1.0pt}{\$\text{skipA}\$} \{ \text{Parameter}^{\text{Rultation}} \color[rgb]{1.0pt}{\$\text{skipB}\$}} \{ \text{skipA}, \text{skipB} \} \color[rgb]{1.0pt}{\$\text{skipB}\$} \{ \text{skipB}\$} \{ \text{Parameter}^{\text{distance}} \} \\ = \left\{ \begin{array}{l} [\text{skipA}, \text{skipB}]. \text{Parameter}^{\text{buring}} \\ (\text{distance}, \text{18.t}\_1), (\text{distance}, \text{10.t2}\_2), (\text{distance}, \text{3}, \text{t3}\_3), \\ (\text{bearing}, \text{050}, \text{t1}\_1), (\text{baring}, \text{030}, \text{t2}\_2), (\text{baring}, \text{230}, \text{t3}\_3) \end{array} \} \end{aligned} \right\} \tag{20}$$

#### (d) The expression of the relational elements between *ship A* and Narrow channel

[*shipA*,*ONC*].*ParameterRelation* = n [*shipA*,*ONC*].*ParameterTopolopy*<sup>o</sup> = {(*Topolopy*, −1, *t*1),(*Topolopy*, 1, *t*2),(*Topolopy*, 1, *t*3)} (21)

#### (e) The expression of the relational elements between *ship B* and Narrow channel

$$\begin{array}{ll} \{ \text{skipB}, \text{O}\_{\text{N}\mathbb{C}} \}. \text{Parameter}^{\text{Relation}} &= \left\{ \begin{bmatrix} \text{skipB}, \text{O}\_{\text{N}\mathbb{C}} \end{bmatrix}. \text{Parameter}^{\text{Topology}} \right\} \\ &= \{ \text{(Topology}, \text{1}, t\_{1}), (\text{Topology}, \text{1}, t\_{2}), (\text{Topology}, \text{1}, t\_{3}) \} \end{array} \tag{22}$$

#### (f) The expression of the attribute behavior of *ship A*

$$\begin{aligned} \mathit{shipA.Belauiv} \mathit{orthribute} &= \mathit{g}(f(\mathit{shipA.Parmate}^{\mathit{Attribute}})) \\ &= \left\{ \begin{array}{l} (\mathit{dvelectity}, \mathit{"acelerate"}, [t\_1, t\_2]), \\ (\mathit{dvelectity}, \mathit{"deelerate"}, [t\_2, t\_3]), \\ (\mathit{dcourse}, \mathit{"keep\ curve"}, [t\_1, t\_2]), \\ (\mathit{dcourse}, \mathit{"turr\ star} \mathit{standor\}", [t\_2, t\_3]) \end{array} \right\} \end{aligned} \tag{23}$$

According to the changes of the velocity and course of *ship A*, the semantics of the ship behaviors are expressed as "*accelerate*" and "*keep course*" from the time *t*<sup>1</sup> to *t*2, "decel*erate*" and "*turn starboard*" from the time *t*<sup>2</sup> to *t*3. From time *t*<sup>2</sup> to *t*3, the course of *ship A* is perpendicular to the total flow direction of the narrow channel, which means a spatial topological behavior of "*crossing*" between *ship A* and the narrow channel. Therefore, it violates the COLREGs rule that "Ships should avoid crossing narrow channel".

#### (g) The expression of the attribute behavior of *ship B*

$$\begin{aligned} \mathit{shipB.Behavior}^{\mathit{Attribute}} &= \mathit{g}(f(\mathit{shipB.Parmate}^{\mathit{Attribute}})) \\ &= \left\{ \begin{array}{l} (\mathit{dvelectity}\_{\mathit{"{e}lderierate"}}, [t\_{1}, t\_{2}]), \\ (\mathit{dvelectity}\_{\mathit{"{e}lderierate"}}, [t\_{2}, t\_{3}]), \\ (\mathit{dcourse}\_{\mathit{"{e}lderierare"}}, [t\_{1}, t\_{2}]), \\ (\mathit{dcourse}\_{\mathit{"{e}lderierare"}}, [t\_{2}, t\_{3}]) \end{array} \right\} \end{aligned} \tag{24}$$

According to the changes of the velocity and course of *ship B*, the semantics of the ship behaviors are expressed as "*decelerate*" and "*keep course*" from the time *t*<sup>1</sup> to *t*2, "*keep velocity*" and "*keep course*" from the time *t*<sup>2</sup> to *t*3. *Ship B* is "*anchored*" in the narrow channel from the time *t*<sup>2</sup> to *t*3. Therefore, it violated the COLREGs stipulation that "ships should avoid anchoring in the narrow channel".

(h) The expression of the relational behavior of *ship A* and *ship B*

$$\begin{aligned} \{ \text{shipA}, \text{shipB} \} . \text{Behario} \, ^{\text{Relation}} \quad &= g(f(\{ \text{shipA}, \text{shipB} \} . \text{Parameter} \, ^{\text{Relation}})) \\ &= \begin{cases} (\text{ddistance}, \text{"near"}, [t\_1, t\_2]), \\ (\text{ddistance}, \text{"near"}, [t\_2, t\_3]), \\ (\text{deancing}, \text{" move to } \text{bow"}, [t\_1, t\_2]), \\ (\text{deaving}, \text{"move to } \text{bow"}, [t\_2, t\_3]) \end{cases} \end{aligned} \tag{25}$$

According to the changes of the relative distance and relative bearing between *ship A* and *ship B*, the semantics of the ship behaviors are expressed as "*near*" and "*move to bow*" from the time *t*<sup>1</sup> to *t*2, "*far away*" and "*move to stern*" from the time *t*<sup>2</sup> to *t*3.

(i) The expression of the relational behavior of *ship A* and Narrow channel

$$\begin{aligned} [\text{skipA}, \text{O}\_{\text{NC}}].\text{Behavor}^{\text{Relation}} &= \text{g}(f([\text{skipA}, \text{O}\_{\text{NC}}].\text{Parameter}^{\text{topology}})) \\ &= \left\{ \begin{array}{l} (\text{topology}, \text{"sailing in"}, [t\_1, t\_2]), \\ (\text{topology}, \text{"keep topology"}, [t\_2, t\_3]) \end{array} \right\} \end{aligned} \tag{26}$$

According to the changes of the topology relation between *ship A* and the narrow channel, the semantics of the ship behaviors are expressed as "*sailing in*" from the time *t*<sup>1</sup> to *t*2, "*keep topology*" in the narrow channel from the time *t*<sup>2</sup> to *t*3.

(j) The expression of the relational behavior of *ship B* and Narrow channel

$$\begin{aligned} \{ \text{skipB}, \text{O}\_{\text{NC}} \}, & \text{Behavor}^{\text{Relation}} &= \text{g} \left( f([\text{skipB}, \text{O}\_{\text{NC}}].\text{Parameter}^{\text{topology}}) \right) \\ &= \left\{ \begin{array}{l} (\text{topology}, \text{"keep topology"}, [\text{t}\_{1}, \text{t}\_{2}]), \\ (\text{topology}, \text{"keep topology"}, [\text{t}\_{2}, \text{t}\_{3}]) \end{array} \right\} \end{aligned} \tag{27}$$

According to the changes of the topology relation between *ship B* and the narrow channel, the semantics of the ship behaviors are expressed as "*keep topology*" in the narrow channel from the time *t*<sup>1</sup> to *t*2, "*keep topology*" in the narrow channel from the time *t*<sup>2</sup> to *t*3.

According to the above-mentioned expression of the attribute behavior of *ship A* and *ship B*, and the relational behavior between *ship A* and *ship B*, *ship A* and the narrow channel, and *ship B* and the narrow channel at the time from *t*<sup>1</sup> to *t*3. Based on these expressions, we can clearly judge whether the ship behavior complies with COLREGs, see Table 9.




**Table 9.** *Cont.*

#### **6. Discussion**

With the development of knowledge engineering, knowledge expression has been widely explored and utilized in multiple knowledge-driven tasks, which significantly improves their performance. In this section, we first give a summary of this research then summarize the advantages and disadvantages of the method of this research.

#### *6.1. Discussion on Case Study*

In this paper, we provide a broad overview of currently available techniques, including RDF, function mapping, and set expression methods. The proposed method imitates human understanding ability, which makes it possible to incorporate prior knowledge to assist machine recognizing.

In Section 3, we abstractly express the ship objects in COLREGs as attribute elements and relationship elements, and in Section 4, we express the dynamic changes of the ship object's attribute elements and relationship elements over time as ship behavior. The expression method through RDF, function and collection is similar to human thinking, which is more in line with our COLREGs ship behavior ontology knowledge modeling. Based on the ship behavior ontology method in Sections 3 and 4, we use COLREGs (Rule 9) for example verification in Section 5, and the results show that our method can formally express the ship behavior of COLREGs.

However, this research is only the initial work for realizing ship behavior knowledge reasoning to the machine. Based on this research, in the future, the ship behavior knowledge graph, COLREGs knowledge graph, and the knowledge graph of water traffic scene can be further constructed to realize the autonomous recognition of water traffic scenes, judge water Traffic situation, reason about the violations of COLREGs by ships, and support decision making of MASS.

#### *6.2. Advantages and Disadvantages of the Proposed Method*

#### (1) Advantages of this method

In this paper, the ship behavior, based on COLREGs, is modeled as the change of entity elements in time and space scales by using RDF, function mapping, and set expression methods. The advantages of this method are as follows: first, it can capture hidden semantic information in COLREGs; second, it can improve the accuracy of knowledge recognizing significantly; finally, it can simulate human recognizing ability, which makes it possible to incorporate prior knowledge to assist in recognizing.

#### (2) Disadvantages of this method

On the basis of Sections 3–5, we realize the formal expression of the ship behavior ontology model in COLREGs, but the ontology model still has some deficiencies. The knowledge model of ship behavior established in this paper is still in the enlightenment stage in the maritime industry, which has not yet formed a unified industry standard. Its disadvantage is that it has not solved a series of problems such as dependence on domain experts and poor generalization ability. On the one hand, this method requires manual modeling of ship behavior knowledge, and its modeling efficiency is low. On the other hand, semantic calculation and reasoning methods are still missing.

#### *6.3. Future Work*

The formal expression of ship behavior is the basis for developing autonomous navigation systems that support the scene cognition, the intention inference, and the rulecompliant actions of the systems. This paper studies the formal expression of ship behavior based on COLREGs. However, there is still a certain distance for the machine to truly realize the autonomous recognition of the navigation scene, the autonomous reasoning of the ship's intention, and the autonomous judgment of the ship's behavior in compliance with the COLREGs rules. Based on the research in this paper, we give several directions for future research, as follows:

#### (1) Constructing the ontology of ship behavior

Ontology plays an important role in enriching the semantic information of things and realizing knowledge sharing. Based on the formal expression of ship objects and ship behavior in this paper, the ship behavior ontology is further constructed to form a knowledge base with semantic information, and the custom SWRL rules are input into the ontology inference engine to realize the machine's autonomous cognition of ship behavior.

#### (2) Constructing the ontology of traffic scene

COLREGs are the norms of ship behavior in different traffic scenarios. According to different traffic scenarios, ships should take corresponding behaviors, the traffic scene ontology is constructed based on COLREGs. The custom SWRL rules are input into the ontology inference engine to realize the machine's autonomous cognition of traffic scenarios.

#### (3) Constructing the knowledge graph of ship behavior

Based on the formal expression of ship behavior in this article, and the ship behavior ontology and traffic scene ontology constructed in future research, the knowledge graph of ship behavior can be further constructed in the future. Then, the machine can be queried, and it can be inferred that the actions whether the acctions are COLREGs-compliant or not in different scenarios.

#### **7. Conclusions**

For developing rule-compliant maritime autonomous surface ships (MASS), understanding the Convention on the International Regulation for the preventing Collision at Sea (COLREGs) is the foundation for the machine. The existing expert systems for MASS did not teach the machine to understand the COLREGs rules but list condition-and-reaction rules for endless exceptions. To handle this issue, this paper proposed an ontological method to model the ship behavior and try to build the first step to help the machine to interpret the COLREGs in a manner of humans.

The attributes of the ship are categorized into "attribute elements" and "relational elements", and the ship behaviors then are defined as the changes on "attribute elements" (i.e., attribute behavior) and "relational elements" (i.e., relational behavior). Based on these definitions, the attribute elements, relational elements, attribute behavior, and relational behavior are formally expressed by using the Resource Description Framework (RDF), function mapping, and set expression methods. By introducing Rule 9 from COLREGs, this paper demonstrates the performance of the proposed method, which has laid a theoretical foundation for structural modeling and semantic understanding of ship behavior.

The proposed method addressed a novel way to develop the rule-compliant machine, which is promising in the development of MASS. This paper is the first step for the rulecompliant MASS, and the proposed model is still at the conceptual and logical levels. Thus, it is necessary to construct the ship behavior ontology further, construct the knowledge model driven by the ship behavior, and use it in actual cases in the future.

**Author Contributions:** Conceptualization, S.Z. and Y.W.; methodology, Y.H.; software, X.C.; validation, S.Z., Y.H. and L.H.; formal analysis, S.Z.; resources, Y.H.; writing—original draft preparation, S.Z. and Y.H.; writing—review and editing, S.Z. and Y.H.; funding acquisition, Y.H. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported by the Key R&D Program of Zhejiang Province China through Grant No. 2021C01010, the National Natural Science Foundation of China (NSFC) through Grant No. 52072287 and 52001241, and "the Fundamental Research Funds for the Central Universities (WUT: 2021IVA106)".

**Institutional Review Board Statement:** No applicable.

**Informed Consent Statement:** No applicable.

**Data Availability Statement:** No applicable.

**Conflicts of Interest:** The authors declare no conflict of interest and the funders had no role in the design of the study, in the collection, analyses, or interpretation of data, in the writing of the manuscript, or in the decision to publish the results.

#### **Appendix A**

**Table A1.** Narrow Channel Provisions Text Information.
