各类XQuery引擎的比较

类别:.NET开发 点击:0 评论:0 推荐:

这篇文档翻译自Wei Ren([email protected]),写作时间是2001,距今已有3年时间。其间XQuery的发展突飞猛进,文中的很多内容已经不再准确了。翻译的目的也只是给对XQuery,尤其是XQuery实现的朋友一些参考。等有空我会把目前我所在公司Ipedo(http://www.ipedo.com)的XQuery引擎做些介绍。

Software AG's Quip

http://www.softwareag.com/developer/downloads/default.htm

特性: 它是一个Windows 32位平台的XQuery引擎 易于安装和使用. 实现了大部分XQuery语言规范,包括DISTINCT,UNION,//(DESCENDANT),NAMESPACE,用户可以自定义函数 可以查询文件系统中的XML文档,也可以查询保存于Tamino XML数据库中的XML文档,查询结果可以保存 增加了两个非标准的函数: 'fromCollection(String name)' 'textsearch(String s1,String s2)' 所带例子中有76个查询语句和51 个XML文件 语法遵循W3C 2001年6月7号的草案 缺陷: 未实现: 解引用标识符 (->) 静态类型检查和Schema验证 除了String和Integer没有其他基本类型 Node标记 只能使用反斜线. 没有源代码

Microsoft's XQuery Prototype

http://131.107.228.20/xquerydemo/demo.aspx

特性: 能够通过上面的web站点解析和执行XQuery有关的XML文档。 支持FLWR表达式, Path表达式,条件表达式,和 min()、max()、 avg()、sum()、count()这些聚集函数。 对W3C的use case给了例子,当然有些还没有实现。 提供了XQuery类库,能够通过.Net运行。 语法遵循W3C 2001年6月7号的草案. 缺陷: 你可以通过上面的站点查询一些预置的XML文档,而要查询其他的文档,则要使用Microsoft提供的类编写程序 未实现: 解引用标识符 (->) DISTINCT, UNION, // (DESCENDANT),SORTBY, UNORDERED, FILTER, Namespace, BEFORE/AFTER, Insert/Update/Delete 没有类型检查

Fatdog - XML Query Engine

http://www.fatdog.com

特性: 这是一个基于JavaBean的可以查询本地XML文档的XQuery引擎。通过建立索引使用XQL来查询element,attribute,还可以进行全文检索 提供XQuery API,比如要为某个文档建立索引,可以调用setDocument(filePathStr)。然后可以使用setQuery(queryStr)来对索引进行查询。 支持FLWR表达式, element constructors, 和带有简单谓词的XPath表达式. XQuery引擎扩展了XQL的语法并提供了全文检索功能 附带五个JAVA例程 缺陷: 难以安装和使用,因为文档没有提及应该使用什么版本的JAVA API来解析XML 必须写程序来查询XML文档 必须首先建立索引才能查询 没有源代码

SourceForge - XQuench

http://sourceforge.net/projects/xquench

特性: XQench提供给开发人员API,它基于的规范是http://www.w3.org/XML/Query(支持最新的规范?) 基于JAVA的开源项目,未来会有C++版 缺陷: XQuench还处于初步开发阶段,没有什么文档. 你必须自己从sourceforge的站点得到源代码并使用Ant编译,编译之前还必须有JAVACC来产生XQuery的解析器。相对而言,编译的帮助文档要比Fatdog详细。 目前XQuench所做的就是解析XQuery语法。因此当你运行它所带的测试语句是,会看到--Input: /home2/weiren/work/xmlquery/xquench/xquench/dist/doc/testsuite/simp1.xmq --Good Input! >Start > XQueryFile > XQueryUnit > FunctionLibrary > Query > Expression .........

Kweelt

http://db.cis.upenn.edu/Kweelt/

特性: Kweelt是一个用于查询XML数据的框架. 实现了大部分的W3C 2001年2月15号的XQuery需求,并且做了好多的扩展. 带有大量的例子 提供很多对XML的支持。并不需要特定的存储方式,而是基于一系列的接口(Node和NodeList),并由NodeFacotry实现 JAVA写的开源项目 提供Kweelt API. 可扩展性好。用户可以创建自己的函数在查询的时候使用。Kweelt提供了不同的模板类,可以很容易地创建这些函数。 带有Kweelt Server Pages扩展----一个内建地Cocoon处理器。KSP使得Kweelt查询能够嵌在XML页面中。 缺陷: 不支持namespace; 没有关于bug的详细信息

 

X-HIVE XQuery

http://www.x-hive.com/xquery

特性: 它是一个在线的XQuery demo. 查询存于X-Hive数据库中的XML文档。这些XML文档可以通过数据库的浏览器查看。 支持查询多个XML文档。参看XMach-1. 大部分的XQuery语言都已经实现了。包括申明,表达式,操作符和其余一些有用的函数。 可以查询W3C的use case使用的文档。 语法遵循W3C 2001年6月7号的草案。 缺陷: 不能查询存于别的地方的XML文档; 仍然有4个查询在demo中通不过. 没有源代码


原文:

Evaluation of XML Query Implementations

Wei Ren
[email protected]

10 August 2001

Software AG's Quip

http://www.softwareag.com/developer/downloads/default.htm

Capabilities: It is a prototype of XQuery for Windows 32 bit platforms; It's easy to install & run. Most of the XQuery language specification has been implemented including: DISTINCT, UNION, // (DESCENDANT), User defined function, NAMESPACE, etc. Queries may be applied to XML files or XML stored in a Tamino database and queries can be saved. Two non-standard additions: function: 'fromCollection(name)' with a String argument 'name' function: 'textsearch' with two String arguments Examples include 76 queries and 51 XML files Syntax conforms to the 07 June 2001 Working Draft of XQuery. Limitations: Not implemented are: dereference symbol (->) static type checking or any schema evaluation basic types other than String, Integer node identity Known Problems - nitpicking about path names. In some situations it only accepts true Windows path notation (only backslashes are accepted, slashes are not valid). No source code availability

Microsoft's XQuery Prototype

http://131.107.228.20/xquerydemo/demo.aspx

Capabilities: Can formulate XQueries and parse and execute them via a website Supports: FLWR expressions, Path Expressions, Conditional Expressions, Multiple For, min(), max(), avg(), sum(), count(), etc. Gives examples for each of the W3C use cases. Some use cases don't work due to unimplemented features. Provides a managed class library containing XQuery classes that can be programmed against using the beta 2 release of the .Net Frameworks SDK. These classes allow you to run XQuery queries over arbitrary XML documents. (Note***: The Beta 2 release of the .NET Framework runs on windows platform.) Syntax conforms to the June 7, 2001 draft of XQuery Spec. Limitations: You can build query and execute it on the above website, but it is based on the predefined XML documents. If you want to run XQuery queries over arbitrary XML documents, you need to program using the XQuery classes provided. The following are not implemented: -> (DEREF), DISTINCT, UNION, // (DESCENDANT), User defined functions, SORTBY, UNORDERED, FILTER, Namespace, BEFORE/AFTER, Insert/Update/Delete, No type checking.

Fatdog - XML Query Engine

http://www.fatdog.com

Capabilities: XML Query Engine is a local-file-based search engine tool for XML. It's a JavaBean component that lets you index and then search your file-based XML documents for element, attribute, and full-text content. The index, once built, can be queried using XQL. Provides XML Query Engine API. For example, To index a document, you call setDocument(filePathStr_1). You can then pose queries against the index using setQuery(queryString). Any queries you make are posed against the sum content of all the documents you've indexed to that point. Ships with very early support for XQuery (currently based on the February 15 specification ). Supports FLWR's, element constructors, and XPath expressions with simple predicates. XML Query Engine extends XQL's syntax to provide a full-text capability Give five sample applications written in JAVA and XML Query Engine API Limitation: It's difficult to install and run the example because the readme file dosn't mention which version of the JAVA API is required for XML Parsing. If you want to pose queries on your own XML files, you need to modify the sample code and recompile it, or you must write your own application using the XML Query Engine API. Supports simple queries: FLWR expressions, Path Expressions, Multiple For You have to build an index of the XML files first, then you can query on it. No source code

SourceForge - XQuench

http://sourceforge.net/projects/xquench

Capabilities: XQuench is an XML Query parser and engine. The aim is to provide programmers with an API that implements the specifications at http://www.w3.org/XML/Query Open-source Limitation: XQuench is in very early stages of development, so there are no user docs right now. You should check out a CVS version from sourceforge website and try to compile it yourself. Before you compile it, you need to download JavaCC 2.0 (a parser generator for java programs) to generate a parser for the XML Query language and Ant 1.3 to build XQuench. So it takes some time to make it runnable, but the instructions are well written (much better than Fatdog). What XQuench can currently do is to parse the XML Query language, that's why after you run it with its own test query, you got a list of syntax words: --Input: /home2/weiren/work/xmlquery/xquench/xquench/dist/doc/testsuite/simp1.xmq --Good Input! >Start > XQueryFile > XQueryUnit > FunctionLibrary > Query > Expression .........

Kweelt

http://db.cis.upenn.edu/Kweelt/

Capabilities: Kweelt is a framework to query XML data. Implements a query language for XML that satisfies all the requirements from the W3C query-language-requirements (February 15, 2001) with a lot of useful extensions. Comes with numerous working examples Offers multiple XML back-ends. The query evaluator does not impose any specific storage for XML but relies on a set of interfaces (Node and NodeList) implemented by a NodeFactory. It is storage-independent. Open-source fully written in Java Provides Kweelt API. Extensible. The user can create his/her own user-defined functions (UDF) and make them available inside the query. Kweelt provides various template classes to make the creation of such functions very easy. Comes with the Kweelt Server Pages (KSP) extension, a built-in Cocoon processor. KSP allows to embed Kweelt queries inside any XML page serviced by Cocoon. Limitations: Namespaces are Not supported; Bugs are mentioned in the to-do list, but no details are provided.

 

X-HIVE XQuery

http://www.x-hive.com/xquery

Capabilities: It is an on-line XQuery demo. Works with XML documents stored in a native XML database(X-Hive/DB) which can be viewed through the database browser. Supports queries over multiple XML documents. The sample queries from the XMach-1 benchmark have been included to demonstrate this feature. Most of the XQuery language has been implemented including declarations, expressions, operators and many useful functions. See details on their URL. Utilizes the documents and queries as described in the XML Query Use Cases document Syntax conforms to the 07 June 2001 Working Draft of XQuery. Limitations: Can't run XQuery queries over arbitrary XML documents; 4 queries from the XML Query Use Cases document do not work yet in this demo. No source code

Summary: 

Quip, Microsoft, XQuench, Fatdog, Kweelt, X-Hive

Both Microsoft and X-Hive are web-based demo and can only query on predefined XML files. And conforms to the latest Xquery working draft (June 2001).While Microsoft can query on arbitary XML documents using the classe library provided. Both X-Hive and Quip support queries over multiple XML documents.Quip works with XML documents stored in a Tamino database or as flat files in the file system, while X-Hive only works with XML documents stored in a native XML database(X-Hive/DB). XQuench only has an XML query language parser and currently no query evaluator. They say their immediate priorities are to: satisfy all of W3C's test cases release a new version (I checked out the souce code from SourceForge website, maybe they haven't checked in the latest version of XQuench yet) Fatdog - XML Query Engine - must first build an index for the XML files and then you can build query on that index. It supports simple query and provides an API. Quip conforms to the latest XQuery working draft (June 2001). Most of the XQuery language features have been implemented. It runs on Windows 32 bit platforms. No source code, but provides many sample queries. Kweelt is not just an implementation of a query language. It provides other extensible functions(details see above).It provides an API and source code. They claim to support all the use-cases published by W3C for the XML query requirements. But they don't mention which version of the requirements document is used. It is noteworthy that the timestamp of its downloaded file is Sep-2000.

本文地址:http://com.8s8s.com/it/it42667.htm