# Dataset Construction through Ontology-Based Data Requirements Analysis
## 3 Ontology-Based Approach to Data Requirements Analysis
### Ontology-Based Domain Model  
The behavior of ML systems is closely related to domain knowledge and data. Therefore, specific data requirements can only be determined after modeling domain knowledge. Ontology is a domain modeling method we used, it can structure domain knowledge represented in natural language into a series of symbols to provide  
Nodes of _entity_ denoted as \(E_{O}\), represent the physical entities in the real world. Each element \(e\) has only an outdegree and no indegree in the domain model and has at least one edge labeled as _has_ started with itself. Mathematically, _entity_ nodes need to satisfy the following expression:  
\[\forall e(deg^{+}(e)=0\wedge deg^{-}(e)\geq 1) \tag{1}\]  
where \(deg^{+}(n)\) represents the indegree of node, and \(deg^{-}(n)\) represents the outdegree of node. The node _trafficSign_ shown in Figure 2 is directly related to the nodes _position_, _shape_ and _color_ with edges labeled by _has_, while \(deg^{+}(trafficSign)=0\) and \(deg^{-}(trafficSign)=3\). In addition to the node of _trafficSign_, all of the nodes include _pedestrian_, _trafficLight_, _Tree_, _Vehicle_ and _Environment_ in the domain model satisfy the expression provided. The _relation_ nodes represent the relations between two entities, which can be denoted as \(R_{O}\) in the domain model, _relation_ nodes are a list of nodes, each of which has more than one edge labeled as _has_ ended with itself and multiple edges labeled as _is_ starting from itself, each relation ontology node \(r\) in \(R_{O}\) is connected to two _entity_ nodes through two edges and should satisfy the expression as follows:  
\[\forall r(r\in\varphi(c,has)\wedge deg^{+}(r)>1\wedge deg^{-}(r)\geq 1) \tag{2}\]  
where \(c\) represents an element of \(C\). There are two _relation_ nodes shown in the domain model including _position_ and _do_. The indegree of both are more than one and the outdegree of both are at least one. For example, there exist several edges labeled by _has_ among five different _entity_ nodes including _pedestrian_, _trafficLight_, _Tree_, _Vehicle_ and _trafficSign_, which leads to the indegree being more than one. There also exist two edges labeled by _is_ among node _position_, node _behind_ and node _under_. The attribute nodes represent the features of a physical entity which can be denoted as \(A_{O}\) in the domain model, each of which has only an edge labeled as _has_ starting from itself and multiple edges labeled as _is_ ending with itself, an entity node is linked to several attribute nodes. Each attribute node has several mutually exclusive value nodes \(V_{O}\); the value node represents the value of the elements, which has an edge labeled as _is_ started  
Figure 2: Part of the ontology-based domain model towards traffic scene. from an attribute node or a relation node. Mathematically, the attribute nodes and value nodes should satisfy the expression as follows:  
\[ \begin{split}&\forall a(a\in\varphi(c,has)\wedge deg^{+}(a)=1 \wedge deg^{-}(a)\geq 1),\\ &\forall v(v\in\varphi(c,is)\wedge deg^{+}(v)=1\wedge deg^{-}(v)= 0).\end{split}  \tag{3}\]  
just as in Figure 2, the entity node _trafficSign_ is linked with attribute nodes _color_, _content_ and _shape_, which are the attributes of _trafficSign_. For attribute node _shape_, there exist value nodes _circle_ and _square_ linked with it. The relation node _position_ is linked with the value nodes _under_ and _behind_. It is important to note that the examples shown in the figure cannot fully explain the complete road traffic scene. We have simplified the entities, attributes, and values for the convenience of explaining the criteria we propose and the data requirements generated from them. The strength of relationships between concepts in domain knowledge is an important factor to consider in requirements analysis. Entities that are closer to the current entity have a greater influence on the current entity, while entities that are further in relation have less impact on the prediction of the current entity.