Model Driven Development Applied to Complex Event Processing for Near Real-Time Open Data
Abstract
:1. Introduction
- This paper shows that model-driven development is a suitable approach to the development of tools to tackle the complexity of heterogeneous technology as occurs in the context of open data sources and complex event processing.
- A methodology named OpenData2CEP is defined to describe each step needed to carry out the analysis of complex event patterns on open data sources.
- A model-driven approach is developed to support the methodology proposed. It facilitates the development of each methodological phase by defining an OpenData2CEP metamodel and a model-to-text transformation towards code generation for a specific Enterprise Service Bus (ESB) and CEP engine which facilitate the deployment of the analysis defined.
- Two case studies are developed following the methodology and tools presented which include different event pattern analyses.
2. Related Works
2.1. Open Data Tools
2.2. Stream Processing Languages and Engines
2.3. Model-Driven Approach Applied to Open-Data and Complex Event Processing
3. OpenData2CEP Methodology
3.1. Open Data Catalogue Source Identification
3.2. Defining Complex Event Patterns Using the Data Published from the Open Data Catalogue
Algorithm 1: Example of Event Processing Language (EPL) expression to identify tendency values. |
|
Event Time Considerations
Algorithm 2: Example of EPL sentences working with window time. |
|
3.3. Defining the Notification System When an Event Pattern Is Identified
3.4. Executing the Continuous Queries on the Open Data Source
4. OpenData2CEP Tool: Design and Implementation Phases
4.1. Design Phase: OpenData2CEP Metamodel
4.2. Model-to Text-Transformation Phase. ESB and CEP Artefacts Code Generation
4.2.1. ESB Project Code and Artefacts
Algorithm 3: Example of Esper configuration file generated from the AirDataG OpenData2CEP model. |
|
4.2.2. ESB Notification Project Code
- Email notifications are implemented using Mule ESB Connectors which allows emails to be sent to previously modelled recipients using the SMTP protocol.
- REST API is generated in order to offer the matched event patterns.API REST is generated using the following schema. Note that each URL produces a JSON file with the data queried:
GET /analysis_project/epl_pattern/notification_name GET /analysis_project/epl_pattern/notification_name?date=2016/11/10 GET /analysis_project/epl_pattern/notification_name?from_date=2016/11/10
- Java Message Service (JMS) notifications make it possible to publish a topic matched event pattern, and a publish/subscribe architecture is defined as a consequence. On the one hand, the Mule ESB could publish the matched pattern, while, on the other hand, any user interested in the results obtained from the event pattern analysis could subscribe to the topic. The message generated is a JMSTextMessage which includes a JSON record. By default, the topic is available in http://localhost:61616 where a topic named topic.analysisProject.eplPattern.notificationName is defined on ActiveMQ JMS Broker [64].
5. Case Studies
5.1. Case Study: Air Quality
- Design and implementation phase: designIn Figure 6, we can observe the model AirDataG conforming to the OpenData2CEP metamodel. In this model, the needed entities have been defined to describe the main characteristics of the proposed analysis. Note that users could use the Eclipse Graphical Editor, which was developed as a concrete syntax for the OpenData2CEP metamodel. Specifically, a data source called AirDataG has been defined which manages AirData data elements defining several fields or attributes such as station, title, latitude, longitude, solar date, etc. Thus, the model defined includes the following main methodology phases: (i) data source identification; (ii) definition of complex event patterns and (iii) definition of matched event pattern on notification. Regarding the complex event pattern defined, as an example, both analyses are defined as follows: (i) the field should have an annual average value of less than or equal to 20 µg/m and (ii) the field should have a daily average value of less than or equal to 50 µg/m. Note that these analyses include time windows which will be suitable managed by the CEP engine and can be defined using the EPL sentences presented below:
(i) EPL_Air_PM10_Diary_Average: select a1.* from AirDataG.win:time(24 h).stat:uni(PM10) a1 where a1.average > 50; (ii) EPL_Air_PM10_Anual_Average: select a1.* from AirDataG.win:time(1 year).stat:uni(PM10) a1 where a1.average > 20;
EPL sentences should be defined as properties on EPL entities, specifically at the eplQuery attribute. Then, as can be observed in Figure 6, notification issues are defined from each EPL sentence. For instance, for the EPL named EPL_Air_PM10_Annual_Average, both notification kinds have been defined: REST and JMS notifications. - Design and implementation phase: model-to-text transformationThe artefacts obtained after model-to-text transformation allow users to deploy the whole analysis system on a MuleESB instance, including Mule project, esper-config.xml, data input metadata for MuleESB, data output metadata for MuleESB and workflow.xml, among others. The data flow is presented graphically in Figure 7. It includes a main AirDataG flow to address the events to the CEP engine (Esper). A second flow named EPL_Air_PM10_Annual_Average processes the matched event patterns, addressing them to specific notification flows. Specifically, in Figure 7, we can observe the REST API deployed in a flow named REST _Air_PM10_Annual_Average_Alert.Thus, notification issues are published following the model definitions (Figure 6). For instance, both REST and JMS notifications were defined from the EPL sentence named EPL_Air_PM10_Annual_Average.First, the REST API for the notification proposal (Algorithm 4) is generated using the RAML specification [65] and Apikit project [66] for integration with Mule ESB. Specifically, REST API defines the following urls for AirPM10Alert _AnnualAverageNotification notification, which are available through HTTP methods:
GET /AirDataG/AirPM10Alert_AnnualAverage/AirPM10Alert_Annual_Average_Alert GET /AirDataG/AirPM10Alert_AnnualAverage/AirPM10Alert_Annual_Average_Alert?date=2016/11/10 GET /AirDataG/AirPM10Alert_AnnualAverage/AirPM10Alert_Annual_Average_Alert?from_hour=00:00:00
Second, the JMS notification defined includes the properties server and topic. These properties can be used to subscribe a JMS client to the topic:Server: http://localhost:61616 Topic: AirDataG.Air_PM10_AnnualAverage.AirPM10_Annual_Average_Alert
Algorithm 4: REST API generated defined by RAML to be deployed using the Apikit tool for Mule ESB. |
|
5.2. Case Study: Earthquake Data
- Design and implementation phase: designThe open data source could be found at https://earthquake.usgs.gov/earthquakes/feed/v1.0/csv.php, where active earthquake data are updated continuously with a frequency close to real-time. Specifically, we use the last hour earthquake data here. Thus, the earthquake data include several items of information, such as time, latitude, longitude, depth, mag, magType, nst, gap, dmin, rms, net, id, updated, place, type, locationSource, magSource, horizontalError, depthError, magError, magNst, and status. For example, latitude and longitude mean the latitude and longitude values used to identify a place, while mag defines the earthquake magnitude on the Richter scale.Figure 8 shows the OpenData2CEP model for this case study, including the Data, DataSource, ConfigCEP, Notifications, and EPL entities. The model defined includes how to locate the data resource and the set of fields defined.Taking into account the fields identified at the open data source and defined in the model, users can define their own event patterns. For instance, a user can define several patterns based on earthquake data which could be useful for final users: (i) Alerts from earthquake magnitudes (mag) with values ; (ii) Places (longitude and latitude) where the average earthquake magnitude (mag) was in the last 5 days. (iii) Places (longitude and latitude) where the earthquake magnitude (mag) is incremental, starting from a magnitude value (mag) . Specifically, tree incremental earthquake magnitude values are identified.Note that a specific area could be defined by the user, for example, by indicating two latitudes/longitudes which build an area. In this sense, the event should be analysed by grouping the data by user areas.
(i) @Name("EarthQuake_greater_5") select * from EarthquakeData where mag > 5; (ii) @Name("EarthQueake_average_greater_2") select a1.* from EarthquakeData.std:groupwin(longitude,latitude).win:time(5 day).stat:uni(mag) a1 where a1.average>2 and a1.datapoints≥2; (iii) @Name("EarthQuakeTencency") select a1.longitude, a1.latitude, a1.mag, a2.longitude, a2.latitude,a2.mag, a3.longitude,a3.latitude,a3.mag from pattern [(every (a1 = EarthquakeData(a1.mag ≥1) -> a2 = EarthquakeData(a2.mag > a1.mag) -> a3 = EarthquakeData(a3.mag> a2.mag) ))] where a1.longitude = a2.longitude and a1.latitude = a2.latitude and a1.latitude=a3.latitude and a1.longitude=a3.longitude;
From the point of view of notification issues, as can be observed in Figure 8, two types of notifications were defined: JMS and email notifications. - Design and implementation phase: model-to-text transformationThe artefacts obtained after model-to-text transformation allow users to deploy the whole analysis system on a MuleESB instance, including the Mule project, esper-config.xml, data input metadata for MuleESB, data output metadata for MuleESB and workflow.xml files, among others. The data flow is presented graphically in Figure 9.The notification code is generated from the model definitions (Figure 8), that is, JMS and email notifications are defined and are generated to be deployed with the following characteristics.The JMS notification defined includes the properties Server and Topic which are used to configure a JMS Connector for MuleESB:
Server: http://localhost:61616 Topic: earthquake.EarthQuake_greater_5.EarthQuake_greater_5_Alert
For email notifications, the properties defined are User, Pass, Server, and Port:User: [email protected] Pass: ***** Server: tajo.unex.es Port: 995
Thus, the code generated includes: (i) the MuleESB project; (ii) the Esper Mule workflow to analyse the input data; and (iii) the notification code which includes JMS and email Mule workflow.
6. Discussion
Limitations
7. Conclusions
Author Contributions
Funding
Conflicts of Interest
References
- Janssen, M.; Charalabidis, Y.; Zuiderwijk, A. Benefits, adoption barriers and myths of open data and open government. Inf. Syst. Manag. 2012, 29, 258–268. [Google Scholar] [CrossRef]
- Maier-Rabler, U.; Huber, S. “Open”: The changing relation between citizens, public administration, and political authority. J. Democr. Open Gov. 2012, 3, 182–191. [Google Scholar] [CrossRef]
- Schaffers, H.; Komninos, N.; Pallot, M.; Trousse, B.; Nilsson, M.; Oliveira, A. Smart cities and the future internet: Towards cooperation frameworks for open innovation. In The Future Internet Assembly; Springer: Berline, Germany, 2011; pp. 431–446. [Google Scholar]
- Kitchin, R. The real-time city? Big data and smart urbanism. GeoJournal 2014, 79, 1–14. [Google Scholar] [CrossRef]
- Open Knowledge Foundation. 2016. Available online: http://okfn.org/opendata/ (accessed on 5 July 2018).
- Auer, S.; Bizer, C.; Kobilarov, G.; Lehmann, J.; Cyganiak, R.; Ives, Z. DBpedia: A Nucleus for a Web of Open Data. In Proceedings of the 6th International The Semantic Web and 2nd Asian Conference on Asian Semantic Web Conference ISWC’07/ASWC’07, Busan, Korea, 11–15 November 2007; pp. 722–735. [Google Scholar]
- Luckham, D.C. The Power of Events: An Introduction to Complex Event Processing in Distributed Enterprise Systems; Addison-Wesley Longman Publishing Co., Inc.: Boston, MA, USA, 2001. [Google Scholar]
- Etzion, O.; Niblett, P. Event Processing in Action, 1st ed.; Manning Publications Co.: Greenwich, CT, USA, 2010. [Google Scholar]
- Cugola, G.; Margara, A. Processing flows of information: From data stream to complex event processing. ACM Comput. Surv. (CSUR) 2012, 44, 15. [Google Scholar] [CrossRef]
- Studio, S. TIBCO StreamBase Studio. 2016. Available online: http://www.streambase.com/products/streambasecep/streambase-studio/ (accessed on 5 July 2018).
- EsperTech. Esper CEP. 2016. Available online: http://www.espertech.com/esper/ (accessed on 5 July 2018).
- Zámečníková, E.; Kreslíková, J. Comparison of platforms for high frequency data processing. In Proceedings of the 2015 IEEE 13th International Scientific Conference on Informatics, Poprad, Slovakia, 18–20 November 2015; pp. 296–301. [Google Scholar]
- Mathew, A. Benchmarking of Complex Event Processing Engine-Esper; Technical Report IITB/CSE/2014/April/61; Department of Computer Science and Engineering, Indian Institute of Technology Bombay: Maharashtra, India, 2014. [Google Scholar]
- Quilitz, B.; Leser, U. Querying distributed RDF data sources with SPARQL. In Proceedings of the European Semantic Web Conference, Canary Islands, Spain, 1–5 June 2008; Springer: Berlin/Heidelberg, Germany, 2008; pp. 524–538. [Google Scholar]
- Barbieri, D.F.; Braga, D.; Ceri, S.; Della Valle, E.; Grossniklaus, M. C-SPARQL: SPARQL for continuous querying. In Proceedings of the 18th International Conference on World Wide Web, Madrid, Spain, 20–24 April 2009; pp. 1061–1062. [Google Scholar]
- Mauri, A.; Calbimonte, J.P.; Balduini, M.; Della Valle, E.; Aberer, K.; Dell’Aglio, D. Where are the RDF Streams?: Deploying RDF Streams on the Web of Data with TripleWave. In Proceedings of the 14th International Semantic Web Conference ISWC, Bethlehem, PA, USA, 11–15 October 2015. Number EPFL-POSTER-212733. [Google Scholar]
- Selic, B. The pragmatics of model-driven development. IEEE Softw. 2003, 20, 19–25. [Google Scholar] [CrossRef]
- France, R.; Rumpe, B. Model-driven development of complex software: A research roadmap. In Proceedings of the 2007 Future of Software Engineering, Minneapolis, MN, USA, 23–25 May 2007; pp. 37–54. [Google Scholar]
- Schmidt, D.C. Model-driven engineering. Comput.-IEEE Comput. Soc. 2006, 39, 25. [Google Scholar] [CrossRef]
- Hailpern, B.; Tarr, P. Model-driven development: The good, the bad, and the ugly. IBM Syst. J. 2006, 45, 451–461. [Google Scholar] [CrossRef]
- Atkinson, C.; Kuhne, T. Model-driven development: A metamodeling foundation. IEEE Softw. 2003, 20, 36–41. [Google Scholar] [CrossRef]
- Meta Object Facility (MOF). Meta Object Facility (MOF) Core Specification Version 2.5.1. Available online: https://www.omg.org/spec/MOF/2.5.1/ (accessed on 5 July 2018).
- Steinberg, D.; Budinsky, F.; Paternostro, M.; Merks, E. EMF: Eclipse Modeling Framework 2.0, 2nd ed.; Addison-Wesley Professional: Boston, MA, USA, 2009. [Google Scholar]
- Sendall, S.; Kozaczynski, W. Model transformation: The heart and soul of model-driven software development. IEEE Softw. 2003, 20, 42–45. [Google Scholar] [CrossRef]
- Chappell, D. Enterprise Service Bus; O’Reilly Media, Inc.: Sebastopol, CA, USA, 2004. [Google Scholar]
- Refine, O. Open Refine. 2017. Available online: http://openrefine.org/ (accessed on 5 July 2018).
- Socrata. 2017. Available online: https://socrata.com/ (accessed on 5 July 2018).
- CKAN. 2017. Available online: http://ckan.org/ (accessed on 5 July 2018).
- Tables, G.F. Google Fusion Tables. 2017. Available online: http://tables.googlelabs.com/ (accessed on 5 July 2018).
- Protégé. Protégé Web Tool. 2018. Available online: https://protege.stanford.edu/ (accesed on 8 July 2018).
- Kolozali, S.; Elsaleh, T.; Barnaghi, P.M. A Validation Tool for the W3C SSN Ontology Based Sensory Semantic Knowledge. In Proceedings of the 13th International Semantic Web Conference, Trentino, Italy, 20 October 2014. [Google Scholar]
- Garcia-Castro, R.; Gomez-Perez, A.; Corcho, O. Ready4smartcities: ICT roadmap and data interoperability for energy systems in smart cities. In Proceedings of the 2014 European Semantic Web Conference, Crete, Greece, 25–29 May 2014. [Google Scholar]
- Bakerally, N.; Boissier, O.; Zimmermann, A. Smart city artifacts web portal. In Proceedings of the International Semantic Web Conference, Heraklion, Greece, 29 May–2 June 2016; pp. 172–177. [Google Scholar]
- Gyrard, A.; Bonnet, C.; Boudaoud, K.; Serrano, M. LOV4IoT: A second life for ontology-based domain knowledge to build Semantic Web of Things applications. In Proceedings of the 2016 IEEE 4th International Conference on Future Internet of Things and Cloud (FiCloud), Vienna, Austria, 22–24 August 2016; pp. 254–261. [Google Scholar]
- Serrano, M.; Barnaghi, P.; Carrez, F.; Cousin, P.; Vermesan, O.; Friess, P. Internet of Things iot Semantic Interoperability: Research Challenges, Best Practices, Recommendations and Next Steps. Available online: http://www.internet-of-things-research.eu/ (accessed on 1 July 2018).
- Ganzha, M.; Paprzycki, M.; Pawłowski, W.; Szmeja, P.; Wasielewska, K. Semantic interoperability in the Internet of Things: An overview from the INTER-IoT perspective. J. Netw. Comput. Appl. 2017, 81, 111–124. [Google Scholar] [CrossRef]
- Gyrard, A.; Datta, S.K.; Bonnet, C. A survey and analysis of ontology-based software tools for semantic interoperability in IoT and WoT landscapes. In Proceedings of the 2018 IEEE 4th World Forum on Internet of Things (WF-IoT), Singapore, 5–8 February 2018; pp. 86–91. [Google Scholar]
- Apache Storm. 2017. Available online: http://storm.apache.org/ (accessed on 1 July 2018).
- Apache Samza. 2017. Available online: http://samza.apache.org/ (accessed on 1 July 2018).
- Neumeyer, L.; Robbins, B.; Nair, A.; Kesari, A. S4: Distributed stream computing platform. In Proceedings of the 2010 IEEE International Conference on Data Mining Workshops (ICDMW), Sydney, Australia, 13 December 2010; pp. 170–177. [Google Scholar]
- Luckham, D. What’s the Difference Between ESP and CEP? 2006. Available online: http://www.complexevents.com/2006/08/01/what%E2%80%99s-the-difference-between-esp-and-cep/ (accessed on 15 September 2018).
- Oracle. Oracle Event Processing. 2016. Available online: http://www.oracle.com/technetwork/middleware/ complex-event-processing/overview/index.html (accessed on 15 September 2018).
- Sybase. SAP Sybase event stream processor. 2016. Available online: http://www.sybase.com/products/financialservicessolutions/complex-event-processing (accessed on 6 September 2018).
- Kakfa. Apache Kafka. 2016. Available online: https://kafka.apache.org/ (accessed on 12 July 2018).
- Flink. Apache Flink. 2016. Available online: https://flink.apache.org/ (accessed on 12 July 2018).
- FiwareCEP. FIWARE CEP. Proactive Technology Online. 2016. Available online: https://catalogue.fiware.org/enablers/complex-event-processing-cep-proactive-technology-online (accessed on 12 July 2018).
- FIWARE. FIWARE Community. 2016. Available online: http://www.fiware.org (accessed on 20 July 2018).
- Boubeta-Puig, J.; Ortiz, G.; Medina-Bulo, I. ModeL4CEP: Graphical domain-specific modeling languages for CEP domains and event patterns. Expert Syst. Appl. 2015, 42, 8095–8110. [Google Scholar] [CrossRef]
- Burgueño, L.; Boubeta-Puig, J.; Vallecillo, A. Formalizing Complex Event Processing Systems in Maude. IEEE Access 2018, 6, 23222–23241. [Google Scholar] [CrossRef]
- W3C. RDF Resource Description Framework. 2014. Available online: https://www.w3.org/RDF/ (accessed on 4 July 2018).
- Boubeta-Puig, J.; Ortiz, G.; Medina-Bulo, I. MEdit4CEP: A model-driven solution for real-time decision making in SOA 2.0. Knowl. Based Syst. 2015, 89, 97–112. [Google Scholar] [CrossRef]
- Bruneliere, H.; Cabot, J.; Jouault, F.; Madiot, F. MoDisco: A generic and extensible framework for model driven reverse engineering. In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering, Antwerp, Belgium, 20–24 September 2010; pp. 173–174. [Google Scholar]
- Izquierdo, J.L.C.; Cabot, J. Discovering implicit schemas in json data. In Proceedings of the International Conference on Web Engineering, Aalborg, Denmark, 8–12 July 2013; pp. 68–83. [Google Scholar]
- Rodríguez-Echeverría, R.; Pavón, V.M.; Macías, F.; Conejero, J.M.; Clemente, P.J.; Sánchez-Figueroa, F. Generating a Conceptual Representation of a Legacy Web Application. In Proceedings of the Web Information Systems Engineering—WISE 2013—14th International Conference, Nanjing, China, 13–15 October 2013; pp. 231–240. [Google Scholar]
- Segura, A.M.; Cuadrado, J.S.; de Lara, J. ODaaS: Towards the Model-Driven Engineering of Open Data Applications as Data Services. In Proceedings of the 2014 IEEE 18th International Enterprise Distributed Object Computing Conference Workshops and Demonstrations, Ulm, Germany, 1–2 September 2014; pp. 335–339. [Google Scholar]
- Berners-Lee, T. Linked data: Design issues. 2006. Available online: http://www.w3.org/DesignIssues/LinkedData.html (accessed on 1 July 2018).
- MuleESB. 2006. Available online: https://www.mulesoft.com/platform/mule (accessed on 1 July 2018).
- Camel. Apache Camel. 2016. Available online: https://camel.apache.org/ (accessed on 2 July 2018).
- EsperTech. EPL Language. 2016. Available online: http://www.espertech.com/esper/release-5.5.0/esper-reference/html/index.html (accessed on 6 July 2018).
- EsperTech. EPL Language TryOut. 2016. Available online: http://esper-epl-tryout.appspot.com/epltryout/ (accessed on 6 July 2018).
- GMF. Eclipse Graphical Modeling Project. 2016. Available online: http://www.eclipse.org/modeling/gmp/ (accessed on 20 June 2018).
- Kolovos, D.S.; Rose, L.M.; Abid, S.B.; Paige, R.F.; Polack, F.A.; Botterweck, G. Taming EMF and GMF using model transformation. In Proceedings of the International Conference on Model Driven Engineering Languages and Systems, Oslo, Norway, 3–8 October 2010; pp. 211–225. [Google Scholar]
- Project, A. Acceleo Project. 2016. Available online: http://www.acceleo.org (accessed on 20 June 2018).
- ActiveMQ. Apache Active MQ. 2016. Available online: http://activemq.apache.org/ (accessed on 25 June 2018).
- RAML. RESTful API Modeling Language (RAML). Available online: http://raml.org/ (accessed on 25 June 2018).
- Apikit. Module Mule Apikit for RAML. Available online: http://raml.org/projects/projectsq:apikit (accessed on 25 June 2018).
- Messaging, G.C. Google Cloud Messaging. 2016. Available online: https://developers.google.com/cloud-messaging/ (accessed on 23 June 2018).
- Berrocal, J.; Garcia-Alonso, J.; Murillo, J.M. The Fall and Rise of NimBees. In Proceedings of the 42th Euromicro Conference on Software Engineering and Advanced Applications (SEAA), Limassol, Cyprus, 31 August–2 September 2016; pp. 136–139. [Google Scholar]
© 2018 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Clemente, P.J.; Lozano-Tello, A. Model Driven Development Applied to Complex Event Processing for Near Real-Time Open Data. Sensors 2018, 18, 4125. https://doi.org/10.3390/s18124125
Clemente PJ, Lozano-Tello A. Model Driven Development Applied to Complex Event Processing for Near Real-Time Open Data. Sensors. 2018; 18(12):4125. https://doi.org/10.3390/s18124125
Chicago/Turabian StyleClemente, Pedro J., and Adolfo Lozano-Tello. 2018. "Model Driven Development Applied to Complex Event Processing for Near Real-Time Open Data" Sensors 18, no. 12: 4125. https://doi.org/10.3390/s18124125
APA StyleClemente, P. J., & Lozano-Tello, A. (2018). Model Driven Development Applied to Complex Event Processing for Near Real-Time Open Data. Sensors, 18(12), 4125. https://doi.org/10.3390/s18124125