## 3 IoT Standards and Protocols for Precision Agriculture
### Haystack  
The Haystack Project focuses on developing solutions for the semantic modelling of data related to smart devices, including building equipment systems, automation and control devices, sensors and detection systems, and building automation systems [45]. Haystack provides a common methodology for defining metadata through a series of tags, expressed as name-value pairs, which are used to describe attributes and properties associated with system entities. It defines a common vocabulary in the form of tag libraries created by the community. These tags have fixed names, and the libraries allow for the definition of the attributes or properties they describe. Although Haystack does not specify \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **IPSO** & **Haystack** & **OCF** & **SensorThings** \\ \hline
**Base Model** & LwM2M & - & - & OData OASIS \\ \hline
**Object Modeling** & Through predefined models & Through user-defined tags & Through predefined resource types and interfaces & Through standard-defined entities \\ \hline
**Object Properties** & Defined by the model and identified by an ID & Defined by the tags used & Defined by resource types with customizable additions & Defined by the entity type \\ \hline
**Geolocation** & Expressed as an object resource & Expressed as a property through tags & Defined by resource type & Native through entities \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of IoT standards for precision agriculture which or how many tags should be used to describe a specific piece of data, it dictates how they should be named when employed [46]. In Haystack, an endpoint called a \"point\" can be a sensor, a command to an actuator (cmd), or a set point (sp) that can be written. For instance, a point representing a temperature sensor may have some or all of the following tags associated with it, among others:  
\[temp,sensor,unit,air,discharge,equipRef,siteRef\]  
All these are Haystack tag names that must be named as specified in the appropriate tag library if used. The philosophy behind Haystack is that system designers/installers have the freedom to annotate whatever they consider useful, while applications use and interpret the tags they find relevant for their purpose in order to understand the context. Haystack payload data serialization is supported in formats like JSON, CSV (Comma-Separated Values), Zinc (similar to CSV but with more data types), and grids (two-dimensional tabular data structures). The Open Connectivity Foundation (OCF) establishes IoT standards, ensures device interoperability, and provides certification. Its framework covers information modelling, discovery, messaging, device management, security, and client-server interactions for data and actions [47]. In OCF, physical entities are represented as resources, following a resource and interaction model. Interactions use the CRUDN model (Create, Read, Update, Delete, Notify) aligned with the CoAP protocol. Each resource type has a specification detailing its behaviour for all possible interactions [48]. In OCF, every resource includes two required attributes: \"if\" (interface types) and \"rt\" (resource types), with variants detailed in the specification. Additional properties, expressed as name-value pairs, represent data and metadata. For instance, a sensor resource may include attributes like \"value\", \"range\", \"unit\", and \"link\", the latter enabling connections to other resources. The \"rt\" attribute specifies the type of physical device. OCF uses API specifications to define methods and interfaces for resources and JSON schema to describe payloads, properties, and data types [49]. OGC SensorThings  
The Open Geospatial Consortium (OGC), consisting of over 500 organizations, develops open standards for geospatial data and IoT services, including the \"SensorThings\" standard for IoT sensors. The OGC SensorThings API offers a unified, open, and geospatial method to connect IoT devices, data, and applications on the Web, designed for resource-limited devices [50].