## 4 Implementation of an Open Data Platform in Accordance with the Proposed Approach
### Introducing Hazelnut Trait Ontology
There exist several reasons behind preferring API mode. API operating mode eases managing transmission of data towards multiple destinations. Each received data contains the address of the sender device. This mode provides advanced Zigbee addressing, advanced networking diagnostics and remote configuration [63]. XBee devices, which are configured as API operating mode, uses API frame illustrated in Figure 4 to transmit data from routers towards the coordinator. After router devices measured environmental data through their sensors, they transform the sensor measurement values to API data frame using relevant Arduino libraries. The received data through the coordinator are decomposed into several pieces to distinguish the router, sensor and sensor measurement value. In other words, the purpose of this operation is to access RF data, which are part of API frame to extract key value pairs. After key value pairs are extracted from RF data, it is necessary to match the sensor to its measurement unit using sensor information stored in  
Figure 3: Detailed view of wireless sensor networks. the database. This matching process is performed by retrieving relevant data from database using REST web services. The reason for applying this method is to keep the total number of bytes included in the API frame's data file small. Considering the sensors of WSN, the following measurement units are matched to relevant sensor measurement data types: lux for light intensity, \({}^{\circ}\)C for temperature, % for humidity, Pa for pressure, m for altitude, \({}^{\circ}\)/s for slope, nm for ultraviolet, ppm for carbon monoxide concentration and ppb for nitrogen dioxide concentration. The model creation needs to be undertaken for decomposed and cleaned data using a programming language according to the proposed approach. C# programming language is used to create objects, which are represented in Figure 5. It is also a major programming language which is used to develop web services and open-data platform. There exist three different storage options recommended by DSE. MS SQL Server 2016, which was a relational database management system, is used to store data. The Windows communication foundation (WCF), which is a framework for building service-oriented applications, was used to develop XML and RESTful web services. dotNetRDF, which is a common. NET API for working with RDF triple stores, was used to parse, manage, query and write  
Figure 4: API data frame. Figure 5: Data models created by object modeling engine (OME). RDF datasets [64]. ASP.NET Web API framework, which provides an easy and secure way for building HTTP based services, consumed by a wide range of software applications, was used to develop the Web APIs. Providing Semantic Interoperability between IoT Devices and Open Data Platforms Using Agricultural Trait Ontologies  
This section of the study examines how to integrate sensor data using a crop-specific trait ontology. This section also shows how to create mapping rules for linking sensor data types with relevant ontology classes by storing in RDF file. The classes which can be mapped into the relevant sensor measurement data types are sub-classes of: _EnvironmentAndSite_ class. This describes the environmental and site-specific parameters with respect to hazelnut within the hazelnut trait ontology. After sensor data streams are decomposed as key value pairs and stored in the database in compliance with the object models created by OME, there is a need to create mapping rules using the relevant UI through open-data platform. The open-data platform uses these rules to map the sensor measurement data types with the relevant ontology classes to integrate and annotate data semantically. Varied data files mentioned in the previous section of the study are generated by linking the stored datasets to relevant classes of agricultural ontology. Through using these mapping rules, domain-specific datasets are built.