Rule-based Modeling of Mashups

955 views

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
955
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
34
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Rule-based Modeling of Mashups

  1. 1. Rule-based Modeling of Mashups Adrian Giurca Emilian Pascalau
  2. 2. Web 1.0, Web 2.0, Web 3.0?
  3. 3. Server-side Rule-based Mashups as Services Orchestration (1) <ul><ul><li>Various (REST) services are orchestrated server-side </li></ul></ul><ul><ul><li>Rules define the orchestration </li></ul></ul><ul><ul><li>User agent interacts with the Mashup Server typically with Ajax techniques </li></ul></ul><ul><ul><ul><li>With the Mashup Web Server </li></ul></ul></ul><ul><ul><ul><li>With the Mashup Rule Repo </li></ul></ul></ul><ul><ul><li>Various rules repositories. Rules can be shared </li></ul></ul><ul><ul><li>By changing the rules users can customize the mashup </li></ul></ul>
  4. 4. Server-side Rules-based Mashups with Widgets <ul><ul><li>Remember iGoogle and its Gadgets? </li></ul></ul><ul><ul><li>Widget dependency can be implemented server-side with rules in the Widget Runner . </li></ul></ul><ul><ul><li>User agent interacts with the Services via Mashup Server using Widgets from the browser (typically Ajax). </li></ul></ul><ul><ul><li>Various rules repositories. Rules can be shared </li></ul></ul><ul><ul><li>By changing the rules users can customize the mashup . </li></ul></ul>
  5. 5. Client-side Rule-based Mashups w/o Widgets <ul><ul><li>Various (REST) services are orchestrated client-side </li></ul></ul><ul><ul><li>Rules define the orchestration </li></ul></ul><ul><ul><li>User agent interacts directly with the services typically with Ajax techniques </li></ul></ul><ul><ul><li>Various rules repositories. Rules can be shared </li></ul></ul><ul><ul><li>By changing the rules users can customize the mashup </li></ul></ul>
  6. 6. Client-side Rule-based Mashups and Widgets <ul><ul><li>Widget dependency can be implemented client-side with rules . </li></ul></ul><ul><ul><li>User agent interacts </li></ul></ul><ul><ul><ul><li>with the Mashup Server using Widgets from the browser. </li></ul></ul></ul><ul><ul><ul><li>directly with the services </li></ul></ul></ul><ul><ul><li>User interact with rule repos (using JSON Rules built-ins). </li></ul></ul><ul><ul><li>By changing the rules users can customize the mashup . </li></ul></ul>
  7. 7. A Use Case: <ul><ul><li>Capturing user activity </li></ul></ul><ul><ul><ul><li>As already stated in previous slides based on user’s activity new information could be provided, offers could be provided and so forth. </li></ul></ul></ul>
  8. 8. Business Rules <ul><ul><li>R1: When the mouse is over the Handbook of rules image, resize the image; if mouse out resize image to initial size. </li></ul></ul><ul><ul><li>R2: If the user clicks on Publications open the link in a new window. </li></ul></ul><ul><ul><li>R3: Anytime a link is clicked append the clicked link to a list. </li></ul></ul><ul><ul><li>R4: If the mouse is over a publication entry extract the RDFa triple associated with it. </li></ul></ul>
  9. 9. Implementing Rules (1) { &quot;id&quot;: &quot;rule102&quot;, &quot;priority&quot;: 1, &quot;appliesTo&quot;: [&quot;http://localhost/example/&quot;], &quot;eventExpression&quot;:{ &quot;type&quot;:&quot;mouseover&quot;, &quot;target&quot;$X&quot;, }, &quot;condition&quot;: [ &quot;$X: HTMLImageElement( src=='index_files/34422.jpg‘ )&quot; ], &quot;actions&quot;:[ &quot;resizeImage(&quot;$X&quot;,200,300) ] } function resizeImage(elem,width,height){ try{ elem.setAttribute(&quot;width&quot;,width); elem.setAttribute(&quot;height&quot;,height); }catch(e){ alert(e); } } Assuming the DOM contains the following: <img src=&quot;index_files/34422.jpg&quot; width=&quot;72&quot; height=&quot;96&quot;> We can write the rule: When we hover with the mouse over this image element resize the image .
  10. 10. Implementing Rules (2) {&quot;id&quot;: &quot;rule104&quot;, &quot;priority&quot;: 1, &quot;appliesTo&quot;:[&quot;http://localhost/example/&quot;], &quot;eventExpression&quot;:{ &quot;type&quot;:&quot;click&quot;, &quot;target&quot;:&quot;$X&quot; } , &quot;condition&quot;:[ &quot;$X:HTMLAnchorElement (href==‘http://www.informatik.tu-cottbus.de/%7Eagiurca/Publications.htm’, $Y:href)&quot; ], &quot;actions&quot;:[ &quot;openPublications($currentEvent,$Y)&quot; ] }
  11. 11. A Simple Execution Flow … Object _name=$currentEvent _value=Event click Current Variable: $X … evaluatePropertyRestriction … property Binding - using hasAttribute: href … actionToFire openPublications
  12. 12. Summary <ul><ul><li>Rule-based Mashups can be implemented both server-side and client-side </li></ul></ul><ul><ul><li>Widgets dependency can be rule-based </li></ul></ul><ul><ul><li>Interacting with rule repositories enrich users with mashup customization capabilities </li></ul></ul><ul><ul><li>Running client-side mashups reduce the user dependency of dedicated mashup servers </li></ul></ul><ul><ul><li>Running client-side mashups permit users to keep their rules (part of the mashup behavior) on their own silos (including on their local machine) </li></ul></ul>

×