1 1 XML for Java Developers G22.3033-002 Session 9 - Main Theme XML Information Retrieval (Part I) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 2 Agenda Summary of Previous Session Applications of XML to Database Technology XML Query Languages XPath XML Queries XQuery: A Query Language for XML XML Query Engines XML Registries API Web Services Support in J2EE / .Net Assignment 5a+5b (due in two weeks)
43
Embed
g22 3033 002 c91 - nyu.edu€¦ · 4 7 Towards XML Application Services Processing DOM Extensions Binding Extensions Component Frameworks (reusable component models) Model-Based Automation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
1
XML for Java Developers G22.3033-002
Session 9 - Main ThemeXML Information Retrieval (Part I)
Dr. Jean-Claude Franchitti
New York UniversityComputer Science Department
Courant Institute of Mathematical Sciences
2
AgendaSummary of Previous SessionApplications of XML to Database Technology
XML Query Languages XPathXML Queries
XQuery: A Query Language for XMLXML Query EnginesXML Registries APIWeb Services Support in J2EE / .NetAssignment 5a+5b (due in two weeks)
Database Desiderata for an XML Query Language11/99: XPath Recommendation
10
W3C XML Query WG
07/99: WG Proposal09/99: WG Official InceptionToday:
30+ W3C Member Companies11+ Meetings, 60+ TelconsHeartbeat every Three Months or soProposed Recommendation(s)
Goals:XML Query Data Model for XML DcoumentsQuery Operators for XML Query Data ModelQuery Language Based on XML Query Operators
6
11
W3C’s Related StandardsXML Query Specifications:
XML Query Requirements (06/27/03 - orig. 01/00)XML Query Use Cases (05/02/03 - orig. 08/00)XQuery 1.0 and XPath 2.0 Data Model (05/02/03 - orig. 05/00)XSLT 2.0 and XQuery 1.0 Serialization (05/02/03)
XQuery 1.0 and XPath 2.0 Formal Semantics (05/02/03-orig 12/00)XQuery 1.0: An XML Query Language (05/02/03)XML Syntax for XQuery 1.0 (XQueryX) (06/07/01)
XPath 2.0 SpecificationsXPath Requirements Version 2.0 (02/14/01)XQuery 1.0 and XPath 2.0 Functions and Operators (05/02/03)XML Path Language (XPath) 2.0 (05/02/03)
12
Related XML TechnologiesXPathXSLXPointerXML SchemaXML InfosetWAIInternationalizationIETF DASL
Distributed Authoring Searching and Locatinghttp://www.ics.uci.edu/pub/ietf/dasl/
7
13
Properties of RDBMS Queries
Pattern + Filter + Construction clauseConstruction clause may have ordering subclausesQueries may perform joins across multiple input setsQueries may generate intermediate variables or path expressions
14
Mapping XML to a RDBMS
SQL-like queries that return XML documents
e.g., Microsoft IIS + SQL Servere.g., Oracle Database Server
Broad spectrum of possible mappingsHierarchical vs. limited RDBMS tree structure
8
15
JDBC Refresher
See chapter 11of XML and Java textbookImporting JDBC PackageLoading a JDBC DriverConnecting to a DatabaseSubmitting a Query
16
XML Embedded in SQL (SQLX)
SQL Embedded in XMLFront-end to RDBMS that provides XML-based Input/OutputTranslates XML query into sequence of JDBC calls, and converts the result to a DOM structure which is returned
9
17
Part II
XML Query
18
XML Query Requirements (Part I)General:
Declarative LanguageReadable XML SyntaxProtocol IndependenceStandard Error ConditionsSupport for Future Updates
Data Model Based on XML InfosetsNamespace AwareSupport for XML Schema Data TypesSupport Inter/Intra Document References
10
19
XML Query Requirements (Part II)Query Functionality:
Operators on All Data TypesText Operators Across Element BoundariesHierarchies and SequencesCombination of Data from Various LocationsAggregation and SortingCombination of Operators (Queries as Operands)Support NULL valuesPreservation of Structure/IdentityOperations on Names/SchemasExtensibility & Closure
20
XML Query Use CasesApproach
Description, DTD/Schema, Input, Queries, ResultsExisting Use Cases
XMP (examples)TREE (queries that preserve hierarchy)SEQ (queries based on sequence)R (relational data access)TEXT (text search)NS (namespace-based queries)PARTS (recursive parts queries)REF (queries based on references)
11
21
XML Query Data Model
Information Presented to a Query ProcessorAugmented Infoset:
XML Schema Data Types (PSVI)Document CollectionsReferences
Node-Labeled Tree Constructor Model with Node IdentityInfoset Mapping to Query Data Model is Defined as Part of the Specification
XML Schema Primitive Typesstring, boolean, ID, IDREF, decimal, etc.
Collectionslist [T], set {T}, bag {|T|}, disjoint/union (T1 | T2), tuple (T1, …, Tn)
Referencesref(T)
12
23
XML Query Algebra
Defines Static and Dynamic SemanticsStatic Semantics are Type Inference Rules
Relate Algebra Expressions to Types
Dynamic Semantics are Value Inference RulesRelate Algebra Expressions to Values
Issues:Algebra Type System Alignment with XML SchemaOperators on Schema Simple Types not DefinedLexical Representation of Schema Simple Types not Defined
24
ConstructorsConstruct Values in XML Query Data Model
name(A1) = ref(qnameValue(null, “price”))value(A1) = ref(decimalValue(10.50, Ref(Def_decimal)))type(A1) = <!-- data model representation of simple type decimal -->
26
Part III
XML Query Languages
14
27
XQueryFunctional Language
Query Represented as an ExpressionExpressions can be Nested without RestrictionInput/Output of an XQuery are Instances of the XML Query Data ModelBased on OQL, SQL, XML-QL, XPathReadable XML SyntaxJava Specification Request for an XQuery API for Java (XQJ) launched on 6/11/03See articles:
Five Practical XQuery ApplicationsWriting and Debugging XQuery Web Apps with Qexo
Book:XQuery Kick Start
28
XQuery Expressions
Path ExpressionsElement ConstructorsFLWR ExpressionsExpressions with Operators/FunctionsConditional ExpressionsQuantified ExpressionsList ConstructorsExpressions to Test/Modify Datatypes
Find figure(s) with caption “Tree Frogs” in second chapter of “zoo.xml”document(“zoo.xml)/chapter[2]//figure[caption = “Tree Frogs”]
ExtensionsDereference OperatorRange PredicateDocument FormatsFind captions of figures referenced by <figref” elements in “Frogs” chapter of “zoo.xml”document(“zoo.xml”)/chapter[title = “Frogs”]//figref/@refid->fig/caption
30
XQuery Element Constructor
Start/End Tag + Enclosed List of ExpressionsGenerate an element with a computed name that contains nested elements:
XML RegistryEnabling Infrastructure for Building, Deploying, and Discovering Web ServicesVarious Existing Specifications
ebXML Registry and Repository StandardDeveloped by OASIS and U.N./CEFACTSee OASIS ebXML Registry and Test Site
Current version is 2.1
UDDI specification (UDDI Registry v2.0)Developed by a vendor consortium
CommerceNet’s eCo FrameworkDeveloped by a vendor consortium
24
47
Java API for XML Registries (JAXR)
API to access various XML RegistriesSee specification: JAXR Specification v1.0
See JavaOne slides:http://servlet.java.sun.com/javaone/conf/sessions/640/google-sf2001.jsp
Provides classification, association, and query capabilitiesAllows portability across different registriesBeing developed via the Java Community Process (JSR-093)Can be used in combination with JAXP, JAXB, JAX-RPC, and SAAJ to support the development of Web Services
48
Part VI
Web Servicesin J2EE / .Net
Also see Session 9 Handout on:“Creating a Simple XML Web Service Using Visual Studio .Net”
andSession 8 Demos on:
“Web Services Build and Test Tutorial”“Web Services Deploy and Publish”
25
49
Web Services Support in J2EE(review)
Java XML Pack (older)All in one XML technology for Javae.g., SAX, DOM, XSLT, SOAP, UDDI, ebXML, and WSDL
Java XML Pack Summer 02 Release (older)Java API for XML Messaging (JAXM 1.1)Java API for XML Processing (JAXP 1.2)Java API for XML Registries (JAXR 1.0_01) Java API for XML-based RPC (JAX-RPC 1.0) SOAP with Attachments API for Java (SAAJ 1.1)
Java Web Services Developer Pack 1.2Bundles latest JAX APIs
50
IBM WebSphere SDK for Web Services V. 5.0
Services-Oriented ComputingNew approach to B2BiXML message encoding architecture + HTTP as a communication transportWeb services are about how to access a business service, while J2EE is about how to implement that business service
Web Services with WSAD Demonstration Tutorials (see Session 8 handouts)
Build and Test
Deploy and Publish
26
51
Service Oriented Architecture
52
Content, Discovery, Universal access, and Intelligent Software Agents
UDDI: Universal Description, Discovery, and IntegrationIndustry-wide effort to bring a common standard for business-to-business(B2B) integrationSet of standard interfaces for accessing a database of web servicesSee UDDI Browser at http://www.soapclient.com/uddisearch.htmljUDDI (pronounced "Judy") is an open source Java-based implementation of a UDDI registry Also see
XML-RPC and Peer-to-Peer ComputingSimple Object Application Protocol (SOAP)Universal Description, Discovery, and Integration (UDDI)Web Service Definition Language (WSDL)
Platform for Internet Content Selection (PICS)Platform for Privacy Preferences (P3P)Channel Definition Format (CDF)Rich Site Summary (RSS)Blocks Extensible Exchange Protocol (BXXP)
54
XML-Based e-Services Protocols and Architectures (continued)
XML Protocol (XMLP): XML-Based Messaging Systems
Standardized application to application XML messaging (via HTTP, and MQSeries)
XML and User Identification/SecurityXML and Databases
XML and JDBCXML Extensions and Tools for Oracle, Informix, IBM DB2, and Microsoft SQL Server
Transaction Authority Markup Language (XAML)Coordinated processing of transaction-supporting web services between internal fulfillment services and external services
28
55
XML-Based e-Services Protocols and Architectures (continued)
Sun’s Open Net Environment (ONE)HP’s NetAction/e-speak platformOracle’s Dynamic Services platformMicrosoft .NET platformIBM WebSphere Architecture (WSA) platform
56
Web Services Stack
29
57
Implementation Diagram
58
Derivative Architecture Patterns
30
59
Web Services Latest Specifications(http://msdn.microsoft.com/webservices/ , http://www.ibm.com/webservices/,
Global WS SpecificationsWS-CoordinationWS-InspectionWS-ReferralWS-RoutingWS-SecurityWS-PolicyWS-Transaction
60
Microsoft .NET PlatformSmart Devices + Windows XP + Web Services
http://www.microsoft.com/net
31
61
.Net Applications Support Technologies/Services
62
.NET Framework
Common Language Runtime (CLR)Accessible to any compiler that produced Microsoft Intermediate Language (IL) code
Runtime ClassesVisual Studio.Net (VS.Net)
Includes VB.Net, VC.Net (C#), and Visual C++.Net
32
63
.NET, Win32, COM, and COM+
.Net applications can call functions that reside in Win32 DLLs via the DllImport attribute of System.Runtime.InteropServices’ platform invocation (PInvoke) services.Net applications can call traditional COM components using Runtime Callable Wrappers (RCWs) which uses interop assemblies (i.e., .Net components) created via COM Interop using the TLBIMP utilityCOM+ services (transactions, object pooling, JIT activation) can be used from .Net (via System.EnterpriseServices namespace).Net runtime uses COM+ to support some of its services (e.g., transactions for managed classes)
64
.Net Remoting(http://www.dotnetremoting.cc/)
Native .Net Remote Object InvocationAllows Object Invocation and Communications Across Processes and MachinesWire Protocol and Format IndependentExtensible via Custom Formatters (SOAP, Binary, etc.), Channels (HTTP, TCP, etc.), and Sink Chain (i.e., Channels + Formatters) StepsFlexible as Configuration can be Changed after Deployment with Little or no Code ChangesFlexible (IIS not required on server) but more Complex than Web Services
33
65
.Net Remoting Vs. DCOM
Not as Transparent as DCOMHas no COM Interop InvolvedOffers More Deployment OptionsNot Tied to a Specific Wire Protocol or FormatFirewall FriendlyAllows you to Specify which Objects are Remoted
66
.Net CLR and COM+CLR Introduces a Newer and Easier Programming Model for COM+The COM+ Services are still Available only at the OS/Unmanaged WorldTransitions Between Managed/Unmanaged Layers are Taken Care of by “System.EnterpriseServices” Namespace
System.EnterpriseServices.ContextUtil class provides access to contexts (as did CoGetObjectContext)
Services are Made Available to Components Using Attributes
Rich Set of Member FunctionsSetCompleteSetAbortEnableCommitDisableCommitIsCallerInRoleGetNamedProperty
68
.Net and ServicedComponent
COM+ Class Derives from “ServicedComponent”[ComVisible(true)][ObjectPooling(MinPoolSize=2, MaxPoolSize=5)][Guid(“57F01F20-9C0C-4e63-9588-720D5D537E66)][Transaction(TransactionOption.Required)]public class SVCCompClass : ServicedComponent
In COM+ 1.0, the List of Services Are not ChangedIn COM+ 1.5 (Microsoft Windows XP Professional and .Net server), Newer Services are Available to Leverage CLR Features
35
69
Component Layers in .Net Applications/Services(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/distapp.asp)
70
Security Policies in .Net Applications/Services
36
71
Operational Mgmt Policies in .Net Applications/Services
72
Communication Policies in .Net Applications/Services
37
73
.Net Applications Support Technologies/Services(continued)
Security, Operational Management, Communication provided by Microsoft Windows OS Services
Active Directory ServiceMessage QueuingWindows Management Instrumentation (WMI)etc.
74
Part VII
Next GenerationComponent-Based Engineering
andProject Development Methodologies
38
75
Towards Web Services
Plateaus of adoption Integration as an afterthoughtWeb services façadesManaged Web services and, finallyParadigm shift
Industry currently focuses on the second plateau
76
Integration as an Afterthought
The current enterprise conjecture consists of a collection of self-contained custom or packaged applicationsPackaged applications may expose functions via an API allowing some level of point-to-point integration
39
77
Web Services Façades
Adopting Web services first requires "wrapping" existing applications with a Web services façadeThe resulting architecture resembles early EAI implementations, but provides the added benefit of standard protocols
78
Managed Web Services
In most cases, package applications are not designed to enable the replacement of underlying servicesAs a result, the resulting Web architecture remains a hybrid inwhich some applications leverage common infrastructure services while others access their own internal services
40
79
Paradigm Shift
In a true service-oriented architecture, all business services use a common set of business-neutral services for logging, notification and security
See Agile Project Development Methodology at Work:http://www.thoughtworks.com/library/agileEAIMethods.pdfhttp://www.thoughtworks.com/library/newMethodology.pdf
82
Part VIII
Conclusions
42
83
SummaryApplying XML to Database Technology allows the viewing of database data as an XML document.XML Query is based on a well defined Data Model and AlgebraVarious syntaxes are possible for an XML Query LanguageXML Query Engines are infrastructure components that support XML QueryJAXR provides a uniform interface to various XML RegistriesWeb Services standards are implemented in .Net and J2EE application servers to support the development of applications based on Service Oriented Architectures
84
ReadingsReadings
XML and Java: Chapter 11, Appendix DProcessing XML with Java: Appendix CDeveloping Java Web Services: Chapters 6, 11Handouts posted on the course web siteReview textbook chapters on XML/Java persistence bindings
Project Frameworks Setup (ongoing)Howard Katz’s XQEngineApache’s Web Server, TomCat/JRun, and CocoonApache’s Xerces, Xalan, SaxonAntenna House XML Formatter, Apache’s FOP, X-smilesPublishing Systems at http://www.xmlsoftware.comVisibroker 4.5 (or BES 5.2.1), WebLogic 6.1-8.1, WAS 5.0POSE & KVM (See Session 3 handout)
43
85
Assignment
Assignment #5: (#5c will be discussed next week)
#5a: This part of the project focuses on the application data model design/development using XML information retrieval technology. The design/development process should focus initially on identifying the data to be retrieved for resulting subsets of data#5b: Your XML application service should demonstrate the following additional steps: (a) Defining the optimal retrieval approach for each dataset, and (b) Considering query constraints when designing an overall application data modelMore specific project related information, and extra credit assignments will be provided during the session
86
Next Session:XML Information Retrieval (Part II)
XML-Based Frameworks (Part I)
XML Object PersistenceAdvanced XML-QL/XQL ConceptsUsing the SAX and DOM APIs with a databaseXML Server Pages (XSP)Presentation Oriented Publishing (POP) FrameworksClient-Side XML POP FrameworksServer-Side XML POP FrameworksXML Messaging and Security