# Dataset Construction through Ontology-Based Data Requirements Analysis
## 3 Ontology-Based Approach to Data Requirements Analysis
### Criteria-Based Data Requirements Specification  
Data requirements are a series of conditions that a dataset needs to satisfy. They serve as the standard for validating the dataset and a guide for establishing the dataset. Given a set of data requirements _Req_ derived from criteria provided subsequently, these requirements can offer standards to cover crucial elements when we collect datasets. To facilitate future automated comparison operations, we can build the dataset \(D\) by satisfying the condition specified as follows:  
\[\forall req\in Req,\ \exists d\in D(d\doteq req) \tag{6}\]  
where \(\doteq\) means that the data should satisfy the given data requirements. The generation of data requirements requires consideration of many factors. The behavior of a ML system is influenced by the characteristics of entities, including their inherent attributes and relations with other entities. Our approach is based on ontology which contains many elements. Therefore, it is necessary to cover the crucial elements in the ontology when constructing the data requirements for collecting the dataset for training. To standardize the data requirements generating process, we propose coverage criteria based on the structure of the domain model; each criterion will generate corresponding data requirements. The criteria serve as guiding principles for generating requirements that satisfy specific coverage standards. Specifically, we have provided two types of coverage criteria to cover attribute elements and relation elements, respectively. **Attribute Coverage Criterion. ** Given a domain ontology \(O\) and a set of crucial entity concepts \(E^{{}^{\prime}}_{O}\), for each value combination of attributes of entities in \(E^{{}^{\prime}}_{O}\) and the entity nodes directly related to an entity in \(E^{{}^{\prime}}_{O}\), there must exist at least one data point in the dataset to cover it. The attributes of the data directly influence the training processes of the ML system. The attributes and different combinations of attributes of an entity can provide different information to affect the system's understanding of data. Additionally, the attributes of entities directly related to the target entity will also affect the learning results of the system. _Attribute Coverage Criterion_ aims to determine data requirements by covering the combinations of values of attributes in the target entity and entities directly related to it. The requirements generated based on the _Attribute Coverage Criterion_ are formulated as follows:  
\[req^{attr}_{o}=\{(a,v)|v\in F_{val}(a)\wedge a\in F_{attr}(c)\wedge c\in E^{{} ^{\prime}}_{O}\cap F_{entity}(e_{o})\} \tag{7}\]  
where Eval(a) represents all the value nodes directly related with attribute node a; Fattr(c) represents all the attribute nodes directly related with concepts \(c\). The criterion-based data requirement is a collection of pairs, where each pair consists of \(a\) and \(v\), which represent the semantic information of the attribute and its value. To illustrate the attribute coverage criterion, we are going to analyze the data for the recognition system in the context of autonomous driving to generate the data requirements shown in Table 1 and assume that we want to recognize traffic signs. This criterion ensures that all semantic entities in each data can be described by a series of attribute coverage lists. Based on the definition of directly related, we can see in Figure 2 that the entity nodes directly related to _TrafficSign_ include _Tree, Vehicle, Pedestrian_ and _TrafficLight_. The _Tree_ has an attribute called _leaf_ with two values _withered and yellow_) and _flourish and green_, which semantically represent leaves in spring and summer, and leaves in autumn and winter, respectively. The traffic sign has two attributes _shape_ and _color_, each with its corresponding values, which semantically represent different types of signs and the characteristics exhibited by signs in complex scenes.