SlideShare une entreprise Scribd logo
1  sur  22
JSON Rules Language Adrian Giurca
Goals ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Main Requirements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Short Roadmap (1)   Adrian Giurca and Emilian Pascalau.  JSON Rules . In G. J. Nalepa and J. Baumeister (Eds.) Proceedings of  4th Knowledge Engineering and Software Engineering ,  KESE 2008 , collocated with  KI 2008 , September 23, 2008, Kaiserlautern, Germany,  CEUR vol 425 .  (2)   JSON Rules  on  Web Technologies Wiki (3)   Emilian Pascalau, Adrian Giurca.  Towards enabling SaaS for Business Rules . In  Proceedings of The International Workshop on Intelligent Service Management ( ISM2009 ) , Lecture Notes in Informatics (LNI) Vol. P-147, pp. 207-222, collocated with  Sabre 2009 , March 23-24, 2009, Leipzig, Germany.  (4)   See  http://code.google.com/p/jsonrules   (5)   Emilian Pascalau, Adrian Giurca. A Lightweight Architecture of an ECA Rule Engine for Web Browsers. In  Proceedings of 5th Knowledge Engineering and Software Engineering,  KESE 2009 , collocated with  KI 2009 . September 15, 2009, Paderborn, Germany. (6)   Emilian Pascalau, Adrian Giurca. JSON Rules - The JavaScript Rule Engine .  Software demo  at Knowledge Engineering and Software Engineering,  KESE 2009 , September 15, 2009, Paderborn, Germany. (7)   Emilian Pascalau, Adrian Giurca. A Rule-Based Approach of Creating and Executing Mashups . 9th IFIP Conference on e-Business, e-Services, and e-Society, (I3E 2009). September 23-25, 2009, Nancy, France. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Event-Condition-Action (ECA) Rules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],{ "id":"rule101",  "appliesTo": ["http://www.yahoo.com", "http://www.google.com/"], "eventExpression": { "eventType": "click", "eventTarget": "$X" },  "conditions": [  "$X:HTMLElement( class == 'note', $Y:firstChild)",  "$Y.tagName == 'ul'" ],  "actions": ["changeBackground($Y, 'blue')"]  }
Event Expressions (1) ,[object Object],[object Object],[object Object]
Event Expressions (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Supported Event Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Logic of JSON Rule Event Expressions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
JSONTerm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Conditions (1)
JavaScript Boolean Conditions document.getElementById($id).nodeValue == 10 cart.totalAmount() > 150
XPath conditions { "variable":{"name":"$X"}, "xPath":"html//table//tr" } { "node":{"nodeValue":"JSON Rules"}, "xPath": /store/book[23]/title" } {"node":{ "nodeName":"tr", "firstChild":{  "nodeName":"td", "textContent":"T2:row1, cell 1" } }, "xPath": "html//table//tr" }
Descriptions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
More on Descriptions $N:Input(  id==&quot;postalCode&quot;, nodeValue==RegExp(&quot;/^{5}$/&quot;) ) (The pattern will bound the variable  $N  to  the  <input>  element with  id=&quot;postalCode&quot;   if the value of this element is a 5 digit  number) ,[object Object]
Built-ins ,[object Object],[object Object],[object Object]
Rule Actions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
More on Rule Actions ,[object Object],PRR Standard Actions  JSON Rules   Example   AssignExp change properties of an element document.getElementById('Item25').setAttribute('class', 'note') InvokeExp JavaScript function call alert(message) AssertExp  insert a DOM node document.insertBefore(child, newChild) RetractExp remove a DOM node removeChild(child) UpdateExp update a DOM node replaceChild(newChild, oldChild)
Intelligent and adaptive Web user interfaces ,[object Object],[object Object],[object Object],Whenever the user clicks more than 3 times the same menu item add this item to the fast access menu items. { &quot;id&quot;:&quot;fast101&quot;,  &quot;appliesTo&quot;:[&quot;http://www.example.com&quot;&quot;], &quot;eventExpression&quot;:{ &quot;eventType&quot;:&quot;click&quot;, &quot;eventTarget&quot;:&quot;$X&quot;},  &quot;conditions&quot;: [  &quot;$X:A( $Id:id, class = = 'menuItem')&quot;,  &quot;count(&quot;click&quot;,$Id) >= 3&quot; ],  &quot;actions&quot;: [&quot;fastMenu('add',$X)&quot;]  }
Implement Web Business Processes If the user loads financial news, offers him a three months subscription to Financial Times { &quot;id&quot;:&quot;fast101&quot;,  &quot;appliesTo&quot;:['http://www.example.com'&quot;], &quot;eventExpression&quot;:{&quot;eventType&quot;:&quot;DOMNodeInserted&quot;, &quot;eventTarget&quot;:&quot;$X&quot;},  &quot;conditions&quot;: [  &quot;$Y:Div(id == 'currentFeedContent')&quot;, &quot;$X:Div(?Y:relatedNode, $Z:childNodes)&quot;,  &quot;$C:Div(class='itemcontent')&quot;, &quot;org.jsonrules.builtin.pred.member($C, $Z)&quot;, &quot;$C.firstChild.nodeValue=='businessNews'&quot; ],  &quot;actions&quot;: [&quot;showAdd({&quot;s&quot;:&quot;ft&quot;,&quot;d&quot;:&quot;3&quot;,&quot;p&quot;:&quot;30&quot;})&quot;]  }
JSON Rules in JSON Notation ,[object Object],[object Object],$X:HTMLElement(  class == 'note',  $Y:firstChild )  {&quot;description&quot;:{ &quot;type&quot;:&quot;HTMLElement&quot;,  &quot;binding&quot;:{ &quot;variable&quot;:{&quot;name&quot;:&quot;$X&quot;}}, &quot;constraints&quot;:[{  &quot;propertyRestriction&quot;:{  &quot;property&quot;:&quot;class&quot;, &quot;operator&quot;:&quot;EQ&quot;, &quot;value&quot;:&quot;note&quot; } }, {&quot;propertyBinding&quot;:{ &quot;property&quot;:&quot;firstChild&quot;, &quot;variable&quot;:{&quot;name&quot;:&quot;$Y&quot;} } }] } }
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Tendances

Building @Anywhere (for TXJS)
Building @Anywhere (for TXJS)Building @Anywhere (for TXJS)
Building @Anywhere (for TXJS)
danwrong
 
Boom! Promises/A+ Was Born
Boom! Promises/A+ Was BornBoom! Promises/A+ Was Born
Boom! Promises/A+ Was Born
Domenic Denicola
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
tutorialsruby
 
VPN Access Runbook
VPN Access RunbookVPN Access Runbook
VPN Access Runbook
Taha Shakeel
 
Pushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax WPushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax W
rajivmordani
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it means
Robert Nyman
 

Tendances (20)

The evolution of asynchronous javascript
The evolution of asynchronous javascriptThe evolution of asynchronous javascript
The evolution of asynchronous javascript
 
Ajax
AjaxAjax
Ajax
 
Web sockets Introduction
Web sockets IntroductionWeb sockets Introduction
Web sockets Introduction
 
Building @Anywhere (for TXJS)
Building @Anywhere (for TXJS)Building @Anywhere (for TXJS)
Building @Anywhere (for TXJS)
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
Boom! Promises/A+ Was Born
Boom! Promises/A+ Was BornBoom! Promises/A+ Was Born
Boom! Promises/A+ Was Born
 
Android and REST
Android and RESTAndroid and REST
Android and REST
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
VPN Access Runbook
VPN Access RunbookVPN Access Runbook
VPN Access Runbook
 
RicoAjaxEngine
RicoAjaxEngineRicoAjaxEngine
RicoAjaxEngine
 
Testing RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured frameworkTesting RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured framework
 
Web II - 02 - How ASP.NET Works
Web II - 02 - How ASP.NET WorksWeb II - 02 - How ASP.NET Works
Web II - 02 - How ASP.NET Works
 
Pushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax WPushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax W
 
JavaScript Best Pratices
JavaScript Best PraticesJavaScript Best Pratices
JavaScript Best Pratices
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it means
 
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
 
Keeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and WebpackKeeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and Webpack
 
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time MessagingAsynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
 
Android dev 3
Android dev 3Android dev 3
Android dev 3
 
ASP.NET 02 - How ASP.NET Works
ASP.NET 02 - How ASP.NET WorksASP.NET 02 - How ASP.NET Works
ASP.NET 02 - How ASP.NET Works
 

Similaire à JSON Rules Language

Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
dominion
 
An Introduction to Ajax Programming
An Introduction to Ajax ProgrammingAn Introduction to Ajax Programming
An Introduction to Ajax Programming
hchen1
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
george.james
 
BarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social HackathonBarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social Hackathon
marvin337
 

Similaire à JSON Rules Language (20)

CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
 
Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007
 
Itemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integrationItemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integration
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
Building Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltBuilding Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan Diebolt
 
Mazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsMazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml Tools
 
Implementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoCImplementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoC
 
Ajax
AjaxAjax
Ajax
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
 
An Introduction to Ajax Programming
An Introduction to Ajax ProgrammingAn Introduction to Ajax Programming
An Introduction to Ajax Programming
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax Introduction
 
Buenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationBuenos Aires Drools Expert Presentation
Buenos Aires Drools Expert Presentation
 
Javazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicJavazone 2010-lift-framework-public
Javazone 2010-lift-framework-public
 
RomaFramework Tutorial Basics
RomaFramework Tutorial BasicsRomaFramework Tutorial Basics
RomaFramework Tutorial Basics
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
HTML5
HTML5HTML5
HTML5
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
BarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social HackathonBarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social Hackathon
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
 
Javascript
JavascriptJavascript
Javascript
 

Plus de giurca (12)

Microdata for Dummies
Microdata for DummiesMicrodata for Dummies
Microdata for Dummies
 
From Data to Knowledge thru Grailog Visualization
From Data to Knowledge thru Grailog VisualizationFrom Data to Knowledge thru Grailog Visualization
From Data to Knowledge thru Grailog Visualization
 
Rule-based Modeling of Mashups
Rule-based Modeling of MashupsRule-based Modeling of Mashups
Rule-based Modeling of Mashups
 
Mashups and Web Services
Mashups and Web ServicesMashups and Web Services
Mashups and Web Services
 
Building Intelligent Mashups
Building Intelligent MashupsBuilding Intelligent Mashups
Building Intelligent Mashups
 
Mashups as Collection of Widgets
Mashups as Collection of WidgetsMashups as Collection of Widgets
Mashups as Collection of Widgets
 
Introduction to visual rules modeling
Introduction to visual rules modelingIntroduction to visual rules modeling
Introduction to visual rules modeling
 
Introduction to Rule-based Applications
Introduction to  Rule-based ApplicationsIntroduction to  Rule-based Applications
Introduction to Rule-based Applications
 
Intelligent Mashups
Intelligent MashupsIntelligent Mashups
Intelligent Mashups
 
Introduction to Drools
Introduction to DroolsIntroduction to Drools
Introduction to Drools
 
Semantic Pipes and Semantic Mashups
Semantic Pipes and Semantic MashupsSemantic Pipes and Semantic Mashups
Semantic Pipes and Semantic Mashups
 
Annotating with RDFa
Annotating with RDFaAnnotating with RDFa
Annotating with RDFa
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

JSON Rules Language

  • 1. JSON Rules Language Adrian Giurca
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 12. JavaScript Boolean Conditions document.getElementById($id).nodeValue == 10 cart.totalAmount() > 150
  • 13. XPath conditions { &quot;variable&quot;:{&quot;name&quot;:&quot;$X&quot;}, &quot;xPath&quot;:&quot;html//table//tr&quot; } { &quot;node&quot;:{&quot;nodeValue&quot;:&quot;JSON Rules&quot;}, &quot;xPath&quot;: /store/book[23]/title&quot; } {&quot;node&quot;:{ &quot;nodeName&quot;:&quot;tr&quot;, &quot;firstChild&quot;:{ &quot;nodeName&quot;:&quot;td&quot;, &quot;textContent&quot;:&quot;T2:row1, cell 1&quot; } }, &quot;xPath&quot;: &quot;html//table//tr&quot; }
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Implement Web Business Processes If the user loads financial news, offers him a three months subscription to Financial Times { &quot;id&quot;:&quot;fast101&quot;, &quot;appliesTo&quot;:['http://www.example.com'&quot;], &quot;eventExpression&quot;:{&quot;eventType&quot;:&quot;DOMNodeInserted&quot;, &quot;eventTarget&quot;:&quot;$X&quot;}, &quot;conditions&quot;: [ &quot;$Y:Div(id == 'currentFeedContent')&quot;, &quot;$X:Div(?Y:relatedNode, $Z:childNodes)&quot;, &quot;$C:Div(class='itemcontent')&quot;, &quot;org.jsonrules.builtin.pred.member($C, $Z)&quot;, &quot;$C.firstChild.nodeValue=='businessNews'&quot; ], &quot;actions&quot;: [&quot;showAdd({&quot;s&quot;:&quot;ft&quot;,&quot;d&quot;:&quot;3&quot;,&quot;p&quot;:&quot;30&quot;})&quot;] }
  • 21.
  • 22.