# A Semantic Middleware of Grain Storage Internet

Siquan Hu, Haiou Wang, Chundong She, Junfeng Wang

► To cite this version:

Siquan Hu, Haiou Wang, Chundong She, Junfeng Wang. A Semantic Middleware of Grain Storage Internet. 4th Conference on Computer and Computing Technologies in Agriculture (CCTA), Oct 2010, Nanchang, China. pp.71-77, 10.1007/978-3-642-18369-0_8 . hal-01564847

HAL Id: hal-01564847

https://inria.hal.science/hal-01564847

Submitted on 19 Jul 2017

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
# A Semantic Middleware of Grain Storage Internet

Siquan Hu¹, Haiou Wang¹, Chundong She², Junfeng Wang³

¹ School of Information Engineering, University of Science and Technology Beijing, Beijing 100083, P. R. China

² University of Electronic Science and Technology of China

³ College of Computer Science, Sichuan University
husiquan@ustb.edu.cn

**Abstract.** The vision of Internet of Things (IOT) promises a prosperous future for grain storage quality control by integrating all sensors deployed in the individual grain bins into a global grain storage system. However, since the data format and the data semantic of the monitoring systems are not unified, heterogeneous systems equipped with sensor networks are pending integration and have difficulty in semantic interoperation. In this paper, we design a semantic middleware to promote the data interoperability of different grain storage systems. The proposed semantic middleware uses a multi-layer architecture and provides four basic services: semantic mapping service, query service, publish service and ontology management service. Raw sensor data are converted to RDF format by semantic annotation. Semantic data are stored in the knowledge base and can be queried and reasoned. The semantic interoperation middleware will promote data interoperability, information search and retrieval, automatic inference and extendibility in the global grain storage internet.

**Keywords:** Semantics, Middleware, Grain Storage Internet.

## 1 Introduction

Food supply security is a worldwide challenge nowadays; many countries have built grain storage basements distributed over the world. To ensure a healthy storage condition for grains, different IT infrastructures have been built to monitor the condition of temperature and humidity [1], [2]. The vision of IOT [3], [4], [5] gives us a prosperous future that the storage quality and quantity of the grain products in the same country or transnational can be recorded and integrated into a global grain storage system based on the technology of sensor networks, internet, distributed database and cloud computing etc. However, at least currently there are many challenges to achieve such vision. One of the challenges is that these systems are designed, operated and maintained by different organization, the data format and the data semantic of the IT system are not unified and lack well-accepted standards, thus causes difficulty in interoperation and integration even in the same country.

The grains in storage are products of agriculture field, which requires the monitoring of soil condition, weather, water-flow, crop etc. For that purpose different
sensors are needed. Either wired or wireless, these sensors connect to form a sensor network to gather the context data of the grain. Therefore, heterogeneous systems equipped with sensor networks, with vastly different capabilities such as temperature, humidity, light, gas and biology metrics measurements are pending integration. In this paper, we design a semantic middleware to promote the interoperation ability of the different grain storage system. The envisioned goal is to provide semantic interoperation middleware to the global grain storage network that will promote data interoperability, information search and retrieval, automatic inference, and extendibility.

## 2. Related work

In agriculture domain, sensor network based solutions have been used for several years for monitoring or controlling purposes. W. Zhang et al. at Carnegie Mellon University developed a small wireless sensor network to monitor plant nursery [6]. Sensors were used to collect soil and air humidity, moister, temperature and light information. Yunseop Kim et al. [7] developed an electronically controlled sensor based irrigation system that provides the facility to monitor soil moister and temperature, weather information and sprinkler position remotely using the Bluetooth and GPS technologies. Tim Wark et al. created a pervasive, self configurable sensor based solution [8] to analyze the behavior of animals and their control as well as the pastures assessment. However, all these projects are close loop applications which have weak interoperation ability.

To handle interoperation problem, Semantic Sensor Web [9] are proposed to integrate the Semantic Web with sensors networks [10], [11], which will bring benefits such as a more expressive graph based representation that models relationships as first class objects, the use of Uniform Resource Identifiers that allows all concepts to be independently accessible throughout the Web, and a triple-pattern encoding scheme that provides for simplified integration of heterogeneous datasets. Based on such mechanisms, the semantic middleware is proposed for different applications, such as E-Discovery, E-Government, Mobile computing [12], [13], [14].

## 3. Design of the middleware

The semantic middleware exploits ontology to support the semantic integration and functional collaborations between different information systems. Rather than assuming a specific technical architecture or environment such as Service Oriented Architecture (SOA), web services, the semantic middleware only assumes that collaborations are realized through the exchange of messages. This provides the flexibility of implementation when SOA or web services are not supported in many legend systems.

To maximize the reusability, a service-based architecture is exploited in our middleware design showed in Fig. 1. From the aspects of the users, four services are
provided: Publish Service, Query Service, Semantic Mapping Service, and Ontology Management Service.

Both Publish service and Query Service interact with the data store through a unified Query Controller. Publish service will deliver the data set results to the web client under the default query configuration. The Query service allows users set flexible query conditions and makes various semantics related queries Semantic data exchange and query need a interface or no one knows how to connect to the semantic data store. The solutions are quite dependable, the popular solution is using reasoning server, but any kind of data exchange mechanisms is workable. In our design, the Query Controller is based on a reasoning server.

<figure><img src="image_2.png" /><figcaption>Fig. 1. The service architecture of the middleware.</figcaption></figure>

The Semantic Mapping service helps to make semantic annotation to raw sensor data. This service includes an optional syntax processing layer and a required layers are semantic annotation layer. The syntax processing layer transfers the raw sensor data into XML files or streams if the input is not in XML-format. The Semantic annotation layer abstracts the processed outputs from the heterogeneous, low-level data sources such as sensors. Context information is added here through application specific ontology which can be plugged and automatically initiated without any further human intervention. The Semantic Mapping service analyzes the incoming XML message and store it into the ontology model in the form of ontology class individuals. After semantic annotation, the data is stored into data stores as triple statements which form the underlying graph of the model. Both the syntax mapping rules and semantic mapping rules can be stored in the instance KB (knowledge base) and managed by the Ontology Management service.

The Ontology Management service handles the ontology definitions and semantic rules. The ontology definition can be an owl file in the instance knowledge base, or mapping rules from XML to RDF stored in the KB. These mappings should include both the raw sensor data and the context of the data generation. The meta data of the
sensor output are the necessary description about the raw data itself. Take raw data produced by a temperature sensor for example. We have to make it clear that the raw data is a temperature measurement, how accuracy it is, and in what conditions it is valid, which usually depends on the capability of sensing devices. Different sensing devices may have different kinds of meta data. The context information is about the context information in which the raw data was generated, for example, the location of sensor node, the ID of sensor node and the timestamp of data captured. The semantic rule is used to trigger the modification of ontology when some condition is met. For example, when the humidity is too high then fire an alert.

## 4. The Prototype Implementation

To evaluate the proposed design, we have implemented a prototype of the semantic middleware for the grain storage internet. The semantic framework is based on the Jena [15] which is a Java framework for building Semantic Web applications. It provides a programmatic environment for RDF, RDFS and OWL, SPARQL and includes a rule-based inference engine. The backend database is PostgreSQL [16]. The reasoning server is the open source Pellet [17] which provides standard reasoning services for OWL ontologies. It supports both the essential OWL DL reasoning and OWL 2 EL reasoning. The query controller use Pellet to represent and reason about information using OWL. An ontology improved on OntoSensor [18] is used in the prototype as an experimental ontology. OntoSensor references and extends the IEEE Suggested Upper Merged Ontology, which defines general concepts and associations.

In our implementation, the semantic mapping service will transfer the raw XML reading into RDF/OWL statements. For example, from a sensor node 1 equipped with a sensor board MTS310 (bordid=130), we get a xml packet in following format.

```xml
<NotePacket>
  < noteDataElement><Name>amtype</Name><ConvertedValue>0</ noteDataElement>
  < noteDataElement><Name>nodeid</Name><ConvertedValue>1</ noteDataElement>
  < noteDataElement><Name>group</Name><ConvertedValue>11</ noteDataElement>
  < noteDataElement><Name>board_id</Name><ConvertedValue>130</noteDataElement>
  < noteDataElement><Name>packet_id</Name><ConvertedValue>1</noteDataElement>
  < noteDataElement><Name>voltage</Name><ConvertedValue>3.25</noteDataElement>
  < noteDataElement><Name>temp</Name><ConvertedValue>25.4</noteDataElement>
  < noteDataElement><Name>light</Name><ConvertedValue>74</noteDataElement>
  < noteDataElement><Name>temperature</Name><ConvertedValue>25.4</noteDataElement>
</NotePacket>
```
After mapping, the data is stored into the ontology models as following format,
which is the output after semantic annotation.

<Onto: NodeVoltage rdf:ID="NodeVoltage_1">
<Onto:hasUnit rdf:resource="#Volts"/>
<Onto:hasDoublVal rdf:datatype=" #double">3.2525.4
</Onto:hasDoublVal>
</Onto: NodeVoltage >
<Onto:MTS310_Temperature
rdf:ID="MTS310_Temperature_1">
<Onto:hasUnit rdf:resource=" #degreeC"/>
<Onto:hasDoubleVal rdf:datatype=" #double">25.4
</Onto:hasDoubleVal>
<Onto: MTS310_Light rdf:ID="MTS310_Light_1">
<Onto:hasUnit rdf:resource=" #ADCReading"/>
<Onto:hasDoubleVal rdf:datatype=" #double">749
</Onto:hasDoubleVal>
</Onto: MTS310_Light >
<Onto:measures rdf:ID="MTS310_1">
<Onto:hasMeasure rdf:resource="NodeVoltage_1"/>
<Onto:hasMeasure rdf:resource="MTS310_Temperature_1"/>
<Onto:hasField rdf:resource="MTS310_Light_1"/>
</Onto:measures>

From the output we can see the all sensor readings have been endowed formal
semantics which provides the basis of semantic interoperability.

To verify the integration effectiveness of different grain storages using the
semantic middleware prototype, two senor networks are deployed as Fig. 2. Each
sensor network has 100 sensor nodes distributed in 2 grain storage bins. Each network
has a gateway running the proposed middleware.

<figure><img src="image_3.png" /><figcaption>**Fig. 2.** The sensor network deployment structure</figcaption></figure>

Every 30 seconds, the server in Net 1 sends a query to retrieve the readings of a
random one of the node 101-200 which is in the Net 2, vice versa. The observed
query results show the data can be access successfully cross the bounds of the
subnets, thus the integration is seamless.
## 5. Conclusion and future work

The semantic integration of the global food storage system is an exciting vision that maximizes the utilization of the potential of data resources on existed food monitoring information systems. The semantic interoperability is a necessary prerequisite for automatic search, retrieval and processing of grain storage sensor data. This paper is a step further towards to unify the domain objects, sensor readings, time/space semantics, lifecycles of grains. The benefits of our work are to automatic the syntax and semantic annotation of sensor data and provide the semantic unification – a solid base for integration of heterogonous grain storage systems to form a global Internet of things on grain storage.

As for future work, we are planning to perform more comprehensive performance analysis by integrating more sensor network of grain storage in China and considering more real life scenarios and extending the system to the storage information system of other kinds of food. This effort will be a further step in the direction towards enabling semantic web to access and process the global food storage system.

Our paper demonstrates how semantic middleware can be applied to grain storage internet of things. There are at least two advantages of our approach towards building such a future internet. First, RDF as the common information representation enables the semi-structured data sources conveniently handled and additional sources added incrementally without need to modify a global schema. Second, a richer domain model can be provided by formal ontology definition with supporting inheritance hierarchies for classes and properties.

## 6. Acknowledgement

Project supported by the National High Technology Research and Development Program of China (2008AA01Z208 and 2009AA01Z405), the National Natural Science Foundation of China (60772150), and the Youth Foundation of Sichuan Province (2009-28-419) and the Applied Basic Research Program of Sichuan Province (2010JY0013).

## References

1. Armstrong, P.: Wireless Data Transmission of Networked Sensors in Grain Storage. In:, ASAE Annual International Meeting, Paper Number 036157. Las Vegas, USA (2003)

2. Rehman, A., Shaikh, Z.A.: Towards Design of Context-Aware Sensor Grid Framework for Agriculture. In: World Academy of Science, Engineering and Technology, vol. 38, pp. 244--247. WASET, Johannesburg, South Africa (2008)

3. Katasonov, A., Kaykova, O., Khriyenko, O., Nikitin, S., Terziyan, V.: Smart Semantic Middleware For The Internet Of Things. In: 5th International Conference on Informatics in Control Automation and Robotics, pp. 169--178. INSTICC, Madeira, Portugal (2008)

4. Yan, L., Zhang, Y., Yang, L.T.: The Internet of Things: from RFID to the Next-Generation Pervasive Networked Systems. Auerbach Publications, FL, USA (2008)
5. Brock, D., Schuster, E.: On the Semantic Web of Things. In: Semantic Days 2006, Stavanger, Norway (2006)

6. Zhang, W., Kantor, G., Singh, S.: Integrated Wireless Sensor/Actuator Networks in an Agricultural Application. In: SenSys 04, pp. 317. ACM Press, New York (2004)

7. Kim, Y., Evans, R.G., Iversen, W.: Remote Sensing and Control of Irrigation System using a Distributed Wireless Sensor Network. IEEE Trans. Instrumentation and Measurement, 57(7), 1379--1387 (2008)

8. Wark, T., Corke, P., Sikka, P., Klingbeil, L., Guo, Y., Crossman, C., Valencia, P., Swain, D.: Transforming Agriculture through Pervasive Wireless Sensor Networks. IEEE Pervasive Computing, 6(2), 50--57 (2007)

9. Sheth, A., Henson, C., Sahoo, S.: Semantic Sensor Web. IEEE Internet Computing, 12(4), 78--83 (2008)

10. Thirunarayan, K., Pschorr, J.K.: Semantic Information and Sensor Networks. In: 24th Annual ACM Symposium on Applied Computing, pp. 1273--1274. ACM Press, New York (2009)

11. Brunner, J.S., Goudou, J.F., Gatellier, P., Beck, J., Laporte, C.E.: SEMbySEM: a Framework for Sensors Management. In: 1st International Workshop on the Semantic Sensor Web, pp. 19--34. Herkalion, Greece (2009)

12. Butler, M., Reynolds, D., Dickinson, I., McBride, B., Grosvenor, D., Seaborne, A.: Semantic Middleware for E-Discovery. In: IEEE International Conference on Semantic Computing, pp. 275--280. IEEE Press, New York (2009)

13. SanchezI, A., Ojo, A., Janowski, T., Estevez, E.: Semantic Interoperability Middleware – Cases and Applications in Electronic Government. In: 3rd International Conference on Digital Information Management, pp. 800--805. IEEE Press, New York (2008)

14. Corradi, A., Montanari, R., Toninelli, A.: Adaptive Semantic Middleware for Mobile Environments. Journal of networks, 2(1), pp. 36--47 (2007)

15. Jena, http://jena.sourceforge.net

16. PostgreSQL, http://www.postgresql.org

17. Pellet, http://clarkparsia.com/pellet/

18. Russomanno, D.J., Kothari, C., Thomas, O.: Building a Sensor Ontology: A Practical Approach Leveraging ISO and OGC Models. In: the 2005 International Conference on Artificial Intelligence, pp. 637--643. Las Vegas, USA (2005)