TAKE – A Derivation Rule Compiler for Java Jens Dietrich, Massey University Jochen Hiller, TopLogic Bastian Schenke, BTU Cottbus.

Slides:



Advertisements
Similar presentations
Dr. Leo Obrst MITRE Information Semantics Information Discovery & Understanding Command & Control Center February 6, 2014February 6, 2014February 6, 2014.
Advertisements

Pulan Yu School of Informatics Indiana University Bloomington Web service based Varuna.Net.
Lecture plan Information retrieval (from week 11)
CF and JSP/Servlets Developed originally by Robi Sen For the CF UnderGround II Seminar, Apr 2001 Edited and enhanced by Charlie Arehart (Robi had an emergency.
Personalized Navigation in the Semantic Web: An Enhanced Faceted Browser Michal Tvarožek FIIT STU BA.
Java Script Session1 INTRODUCTION.
Building Localized Applications with Microsoft.NET Framework and Visual Studio.NET Achim Ruopp International Program Manager Microsoft Corp.
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
G O B E Y O N D C O N V E N T I O N WORF: Developing DB2 UDB based Web Services on a Websphere Application Server Kris Van Thillo, ABIS Training & Consulting.
1 PROJECT Web-based Database Applications Lecture 1: Basic Internet Concepts & Databases - the History.
PHP CSCE 330 February 6, 2003 Group Members: Antwan B. Phan George Hwang Luat Vu Programming Language Presentation.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Multiple Tiers in Action
Dynamic Web Pages Bert Wachsmuth. Review  Internet, IP addresses, ports, client-server, http, smtp  HTML, XHTML, XML  Style Sheets, external, internal,
Leveraging User Interactions for In-Depth Testing of Web Applications Sean McAllister, Engin Kirda, and Christopher Kruegel RAID ’08 1 Seoyeon Kang November.
Inventory Management System With Berkeley DB 1. What is Berkeley DB? Berkeley DB is an Open Source embedded database library that provides scalable, high-
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
Virtual techdays INDIA │ august 2010 Building ASP.NET applications using SQL Server Compact Chaitanya Solapurkar │ Partner Technical Consultant,
Platform as a Service (PaaS)
Google AppEngine. Google App Engine enables you to build and host web apps on the same systems that power Google applications. App Engine offers fast.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
Web Application Architecture and Communication. Displaying a Web page in a Browser
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Distributed Shared Memory Systems and Programming
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
M i SMob i S Mob i Store - Mobile i nternet File Storage Platform Chetna Kaur.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
Extending ArcGIS for Server
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 2: Major Concepts of Programming.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Andrew S. Budarevsky Adaptive Application Data Management Overview.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
What is SAM-Grid? Job Handling Data Handling Monitoring and Information.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Java: An Overview John R Durrett Texas Tech University.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
© 2006, National Research Council Canada © 2006, IBM Corporation Solving performance issues in OTS-based systems Erik Putrycz Software Engineering Group.
TAKE – A Derivation Rule Compiler for Java Jens Dietrich, Massey University Jochen Hiller, TopLogic Bastian Schenke, BTU Cottbus/REWERSE.
Search Engine using Web Mining COMS E Web Enhanced Information Mgmt Prof. Gail Kaiser Presented By: Rupal Shah (UNI: rrs2146)
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
Clusterpoint Margarita Sudņika ms RDBMS & NoSQL Databases & tables → Document stores Columns, rows → Schemaless documents Scales UP → Scales UP.
"Data sources index" a web application to list projects in Hadoop Luca Menichetti.
Raluca Paiu1 Semantic Web Search By Raluca PAIU
By: Chad Gallati, Melissa Plakyda, Jenny Wilkes References: /a-z_programming_languages_groovy/
Apache Cocoon – XML Publishing Framework 데이터베이스 연구실 박사 1 학기 이 세영.
XML and Distributed Applications By Quddus Chong Presentation for CS551 – Fall 2001.
Lecture Transforming Data: Using Apache Xalan to apply XSLT transformations Marc Dumontier Blueprint Initiative Samuel Lunenfeld Research Institute.
Towards a High Performance Extensible Grid Architecture Klaus Krauter Muthucumaru Maheswaran {krauter,
CIS 375 Bruce R. Maxim UM-Dearborn
Platform as a Service (PaaS)
Platform as a Service (PaaS)
Introduction to PHP FdSc Module 109 Server side scripting and
Open Source distributed document DB for an enterprise
Spark Presentation.
PHP / MySQL Introduction
Data, Databases, and DBMSs
Web Development Using ASP .NET
Cloud Web Filtering Platform
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
LOD reference architecture
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

TAKE – A Derivation Rule Compiler for Java Jens Dietrich, Massey University Jochen Hiller, TopLogic Bastian Schenke, BTU Cottbus

Why Derivation Rules ● Query driven. ● Well defined semantics. ● Non state changing. ● Easy integration into pull based applications (http requests, DB queries). ● No need to replicate (keep and keep up-to-date) facts in memory – fetch as needed, cache if you want ● Good scalability in scenarios with large fact bases and small or medium sized (up to thousands) rule bases.

Rule Engines vs Rule Compilers ● Rule Engine: interpret rules at runtime. ● Rule compiler: convert rules into executable code. ● Advantages: speed + free verification by underlying (Java) compiler. ● Disadvantage: compilation happens at build time - application must be redeployed if rules change. ● But: runtime compilation and deployment is possible and supported by standards (JSR-199). ● Example: web servers supporting server pages.

Compilation TAKE domain model Java Source Java bytecode platform code TAKE scripts rule markup knowledge sources TAKE compiler Java compiler JVM

Deployment Option1 1.Compile rules into classes 2.Build application 3.Deploy application Option1 1.Compile rules into interfaces 2.Build application 3.Deploy application 4.Compile rules into classes 5.Deploy rules into running applications

Writing Rules ● TAKE scripting language – easy to use, slightly prologish ● TAKE R2ML adapter (beta) – imports rules from REWERSE R2ML markup language

TAKE scripts ● Java type references ● Java object references (by name, must be bound) ● global (rule base) and local (rule) annotation ● Aggregations ● Queries

TAKE example // example dietrich var example.nz.org.take.compiler.eurent.RentalCar car var example.nz.org.take.compiler.eurent.Rental rental var @take.compilerhint.method=isAvailable10 query availableAt[in,out] // rules rule1: if storedAt[car,branch] and not isScheduledForService[car] and not assignedTo[car,rental] then availableAt[car,branch] variables, types are Java classes annotations (meta data) more annotations, names used by compiler query, defines the public methods to be generated rule

Generated Code ● Generates simple PLOJO classes for predicates. ● Central main class with interface for queries. ● Actual code in fragment classes referenced by main query class for scalability. ● Call backs to Java methods in domain model. ● Large parts of the generated code are template based.

Generated Data Structure public class IsAvailable { public example.nz.org.take.compiler.eurent.RentalCar car; public example.nz.org.take.compiler.eurent.Branch branch; public IsAvailable() { super(); } ● PLOJOs are generated for all referenced predicates

The Resource Iterator Pattern ● Iterator - GangOf4 pattern – iterate over collections without knowing their internals ● Resource Iterator – Iterator + close – suitable to iterate over resources not necessarily available in memory (fetch as needed) ● Performance can be boosted by caching and background prefetching if needed ● Structure: ● hasNext() - is there more? ● next() - get next item ● close() - close connection to source supplying items

External Fact Stores ● Describe where facts are supplied by external resources like databases and web services. ● Compiler will generate interface that produces iterators. ● Interfaces can be implemented to access facts. ● Bound to implementation when compilation takes place.

Query API ● Iterator based– pull results as needed. ● (Asynchronous) prefetching can be achieved by wrapping. ● Iterators have additional close method. Semantics: release external resources (network + db connections) ● Iterators are called “ResultSets” ● result sets have API to extract rules used

Generated Query API public class KB { public Map getAnnotations(String id) {..} public Map getAnnotations() {..} public ResultSet isAvailable10(RentalCar car) {.. } name can be set in annotation runtime access to annotations method generated for query, ResultSet is iterator

Generated Code ● Use Iterator “algebra” ● Multiple rules supporting the same query – use chained iterator ● Evaluate prerequisites within a rule – use nested iterators ● Single supporting fact – use singleton iterator ● false – use empty iterator

Generated Code (ctd) public query wrapper TAKE internals - clustering domain model call backs

Semantic Reflection ● Generated code is reflective ● Information about rules used to generate application is accessible at runtime ● Similar to reflection is OO – but reflection is only about syntax ● API keeps not rules but only rule ids, and supports querying meta data by id ● examples: creator, date modified, description.. standard vocabularies (DC) should be used ● addresses many business use cases, such as tracing code to requirements ● alternative to dominating black box principle

Example: Application API RentalCar c =...; Branch b =...; Rental r =...; KB kb = new KB(); ResultSet rs = kb.isAvailable10(c); IsAvailable result = rs.next(); List log = rs.getDerivationLog(); System.out.println(result.branch.getName()); for (DerivationLogEntry e:log) { Map annotations = kb.getAnnotations(e.getName()); if (annotations!=null){ System.out.println(annotations.get("take.auto.date")); System.out.println(annotations.get("take.auto.creator")); System.out.println(annotations.get("take.auto.tostring")); }

Validation ● UServ Product Derby Case Study ● execute by clicking on link on TAKE home page ● 69 rules -> 111 source code files, 354 classes ● Compilation takes 2567 ms on a system with a 2.0GH T5600 dual core processor, 2.0GB of RAM running on Ubuntu 7.10 with Java 1.6. ● Handicaps: logging and code pretty printing enabled

Using TAKE Project Home: Subversion: Example App (WebStart): License: LGPL