SlideShare a Scribd company logo
1 of 15
Download to read offline
Complex Event Processing in
FIWARE
Francisco de la Vega
fdelavega@fi.upm.es
Rafael Fernández
rfernandez@ficodes.com
Agenda
§ Overview
§ Main concepts
§ Hands on!
1
SMART	IoT	PLATFORM
Overview
2
PERSEO
Context-Aware	CEP
ACTIONS
RULES
ORION
Context	
Broker
EVENTS
NGSI	subscription
NGSI
Context
updates
Pattern
matching
REST	API
ACTION:	NGSI	Update	Context
ACTION:	HTTP
ACTION:	SMS
ACTION:	EMAIL
ACTION:	TWEET
Overview
§ Perseo is a GE under incubation
§ Context-aware CEP GE
• Listen to events from context information to identify patterns described by rules, and
immediately react by triggering actions.
• Designed to be NGSI-compliant, and thus, to implement systems that works seamless
and jointly with Orion CB.
• Based on Esper CEP
§ It is focused on Complex Event Processing, not on Stream Processing.
• It defines a rule (query) engine, not a graph engine.
□ No need to write code
• Rules are set using SQL-like queries (EPL)
§ It defines a simplified version of the CEP GE Open Specification and Architecture.
• Uses NGSI as communication protocol for events
• Follows a PUSH model (CB pushes events on it)
3
Main concepts
4
Notice vs Event
§ Notifications or notices from Context Broker
are processed by Perseo before being sent
to perseo-core (Esper) as events.
§ They correspond to changes in the values of
an attribute of an entity to which Perseo is
susbcribed to.
{
"subscriptionId": "51c04a21d714fb3b37d7d5a7",
"originator": "localhost",
"contextResponses": [
{
"contextElement": {
"attributes": [
{
"name": "BloodPressure",
"type": "centigrade",
"value": "2"
},
{
"name": "TimeInstant",
"type": "urn:x-ogc:def:trs:IDAS:1.0:ISO8601",
"value": "2014-04-29T13:18:05Z"
}
],
"type": "BloodMeter",
"isPattern": "false",
"id": "bloodm1"
},
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
]
}
Notice
Main concepts
5
Notice vs Event
§ Notifications or notices from Context Broker
are processed by Perseo before being sent
to perseo-core (Esper) as events.
§ They correspond to changes in the values of
an attribute of an entity to which Perseo is
susbcribed to.
{
"noticeId":"a64fa410-8aad-11e4-87e4-632f5115a641",
"id":"bloodm1",
"type":"BloodMeter",
"isPattern":"false",
"service":"/",
"tenant":"unknown",
"BloodPressure":"2",
"BloodPressure__type":"centigrade",
"TimeInstant":"2014-04-29T13:18:05Z",
"TimeInstant__type":"urn:x-ogc:def:trs:IDAS:1.0:ISO8601"
}
Event
Restriction:
§ An attribute cannot be named id or type
Main concepts
6
Rule
§ By means of rules we can create 'complex'
events from the incoming event.
§ Perseo rules have three mandatory sections:
• name, text and action
{
"name": "blood_rule_update",
"text": "select *,"blood_rule_update" as ruleName
from pattern [every ev=iotEvent(cast(cast(bloodPressure?, String), float)
> 1.0 and type="BloodMeter")]",
"action": {
"type": "update",
"parameters": {
"attributes": [
{
"name": "normal",
"type": "boolean",
"value": "false"
}
]
}}}
Rule
Main concepts
7
Rule text - EPL
§ Based on Esper EPL SQL-like
rules
§ The name of the rule must be
included as ruleName
§ Pattern matching:
• from pattern
• match_recognize
§ Event stream called iotEvent
and named ev
§ We can use predefined
functions, such as cast(),
avg(), etc…
SELECT *, "blood_rule_update" as ruleName
FROM pattern
[every ev=iotEvent(cast(cast(
bloodPressure?, String),float) > 1.0
and type="BloodMeter")]
EPL	using	pattern	clause
SELECT *, "warning_on" as ruleName
FROM iotEvent(type="AirQualityAveraged").win:time(1 minute)
MATCH_RECOGNIZE (
measures A.average? as average
pattern (A B)
define
A as cast(cast(A.average?, String), float) > 180,
B as cast(cast(B.average?, String), float) > 180 and
B.id? != A.id)
EPL	using	match_recognize
Main concepts
8
Rule actions
§ Options:
• Update context broker entity
• SMS
• Email
• HTTP invocation
• Send a tweet
§ We can use placeholders, ${X},
to insert data from the events
"action":{
"type":"update",
"parameters":{
"id":"${id}_mirror",
"attributes": [
{
"name":"abnormal",
"type":"boolean",
"value":"true"
}
]}}
Update	CB	entity	action
"action": {
"type": "sms",
"template": "Meter ${Meter} has pressure ${Pressure}",
"parameters": {
"to": "123456789"
}}
SMS	action
Main concepts
9
Rule actions
§ Options:
• Update context broker entity
• SMS
• Email
• HTTP invocation
• Send a tweet
§ We can use placeholders, ${X},
to insert data from the events
"action": {
"type": "email",
"template": "Meter ${Meter} has pressure ${Pressure}",
"parameters": {
"to": "someone@fiware.eu",
"from": "cep@system.org",
"subject": "It's The End Of The World As We Know
It (And I Feel Fine)"
}
}
Email	action
Main concepts
10
Rule actions
§ Options:
• Update context broker entity
• SMS
• Email
• HTTP invocation
• Send a tweet
§ We can use placeholders, ${X},
to insert data from the events
"action":{
"type":"post",
"template":"BloodPressure is ${BloodPressure}",
"parameters":{
"url": "http://localhost:9182/${type}/${id}",
"method": "PUT",
"headers": {
"Content-type": "text/plain",
"X-${type}-pressure": "${BloodPressure}"
},
"qs": {
"${id}": "${BloodPressure}"
}
}
}
HTTP	action
Main concepts
11
Rule actions
§ Options:
• Update context broker entity
• SMS
• Email
• HTTP invocation
• Send a tweet
§ We can use placeholders, ${X},
to insert data from the events
"action": {
"type": "twitter",
"template": "Meter ${Meter} has pressure ${Pressure}",
"parameters": {
"consumer_key": "xvz1evFS4wEEPTGEFPHBog",
"consumer_secret":
"L8qq9PZyRg6ieKGEKhZolGC0vJWLw8iEJ88DRdyOg",
"access_token_key": "xvz1evFS4wEEPTGEFPHBog",
"access_token_secret":
"L8qq9PZyRg6ieKGEKhZolGC0vJWLw8iEJ88DRdyOg"
}
}
Tweet	action
Hands on!
12
Useful documentation
§ GitHub repos
• Perseo Core: https://github.com/telefonicaid/perseo-core
• Perseo FE: https://github.com/telefonicaid/perseo-fe
§ Docker
• Perseo Core: https://hub.docker.com/r/telefonicaiot/perseo-core/
• Perseo FE: https://hub.docker.com/r/telefonicaiot/perseo-fe/
§ Esper Doc
• http://www.espertech.com/esper/tutorial.php
13
Thank you!
http://fiware.org
Follow @FIWARE on Twitter
14

More Related Content

Similar to FIWARE Tech Summit - Complex Event Processing in FIWARE

Creating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Creating a Context-Aware solution, Complex Event Processing with FIWARE PerseoCreating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Creating a Context-Aware solution, Complex Event Processing with FIWARE PerseoFernando Lopez Aguilar
 
Complex Event Processing - A brief overview
Complex Event Processing - A brief overviewComplex Event Processing - A brief overview
Complex Event Processing - A brief overviewIstván Dávid
 
Complex Event Processor 3.0.0 - An overview of upcoming features
Complex Event Processor 3.0.0 - An overview of upcoming features Complex Event Processor 3.0.0 - An overview of upcoming features
Complex Event Processor 3.0.0 - An overview of upcoming features WSO2
 
jBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developersjBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developersKris Verlaenen
 
S4: Distributed Stream Computing Platform
S4: Distributed Stream Computing PlatformS4: Distributed Stream Computing Platform
S4: Distributed Stream Computing PlatformAleksandar Bradic
 
Don't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesDon't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesJamund Ferguson
 
Complex Event Processing with Esper
Complex Event Processing with EsperComplex Event Processing with Esper
Complex Event Processing with EsperTed Won
 
Software engineering rogers pressman chapter 7
Software engineering rogers pressman chapter 7Software engineering rogers pressman chapter 7
Software engineering rogers pressman chapter 7mohammad hossein Jalili
 
Workflow as code with Azure Durable Functions
Workflow as code with Azure Durable FunctionsWorkflow as code with Azure Durable Functions
Workflow as code with Azure Durable FunctionsMassimo Bonanni
 
I Can See Clearly Now - Observing & understanding your Spring applications at...
I Can See Clearly Now - Observing & understanding your Spring applications at...I Can See Clearly Now - Observing & understanding your Spring applications at...
I Can See Clearly Now - Observing & understanding your Spring applications at...Joris Kuipers
 
Pywps a tutorial for beginners and developers
Pywps a tutorial for beginners and developersPywps a tutorial for beginners and developers
Pywps a tutorial for beginners and developersJorge Mendes
 
Kogito: cloud native business automation
Kogito: cloud native business automationKogito: cloud native business automation
Kogito: cloud native business automationMario Fusco
 
Parallel Complex Event Processing
Parallel Complex Event ProcessingParallel Complex Event Processing
Parallel Complex Event ProcessingKarol Grzegorczyk
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Pythongturnquist
 
Intelligent Monitoring
Intelligent MonitoringIntelligent Monitoring
Intelligent MonitoringIntelie
 
A Tour of PostgREST
A Tour of PostgRESTA Tour of PostgREST
A Tour of PostgRESTbegriffs
 
540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdfhamzadamani7
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthroughmitesh_sharma
 

Similar to FIWARE Tech Summit - Complex Event Processing in FIWARE (20)

Creating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Creating a Context-Aware solution, Complex Event Processing with FIWARE PerseoCreating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Creating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
 
Complex Event Processing - A brief overview
Complex Event Processing - A brief overviewComplex Event Processing - A brief overview
Complex Event Processing - A brief overview
 
Complex Event Processor 3.0.0 - An overview of upcoming features
Complex Event Processor 3.0.0 - An overview of upcoming features Complex Event Processor 3.0.0 - An overview of upcoming features
Complex Event Processor 3.0.0 - An overview of upcoming features
 
Siddhi CEP 2nd sideshow presentation
Siddhi CEP 2nd sideshow presentationSiddhi CEP 2nd sideshow presentation
Siddhi CEP 2nd sideshow presentation
 
jBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developersjBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developers
 
S4: Distributed Stream Computing Platform
S4: Distributed Stream Computing PlatformS4: Distributed Stream Computing Platform
S4: Distributed Stream Computing Platform
 
Don't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesDon't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax Trees
 
Complex Event Processing with Esper
Complex Event Processing with EsperComplex Event Processing with Esper
Complex Event Processing with Esper
 
Software engineering rogers pressman chapter 7
Software engineering rogers pressman chapter 7Software engineering rogers pressman chapter 7
Software engineering rogers pressman chapter 7
 
Workflow as code with Azure Durable Functions
Workflow as code with Azure Durable FunctionsWorkflow as code with Azure Durable Functions
Workflow as code with Azure Durable Functions
 
I Can See Clearly Now - Observing & understanding your Spring applications at...
I Can See Clearly Now - Observing & understanding your Spring applications at...I Can See Clearly Now - Observing & understanding your Spring applications at...
I Can See Clearly Now - Observing & understanding your Spring applications at...
 
Pywps a tutorial for beginners and developers
Pywps a tutorial for beginners and developersPywps a tutorial for beginners and developers
Pywps a tutorial for beginners and developers
 
Kogito: cloud native business automation
Kogito: cloud native business automationKogito: cloud native business automation
Kogito: cloud native business automation
 
Parallel Complex Event Processing
Parallel Complex Event ProcessingParallel Complex Event Processing
Parallel Complex Event Processing
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Python
 
Intelligent Monitoring
Intelligent MonitoringIntelligent Monitoring
Intelligent Monitoring
 
A Tour of PostgREST
A Tour of PostgRESTA Tour of PostgREST
A Tour of PostgREST
 
540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf
 
Deep Dive on AWS IoT
Deep Dive on AWS IoTDeep Dive on AWS IoT
Deep Dive on AWS IoT
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 

More from FIWARE

Behm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptxBehm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptxFIWARE
 
Katharina Hogrebe Herne Digital Days.pdf
 Katharina Hogrebe Herne Digital Days.pdf Katharina Hogrebe Herne Digital Days.pdf
Katharina Hogrebe Herne Digital Days.pdfFIWARE
 
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxChristoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxFIWARE
 
Behm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptxBehm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptxFIWARE
 
Evangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptxEvangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptxFIWARE
 
Lukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptxLukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptxFIWARE
 
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptxPierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptxFIWARE
 
Dennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptxDennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptxFIWARE
 
Ulrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptxUlrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptxFIWARE
 
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptxAleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptxFIWARE
 
Water Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdfWater Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdfFIWARE
 
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptxCameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptxFIWARE
 
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptxFiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptxFIWARE
 
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptxBoris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptxFIWARE
 
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....FIWARE
 
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdfAbdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdfFIWARE
 
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdfFGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdfFIWARE
 
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptxHTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptxFIWARE
 
WE_LoRaWAN _ IoT.pptx
WE_LoRaWAN  _ IoT.pptxWE_LoRaWAN  _ IoT.pptx
WE_LoRaWAN _ IoT.pptxFIWARE
 
EU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptxEU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptxFIWARE
 

More from FIWARE (20)

Behm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptxBehm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptx
 
Katharina Hogrebe Herne Digital Days.pdf
 Katharina Hogrebe Herne Digital Days.pdf Katharina Hogrebe Herne Digital Days.pdf
Katharina Hogrebe Herne Digital Days.pdf
 
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxChristoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
 
Behm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptxBehm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptx
 
Evangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptxEvangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptx
 
Lukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptxLukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptx
 
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptxPierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
 
Dennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptxDennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptx
 
Ulrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptxUlrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptx
 
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptxAleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
 
Water Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdfWater Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdf
 
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptxCameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
 
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptxFiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
 
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptxBoris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
 
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
 
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdfAbdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
 
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdfFGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
 
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptxHTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
 
WE_LoRaWAN _ IoT.pptx
WE_LoRaWAN  _ IoT.pptxWE_LoRaWAN  _ IoT.pptx
WE_LoRaWAN _ IoT.pptx
 
EU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptxEU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptx
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

FIWARE Tech Summit - Complex Event Processing in FIWARE

  • 1. Complex Event Processing in FIWARE Francisco de la Vega fdelavega@fi.upm.es Rafael Fernández rfernandez@ficodes.com
  • 2. Agenda § Overview § Main concepts § Hands on! 1
  • 4. Overview § Perseo is a GE under incubation § Context-aware CEP GE • Listen to events from context information to identify patterns described by rules, and immediately react by triggering actions. • Designed to be NGSI-compliant, and thus, to implement systems that works seamless and jointly with Orion CB. • Based on Esper CEP § It is focused on Complex Event Processing, not on Stream Processing. • It defines a rule (query) engine, not a graph engine. □ No need to write code • Rules are set using SQL-like queries (EPL) § It defines a simplified version of the CEP GE Open Specification and Architecture. • Uses NGSI as communication protocol for events • Follows a PUSH model (CB pushes events on it) 3
  • 5. Main concepts 4 Notice vs Event § Notifications or notices from Context Broker are processed by Perseo before being sent to perseo-core (Esper) as events. § They correspond to changes in the values of an attribute of an entity to which Perseo is susbcribed to. { "subscriptionId": "51c04a21d714fb3b37d7d5a7", "originator": "localhost", "contextResponses": [ { "contextElement": { "attributes": [ { "name": "BloodPressure", "type": "centigrade", "value": "2" }, { "name": "TimeInstant", "type": "urn:x-ogc:def:trs:IDAS:1.0:ISO8601", "value": "2014-04-29T13:18:05Z" } ], "type": "BloodMeter", "isPattern": "false", "id": "bloodm1" }, "statusCode": { "code": "200", "reasonPhrase": "OK" } } ] } Notice
  • 6. Main concepts 5 Notice vs Event § Notifications or notices from Context Broker are processed by Perseo before being sent to perseo-core (Esper) as events. § They correspond to changes in the values of an attribute of an entity to which Perseo is susbcribed to. { "noticeId":"a64fa410-8aad-11e4-87e4-632f5115a641", "id":"bloodm1", "type":"BloodMeter", "isPattern":"false", "service":"/", "tenant":"unknown", "BloodPressure":"2", "BloodPressure__type":"centigrade", "TimeInstant":"2014-04-29T13:18:05Z", "TimeInstant__type":"urn:x-ogc:def:trs:IDAS:1.0:ISO8601" } Event Restriction: § An attribute cannot be named id or type
  • 7. Main concepts 6 Rule § By means of rules we can create 'complex' events from the incoming event. § Perseo rules have three mandatory sections: • name, text and action { "name": "blood_rule_update", "text": "select *,"blood_rule_update" as ruleName from pattern [every ev=iotEvent(cast(cast(bloodPressure?, String), float) > 1.0 and type="BloodMeter")]", "action": { "type": "update", "parameters": { "attributes": [ { "name": "normal", "type": "boolean", "value": "false" } ] }}} Rule
  • 8. Main concepts 7 Rule text - EPL § Based on Esper EPL SQL-like rules § The name of the rule must be included as ruleName § Pattern matching: • from pattern • match_recognize § Event stream called iotEvent and named ev § We can use predefined functions, such as cast(), avg(), etc… SELECT *, "blood_rule_update" as ruleName FROM pattern [every ev=iotEvent(cast(cast( bloodPressure?, String),float) > 1.0 and type="BloodMeter")] EPL using pattern clause SELECT *, "warning_on" as ruleName FROM iotEvent(type="AirQualityAveraged").win:time(1 minute) MATCH_RECOGNIZE ( measures A.average? as average pattern (A B) define A as cast(cast(A.average?, String), float) > 180, B as cast(cast(B.average?, String), float) > 180 and B.id? != A.id) EPL using match_recognize
  • 9. Main concepts 8 Rule actions § Options: • Update context broker entity • SMS • Email • HTTP invocation • Send a tweet § We can use placeholders, ${X}, to insert data from the events "action":{ "type":"update", "parameters":{ "id":"${id}_mirror", "attributes": [ { "name":"abnormal", "type":"boolean", "value":"true" } ]}} Update CB entity action "action": { "type": "sms", "template": "Meter ${Meter} has pressure ${Pressure}", "parameters": { "to": "123456789" }} SMS action
  • 10. Main concepts 9 Rule actions § Options: • Update context broker entity • SMS • Email • HTTP invocation • Send a tweet § We can use placeholders, ${X}, to insert data from the events "action": { "type": "email", "template": "Meter ${Meter} has pressure ${Pressure}", "parameters": { "to": "someone@fiware.eu", "from": "cep@system.org", "subject": "It's The End Of The World As We Know It (And I Feel Fine)" } } Email action
  • 11. Main concepts 10 Rule actions § Options: • Update context broker entity • SMS • Email • HTTP invocation • Send a tweet § We can use placeholders, ${X}, to insert data from the events "action":{ "type":"post", "template":"BloodPressure is ${BloodPressure}", "parameters":{ "url": "http://localhost:9182/${type}/${id}", "method": "PUT", "headers": { "Content-type": "text/plain", "X-${type}-pressure": "${BloodPressure}" }, "qs": { "${id}": "${BloodPressure}" } } } HTTP action
  • 12. Main concepts 11 Rule actions § Options: • Update context broker entity • SMS • Email • HTTP invocation • Send a tweet § We can use placeholders, ${X}, to insert data from the events "action": { "type": "twitter", "template": "Meter ${Meter} has pressure ${Pressure}", "parameters": { "consumer_key": "xvz1evFS4wEEPTGEFPHBog", "consumer_secret": "L8qq9PZyRg6ieKGEKhZolGC0vJWLw8iEJ88DRdyOg", "access_token_key": "xvz1evFS4wEEPTGEFPHBog", "access_token_secret": "L8qq9PZyRg6ieKGEKhZolGC0vJWLw8iEJ88DRdyOg" } } Tweet action
  • 14. Useful documentation § GitHub repos • Perseo Core: https://github.com/telefonicaid/perseo-core • Perseo FE: https://github.com/telefonicaid/perseo-fe § Docker • Perseo Core: https://hub.docker.com/r/telefonicaiot/perseo-core/ • Perseo FE: https://hub.docker.com/r/telefonicaiot/perseo-fe/ § Esper Doc • http://www.espertech.com/esper/tutorial.php 13