Sei sulla pagina 1di 45

CHAPTER 1 INTRODUCTION 1.

1 ABOUT THE PROJECT The main aim of this project is to automatically decompose any XQuery queryincluding updating queries specified by the XQuery Update Facility (XQUF)into sub queries, that can be executed near their data sources.The main challenge addressed here is to ensure that the decomposed queries properly respect XML node identity and preserve structural properties, when (parts of) XML nodes are sent over the network, effectively copying them. We start by precisely characterizing the conditions, under which pass-by-value parameter passing causes semantic differences between remote execution of an XQuery expression and its local execution. We then formulate a conservative strategy that effectively avoids decomposition in such cases. To broaden the possibilities of query distribution, we extend the pass-by-value semantics to a pass-by-fragment semantics, which keeps better track of node identities and structural properties. The pass-byfragment semantics is subsequently refined to pass-by projection semantics by means of a novel runtime XML projection technique, which safely eliminates most semantic differences between the local and remote execution of an XQuery expression, and strongly reduces message sizes. Finally, we discuss how these techniques can be used for updating queries, both under the standard W3C XQUF specification, as well as under an extended semantics that allows updating remote documents. The proposed techniques are implemented in XRPC, a simple yet efficient XQuery extension that enables function-shipping by adding a Remote
1

Procedure Call mechanism to XQuery. Experiments on MonetDB/XQuery establish the performance potential of our XQuery decomposition techniques. 1.2 LITERATURE SURVEY It illustrates the ways to decompose any XQUERY query that consults multiple XML documents residing on multiple peers into subqueries that can be executed on those peers, i.e., function shipping. In principle, we do not want to restrict the form of these queries in any significant way: the full W3C recommended XQUERY language including its XQUF extension is the starting point of our decomposition. Our only requirement for peers to participate is running an XML database system (XDBMS) that complies with these W3C recommendations. The goal of this paper is to exploit the computational power of heterogeneous XML engines on the Web to jointly execute XQUERY and XQUF queries. XQUERY already allows queries over distributed sources through its support for W3C standards, in particular, the ability to open any document on the Web through its fn: doc (URI) builtin function. However, the execution model implied by those W3C standards (e.g., HTTP) is data shipping: a full XML document is transported from a remote peer to the querying peer. It is well known that in many cases this is suboptimal. For instance, an aggregation query on a huge remote XML document that produces only a small result, incurs much less network cost when the aggregation is computed remotely (function shipping) than when the huge XML is shipped to the querying peer (data shipping). Decomposing queries to address multiple data sources is a wellstudied optimization problem in relational, object-oriented and semi
2

structured databases. While it is natural (and correct) to assume that many of the existing techniques can be carried over, the XML data model and the XQUERY language introduce a number of particular challenges not met elsewhere, that revolve around XML node identities and structural (rather than value-based) relationships between nodes. Previous work on distributed XML only focused on a restricted subset of XQUERY queries, and did not address the problem of transparent query decomposition, such that these challenges did not arise. We therefore have to explore the challenges that doesnt met before. 1. P. Boncz et al., MonetDB/XQuery: A Fast XQuery Processor Powered by a Relational Engine, Proc. ACM SIGMOD, 2006. MonetDB/XQuery, an XML database system that fully supports the W3C XQuery language. It consists of the Pathfinder XQuery compiler on top of the MonetDB RDBMS, both for real use and as a research and experimentation platform under a nonrestrictive open-source license. This system is a purely relational engine in the sense that it does not strictly require any XML storage nor query execution extensions. In this sense, Pathfinder could be deployed on top of any RDBMS. This system implements all essential XML database functionalities (rather than a single feature) such that we can learn from the full consequences of our architectural decisions. The specific contributions of this paper: Is to show that the relational XQuery paradigm can indeed leverage the power of mature relational database technology to deliver speed and scalability in the XML domain. Specifically, this system stores XML and manipulates XQuery sequence
3

data purely using relational algebra on relational tables, without data type extensions or changes to the RDBMS storage manager. 2. Serge Abiteboul, Omar Benjelloun, Bogdan Cautis, Ioana Manolescu, Tova Milo, Nicoleta Preda, Lazy Query Evaluation for Active XML 2004 The increasing popularity of XML and Web services has recently promoted XML documents with embedded calls to Web services as a useful paradigm for distributed data management on the Web. It is referred as Active XML (AXML) documents. More precisely, AXML documents are XML documents where some of the data is given explicitly, while other parts are given only intentionally, using special XML elements that are interpreted as calls to Web services. When the calls are invoked, their results are inserted in the document. To answer a query on an AXML document, one would like to be lazy", in the sense of avoiding the invocation of service calls that bring data not relevant for the query. Central contribution is an efficient algorithm for lazy query evaluation, whose key facets are: Computing the set of relevant service calls: The algorithm generates a set of queries that retrieve all service calls relevant because of their position. Service calls sequencing: Relationships among the calls are analyzed, to derive a sequence of call invocations appropriate to answer a query. Pruning via typing: Return types of services are used to rule out more service calls.Service calls guide: A specialized access structure is used to speed up the detection of relevant calls. Pushing queries: Precise knowledge of the interaction between the query and each

service call enables pushing queries to capable Web services, like mediators do with data sources. 3. P. Buneman et al., Using Partial Evaluation in Distributed Query Evaluation, Proc. Intl Conf. Very Large Data Bases VLDB), 2006. The idea of parallel query processing is used for the evaluation of boolean XPath queries over a tree that is fragmented, both horizontally and vertically over a number of sites. The key idea is to send the whole query to each site which partially evaluates, in parallel, the query and sends the results as compact Boolean functions to a coordinator which combines these to obtain the result. It has shown that partial evaluation is effective in processing xml queries in a de-centralized system. In addition, it proposed the first evaluation and incremental maintenance algorithms with performance guarantees for Boolean XPath queries. This approach has several advantages. First, each site is visited only once, even if several fragments of the tree are stored at that site. Second, no prior constraints on how the tree is de-composed are needed, nor is any structural information about the tree required, such as a dtd. Third, there is a satisfactory bound on the total computation performed on all sites and on the total network traffic. 4. V. Benzaken et al., Type-Based XML Projection, Proc. Intl Conf. Very Large Data Bases (VLDB), 2006. XML data projection (or pruning) is one of the main optimization techniques recently adopted in the context of main-memory XML queryengines. It proposes a new approach, based on types, that greatly improves
5

current solutions. Besides providing comparable or greater precision and far lesser pruning overhead our solution, unlike current approaches, takes into account backward axes, predicates, and can be applied to multiple queries rather than just to single ones. A side contribution is a new type system for XPath able to handle backward axes, which we devise in order to apply our solution. The soundness of this approach is formally proved. Furthermore, it prove that the approach is also complete (i.e., yields the best possible typedriven pruning) for a relevant class of queries and DTDs, which include nearly all the queries used in the XMark and XPathMark benchmarks. These benchmarks are also used to test our implementation and show and gauge the practical benefits of our solution. The specific contributions of this paper include: Improvement in the state of the art: for performances (better pruning, more speedup, less memory consumption), for the analysis techniques (linear pruning time, negligible memory and time consumption), for its generality (handling of all axes and of predicates), and, last but not least, for the formal foundation it provides (correctness formally proved, limits of the approach formally stated). 5. S. Boag et al., XQuery 1.0: An XML Query Language, W3C Candidate Recommendation, June 2006. As increasing amounts of information are stored, exchanged, and presented using XML, the ability to intelligently query XML data sources becomes increasingly important. One of the great strengths of XML is its flexibility in representing many different kinds of information from diverse sources. To exploit this flexibility, an XML query language must provide
6

features for retrieving and interpreting information from these diverse sources. XQuery is derived from an XML query language called Quilt [Quilt], which in turn borrowed features from several other languages. XQuery is a functional language in which a query is represented as an expression. XQuery supports several kinds of expressions, and the structure and appearance of a query may differ significantly depending on which kinds of expressions are used. The various forms of XQuery expressions can be nested with full generality.

CHAPTER 2
7

SYSTEM ANALYSIS 2.1 Existing System: In an existing system that may occur node identity and structural XPATH relationships in a distributed setting (i.e.) distributed query processing, query decomposition and XML projection may cause semantic problems because of it performance is comparatively slow. 2.2 Proposed System: There are three main areas that are related to our proposal in this paper: distributed query processing, query decomposition and XML projection. We first carefully characterized the problems that may occur regarding node identity and structural XPATH relationships in such a distributed setting. Then, we proposed a series of techniques such as passby-fragment and the use of a novel runtime XML projection method for serializing XML messages, that remove virtually all semantic problems and strongly improve performance, as shown by experiments on the open-source MonetDB/XQuery XDBMS. We also discussed the semantics of updating both local and remote documents using XQUF expressions, and additional constraints that should be added to the proposed techniques to guarantee semantic equivalence for such queries. Our main future work is an issue left out-of-scope here: deciding on distributed query placement after decomposition. In this area, we also contemplate using runtime methods to improve optimization quality. CHAPTER 3
8

ALGORITHM 3.1 THE RUNTIME PROJECTION ALGORITHM This algorithm identifies all projection nodes in the XML tree representation of the original document, by traversing the tree top-down depth-first. Whereas the original loading algorithm starts at the document root, and evaluates absolute used and returned paths, our runtime projection algorithm starts in a runtime state, that is, with a real, materialized context sequence (e.g., the parameter values that are about to be serialized in a SOAP message), and executes only relative paths on them. Runtime approach for projection simply relies on the normal XPATH evaluation capabilities of the XQUERY engine for fully evaluating all used and returned path annotations one-by-one (and uniting them with union()). Input for the runtime projection algorithm: node set U returned node set R Consider an XML document D in Fig. 5a. Assume that the used node set U is fig, and the returned node set R is fd; kg. Fig. 5b shows the projected document D0 of applying Algorithm 1 on U, R and D. The algorithm starts with P fd; i; kg; proj d and cur a.We traverse the tree using cur from a to d. Nodes a, b, and c are added to D0, since they are ancestors of the current context node d. Nodes d; e, and f are also added to D0, as d is a returned node. Then, cur is advanced to g (ds next following node). Because the next context node I is not in the subtree of g, the subtree is skipped by advancing
9

cur to i. Recall that i is a used node, thus only I is added to D0. The last context node is k. Our current document node cur traverses from i to j, and then to k, where we can add nodes k, l, and m to D0. The traversal can be terminated, because there are no more context nodes to process. However, the intermediate result D0 contains all common ancestors of fd; i; kg. The post processing removes node a from D0, which produces the final projected document D0 as shown in Fig. 5b.

Fig. 5 Runtime XML projection example (a) original tree D (b) projected tree D0.

CHAPTER 4 REQUIREMENT SPECIFICATIONS


10

4.1 INTRODUCTION

The requirements specification is a technical specification of requirements for the software products. It is the first step in the requirements analysis process it lists the requirements of a particular software system including functional, performance The and security of requirements. The requirements also provide usage scenarios from a user, an operational and an administrative perspective. purpose software requirements specification is to provide a detailed overview of the software project, its parameters and goals. This describes the project target audience and its user interface, hardware and software requirements. It defines how the client, team and audience see the project and its functionality.
4.2 HARDWARE AND SOFTWARE SPECIFICATION 4.2.1 HARDWARE REQUIREMENTS

Hard Disk
RAM

: : :

20GB and Above 512MB and Above Pentium III and Above

Processor

4.2.2 SOFTWARE REQUIREMENTS

Windows Operating System 2000 and Above JDK 1.6 Tomcat 6.0 Struts CHAPTER 5 MODULES
11

5.1 MODULES XQuery Architecture Domain Services Check and Approval 5.2 MODULE EXPLANATION: XQuery Architecture: In this module we interact with the user to collect the user information the securely upload on its server over there it processing query to the sub web services in second module. This module is used to develop the GUI design for the clients, which is easily understood to interact with this project. This module developed by struts package, which is present in J2ee. Domain Services: In this module we create the proper web services for every individual identity. If it checks it comes under which identities and then send the query and retrieves required information. Check and Approval In this module server check the query by passing with its original database. If it true the content will be uploaded if not simply refuse the content information. 5.3 DATA FLOW DIAGRAM: Level 0:
12

Search file Peers Neighbors Node

fig 5.3.1 Level 0 DFD for the system

Level 1:

Peers

Search file

Neighbors Node

Peers

Search file

Self Certification

High Neighbors Node Status

fig 5.3.1 Level 1 DFD for the system

Self Certification

High Request Status

Level 2:
MAX

13 Peers MIN Certification

Recommendation Request

fig 5.3.1 Level 2 DFD for the system

CHAPTER 6 DESIGN OVERVIEW


14

6.1 System Architecture:

Client

Server

XQDB

Related Server1

Related Server2

Related Server3

XQDB

XQDB

XQDB

Request and Response

6.2 Sequence Diagram:

15

6.3 Use Case Diagram:

16

6.4 Activity Diagram:

17

6.5 Collaboration Diagram:

18

19

6.6 Class Diagram:

CHAPTER 7
20

SOFTWARE AND TECHNOLOGIES DESCRIPTION 3.3.1 JAVA It is a Platform Independent. Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to replace C++, although the feature set better resembles that of Objective C. 3.3.1.1 INTRODUCTION TO JAVA Java has been around since 1991, developed by a small team of Sun Microsystems developers in a project originally called the Green project. The intent of the project was to develop a platform-independent software technology that would be used in the consumer electronics industry. The language that the team created was originally called Oak. The first implementation of Oak was in a PDA-type device called Star Seven (*7) that consisted of the Oak language, an operating system called GreenOS, a user interface, and hardware. The name *7 was derived from the telephone sequence that was used in the team's office and that was dialed in order to answer any ringing telephone from any other phone in the office. Around the time the First Person project was floundering in consumer electronics, a new craze was gaining momentum in America; the craze was called "Web surfing." The World Wide Web, a name applied to the Internet's millions of linked HTML documents was suddenly becoming popular for use by the masses. The reason for this was the introduction of a graphical Web browser called Mosaic, developed by ncSA. The browser simplified
21

Web browsing by combining text and graphics into a single interface to eliminate the need for users to learn many confusing UNIX and DOS commands. Navigating around the Web was much easier using Mosaic. It has only been since 1994 that Oak technology has been applied to the Web. In 1994, two Sun developers created the first version of Hot Java, and then called Web Runner, which is a graphical browser for the Web that exists today. The browser was coded entirely in the Oak language, by this time called Java. Soon after, the Java compiler was rewritten in the Java language from its original C code, thus proving that Java could be used effectively as an application language. Sun introduced Java in May 1995 at the Sun World 95 convention. Web surfing has become an enormously popular practice among millions of computer users. Until Java, however, the content of information on the Internet has been a bland series of HTML documents. Web users are hungry for applications that are interactive, that users can execute no matter what hardware or software platform they are using, and that travel across heterogeneous networks and do not spread viruses to their computers. Java can create such applications. 3.3.1.2 WORKING OF JAVA For those who are new to object-oriented programming, the concept of a class will be new to you. Simplistically, a class is the definition for a segment of code that can contain both data (called attributes) and functions (called methods).

22

When the interpreter executes a class, it looks for a particular method by the name of main, which will sound familiar to C programmers. The main method is passed as a parameter an array of strings (similar to the argv[] of C), and is declared as a static method. To output text from the program, we execute the println method of System.out, which is javas output stream. UNIX users will appreciate the thoery behind such a stream, as it is actually standard output. For those who are instead used to the Wintel platform, it will write the string passed to it to the users program. Java consists of two things : Programming language platform 3.3.1.3 THE JAVA PROGRAMMING LANGUAGE Java is a high-level programming language that is all of the following: Simple Object-oriented Distributed Interpreted Robust Secure
23

Architecture-neutral Portable High-performance Multithreaded Dynamic The code and can bring about changes whenever felt necessary. Some of the standard needed to achieve the above-mentioned objectives are as follows: Java is unusual in that each Java program is both co implied and interpreted. With a compiler, you translate a Java program into an intermediate language called Java byte codes the platform independent codes interpreted by the Java interpreter. With an interpreter, each Java byte code instruction is parsed and run on the computer. Compilation happens just once; interpretation occurs each time the program is executed. This figure illustrates how it works:

Fig.3.1 working of java You can think of Java byte codes as the machine code instructions for the Java Virtual Machine (JVM). Every
24

Java interpreter, whether its a

Java development tool or a Web browser that can run Java applets, is an implementation of JVM. That JVM can also be implemented in hardware. Java byte codes help make write once, run anywhere possible. You can compile your Java program into byte codes on any platform that has a Java compiler. The byte codes can then be run on any implementation of the JVM. For example, that same Java program can run on Windows NT, Solaris and Macintos. 3.3.1.4 THE JAVA PLATFORM A platform is the hardware or software environment in which a program runs. The Java platform differs from most other platforms in that its a software-only platform that runs on top of other, hardware-based platforms. Most other platforms are described as a combination of hardware and operating system. The Java platform has two components : The Java Virtual Machine (JVM) The Java Application Programming Interface (Java API) Youve already been introduced to the JVM. Its the base for the Java platform and is ported onto various hardware-based platforms.The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries (packages) of related components. The following figure depicts a Java program, such as an application or applet, thats running on the Java platform. As the figure shows, the Java API and Virtual Machine insulates the Java program from hardware dependencies.
25

Fig.3.3 java platform

As a platform-independent environment, Java can be a bit slower than native code. However, smart compliers, weel-tuned interpreters, and just-intime byte complilers can bring Javas performance close to that of native code without threatening protability. 3.3.2 APACHE TOMCAT SERVER Apache Tomcat (formerly under the Apache Jakarta Project; Tomcat is now a top level project) is a web container developed at the Apache Software Foundation. Tomcat implements the servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, providing an environment for Java code to run in cooperation with a web server. It adds tools for configuration and management but can also be configured by editing configuration files that are normally XML-formatted. Because Tomcat includes its own HTTP server internally, it is also considered a standalone web server. 3.3.2.6 WORKING WITH TOMCAT SERVER Apache Tomcat is a famous Servlet container developed at Apache Software Foundation. This software is released under under the Apache Software License. Anyone can use it for the development as well as
26

deployment of the applications. Tomcat is the official reference of implementation of java Servlets and java Server Pages. Tomcat is very easy to install and configure. Anyone can learn it very fast and start using the Tomcat server for the development and deployment of the web applications. These days many web hosting companies are providing Tomcat support on their server. So, if you develop the application in Java technology you can get any host and then deploy it on the internet. Earlier it was a difficult task to get a good host for hosting. 3.3.3 Struts 3.3.3.1 About Struts Struts is a open source framework which make building of the web applications easier based on the java Servlet and JavaServer pages technologies. Developing web application using struts frame work is fairly complex, but it eases things after it is setup. It encourages software development following the MVC design pattern. Many web applications are JSP-only or Servlets-only. With JSP and Servlets, Java code is embedded in the HTML code and the Java code calls println methods to generate the HTML code respectively. Both approaches have their advantages and drawbacks; Struts gathers their strengths to get the best of their association.Struts is a set of cooperating classes, servlets, and JSP tags that make up a reusable MVC 2 design. This definition implies that Struts is a framework, rather than a library, but Struts also contains an extensive tag library and utility classes that work independently of the framework. 3.3.3.2 The overview of struts
27

Client browser: An HTTP request from the client browser creates an event. The Web container will respond with an HTTP response. Controller: The controller is responsible for intercepting and translating user input into actions to be performed by the model. The controller is responsible for selecting the next view based on user input and the outcome of model operations. The Controller receives the request from the browser, and makes the decision where to send the request. With Struts, the Controller is a command design pattern implemented as a servlet. The struts-config.xml file configures the Controller. Business Logic: The business logic updates the state of the model and helps control the flow of the application. With Struts this is done with an Action class as a thin wrapper to the actual business logic. Model: A model represents an applications data and contains the logic for accessing and manipulating that data. Any data that is part of the persistent state of the application should reside in the model objects. The business objects update the application state. ActionForm bean represents the Model state at a session or request level, and not at a persistent level. Model services are accessed by the controller for either querying or effecting a change in the model state. The model notifies the view when a state change occurs in the model. The JSP file reads information from the ActionForm bean using tags.

28

View: The view is responsible for rendering the state of the model. The presentation semantics are encapsulated within the view; therefore model data can be adapted for several different kinds of clients. The view modifies itself when a change in the model is communicated to the view. A view forwards user input to the controller. The view is simply a JSP file. There is no flow logic, no business logic, and no model information -- just tags. Tags are one of the things that make Struts unique compared to other frameworks like Velocity.

CHAPTER 8 TABLES

6.1 USERLOGIN

FIELD NAME Login

DATA TYPE Text


29

Password

Password

6.2 FORMS

FIELD NAME Name Address Pin code Email id Phone no Occupation Annual Income SocialSecurity No Card No UploadFiles

DATA TYPE Text Textarea Text Text Text Text Text Text Text Text

CHAPTER 9 TESTING 9.1 SOURCE CODE TESTING This examines the logic of the system. If we are getting the output that is required by the user, then we can say that the logic is perfect. 9.2 MODULE LEVEL TESTING
30

In this the error will be found in each individual module, it encourages the programmer to find and rectify the error without affecting other modules. 9.3 UNIT TESTING Unit testing is conducted to verify the functional performance of each modular component of the software. Unit testing focuses on the smallest unit of the software design (i.e.), the module. 9.4 INTEGRATION TESTING Integration testing is a systematic technique for constructing the program structure while at the same time conducting tests to uncover errors associated with. Individual modules, which are highly prone to interface errors, should not be assumed to work instantly when we put them together. The problem of course, is putting them together- interfacing. There may be the chances of data lost across on anothers sub functions, when combined may not produce the desired major function; individually acceptable impression may be magnified to unacceptable levels; global data structures can present problems 9.5 FUNCTIONAL TEST Functional test cases involved exercising the code with nominal input values for which the expected results are known, as well as boundary values and special values, such as logically related inputs, files of identical elements, and empty files. Three types of tests in Functional test: Performance Test
31

Stress Test Structure Test 9.5.1 PERFORMANCE TEST It determines the amount of execution time spent in various parts of the unit, program throughput, and response time and device utilization by the program unit. 9.5.2 STRESS TEST Stress Test is those test designed to intentionally break the unit. A Great deal can be learned about the strength and limitations of a program by examining the manner in which a programmer in which a program unit breaks. 9.5.3 STRUCTURE TEST Structure Tests are concerned with exercising the internal logic of a program and traversing particular execution paths. The way in which White-Box test strategy was employed to ensure that the test cases could Guarantee that all independent paths within a module have been have been exercised at least once. Exercise all logical decisions on their true or false sides. Execute all loops at their boundaries and within their operational bounds. Exercise internal data structures to assure their validity. Checking attributes for their correctness.

32

Handling end of file condition, I/O errors, buffer problems and textual errors in output information.

9.6 WHITE BOX TESTING This testing is also called as Glass box testing. In this testing, by knowing the specific functions that a product has been design to perform test can be conducted that demonstrate each function is fully operational at the same time searching for errors in each function. It is a test case design method that uses the control structure of the procedural design to derive test cases. Basis path testing is a white box testing. 9.7 BLACK BOX TESTING In this testing by knowing the internal operation of a product, test can be conducted to ensure that all gears mesh, that is the internal operation performs according to specification and all internal components have been adequately exercised. It fundamentally focuses on the functional requirements of the software.

9.8 USER ACCEPTANCE TESTING User acceptance of the system is key factor for the success of any system. The system under consideration is tested for user acceptance by constantly keeping in touch with prospective system and user at the time of developing and making changes whenever required. This is done in regarding to the following points.
33

Input screen design. Output screen design.

CHAPTER 10 CONCLUSION In XQuery distribution, we have described a framework for distributed execution of full-fledged XQUERY including XQUF, focusing on the issue of providing equivalent query decompositions, in the face of semantic differences when (parts of) nodes are shipped across the network in XML
34

messages. We first carefully characterized the problems that may occur regarding node identity and structural XPATH relationships in such a distributed setting. Then, we proposed a series of techniques such as passby-fragment and the use of a novel runtime XML projection method for serializing XML messages, that remove virtually all semantic problems and strongly improve performance, as shown by experiments on the open-source MonetDB/XQuery XDBMS (monetdb.cwi.nl). We also discussed the semantics of updating both local and remote documents using XQUF expressions, and additional constraints that should be added to the proposed techniques to guarantee semantic equivalence for such queries.

CHAPTER 11 FUTURE ENHANCEMENTS

Our main future work is an issue left out-of-scope here: deciding on distributed query placement after decomposition. In this area, we also contemplate using runtime methods to improve optimization quality.
35

APPENDIX 1 SCREEN SHOTS

36

37

38

APPENDIX 2 SAMPLE CODING


39

Passport Form: <wsdl:definitions targetNamespace="http://localhost:8080/XQuery_WSPassport/Main.jws"> <!-WSDL created by Apache Axis version: 1.3 Built on Oct 05, 2005 (05:23:37 EDT) --> <wsdl:types> <schema targetNamespace="http://xml.apache.org/xml-soap"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="Vector"> <sequence> <element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:anyType"/> </sequence> </complexType> </schema> </wsdl:types> <wsdl:message name="SearchRequest"> <wsdl:part name="ssn" type="xsd:string"/>
40

</wsdl:message> <wsdl:message name="SearchResponse"> <wsdl:part name="SearchReturn" type="apachesoap:Vector"/> </wsdl:message> <wsdl:portType name="Main"> <wsdl:operation name="Search" parameterOrder="ssn"> <wsdl:input message="impl:SearchRequest" name="SearchRequest"/> <wsdl:output message="impl:SearchResponse" name="SearchResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="MainSoapBinding" type="impl:Main"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="Search"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="SearchRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/> </wsdl:input>
41

<wsdl:output name="SearchResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/XQuery_WSPassport/Main.jws" use="encoded"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="MainService"> <wsdl:port binding="impl:MainSoapBinding" name="Main"> <wsdlsoap:address location="http://localhost:8080/XQuery_WSPassport/Main.jws"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Passport- main.jws: import javax.xml.parsers.*; import javax.xml.transform.*; import javax.xml.xpath.*; import org.w3c.dom.*; import org.xml.sax.*; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import com.*;
42

import java.util.*; public class Main { dbaccess xmldb=null; String success=""; public Vector Search(String ssn) { Vector head=new Vector(); xmldb=new dbaccess(); try { if (xmldb.employeesTable == null) { xmldb.employeesTable = (Node) xmldb.xPath.evaluate("/Table[@TableName='Passport']/View[@SSN='"+ss n+"']/.", xmldb.dbDoc, XPathConstants.NODE); } NodeList de= (NodeList) xmldb.employeesTable.getChildNodes(); for(int i=0;i<de.getLength();i++) { Node e = de.item(i); String s=e.getNodeName().trim();
43

if(!s.equals("#text")) head.add(e.getNodeName().trim() +":@@:"+e.getTextContent().trim()); } if (true) { xmldb.commit(); } } catch (Exception ex) { ex.printStackTrace(); } return head; } } REFERENCES

1. S. Abiteboul, O. Benjelloun, B. Cautis, I. Manolescu, T. Milo, and N. Preda, Lazy Query Evaluation for Active XML, Proc. ACM SIGMOD, 2004. 2. V. Benzaken et al., Type-Based XML Projection, Proc. Intl Conf.Very Large Data Bases (VLDB), 2006.
44

3. S. Boag et al., XQuery 1.0: An XML Query Language, W3C Candidate Recommendation, June 2006. 4. P. Boncz et al., MonetDB/XQuery: A Fast XQuery Processor Powered by a Relational Engine, Proc. ACM SIGMOD, 2006. 5. S. Bressan et al., Accelerating Queries by Pruning XML Documents, Data Knowledge Eng., vol. 54, no. 2, pp. 211-240, 2005. 6. P. Buneman et al., Using Partial Evaluation in Distributed Query Evaluation, Proc. Intl Conf. Very Large Data Bases (VLDB), 2006. 7. D. Chamberlin et al., XQuery Update Facility 1.0, W3C Candidate Recommendation, Aug. 2008. 8. G. Cong et al., Distributed Query Evaluation with Performance Guarantees, Proc. ACM SIGMOD, 2007. 9. DataDirect XQuery, http://www.datadirect.com, 2010. 10. D. Draper et al., XQuery 1.0 and XPath 2.0 Formal Semantics,W3C Recommendation, Jan. 2007. 11.eXist, http://exist.sourceforge.org, 2009. 12.M. Fernandez et al., XQuery 1.0 and XPath 2.0 Data Model (XDM), W3C Candidate Recommendation, July 2006. 13.M. Fernandez et al., Highly Distributed XQuery with DXQ,Proc. ACM SIGMOD, 2007. 14.T. Grust et al., XQuery on SQL Hosts, Proc. Intl Conf. Very Large Data Bases (VLDB), 2004. 15.V. Josifovski et al., Query Decomposition for a Distributed ObjectOriented Mediator System, Distributed and Parallel Databases,vol. 11, no. 3, pp. 307-336, 2002.

45

Potrebbero piacerti anche