各类XQuery引擎的比较

这篇文档翻译自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

  1. 特性 : * 它是一个 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 号的草案
  2. 缺陷 : * 未实现 :
    • 解引用标识符 (->)
    • 静态类型检查和 Schema 验证
    • 除了 String 和 Integer 没有其他基本类型
    • Node 标记 * 只能使用反斜线 . * 没有源代码

** Microsoft's XQuery Prototype **

http://131.107.228.20/xquerydemo/demo.aspx

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

** Fatdog - XML Query Engine **

http://www.fatdog.com

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

** SourceForge - XQuench **

http://sourceforge.net/projects/xquench

  1. 特性 : * XQench 提供给开发人员 API ,它基于的规范是 http://www.w3.org/XML/Query (支持最新的规范?) * 基于 JAVA 的开源项目,未来会有 C++ 版
  2. 缺陷 : * 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/

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

** X-HIVE XQuery **

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

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

  1. 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.
  2. 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

  1. 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.
  2. 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

  1. 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
  2. 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.
Published At
Categories with Web编程
Tagged with
comments powered by Disqus