资源预览内容
第1页 / 共57页
第2页 / 共57页
第3页 / 共57页
第4页 / 共57页
第5页 / 共57页
第6页 / 共57页
第7页 / 共57页
第8页 / 共57页
第9页 / 共57页
第10页 / 共57页
亲,该文档总共57页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
XML和資料處理(五): XQL(eXtensible Query Language),國立台灣師範大學 資訊教育系 葉耀明,XML as Data Namespace,RDF,Schema, XLink,Xpoint,Xpath,XQL,XSLT XML-RPC,SOAP,WML,XML家族,XML Core XML Syntax, DTD, Parser(DOM/SAX),XML Visual Representation CSS,XSL,WML,XML Vocabulary XHTML, SMIL, MathML, CDF, SVG, DrawML, Rossetanet, BizTalk,內容大綱,Query Language的發展 Relational Database和XML Documents的差異 XQL Query Hierarchy Query Strings Sequential Relationship Queries Find an Attribute XQL Methods DBMS如何使用XML 總結,XML Query Language 的發展,SQL Relational Database Standard Query Language 1974 SEQUEL by Chamberlin and Boyce; ISO XML-QL: by IBM(Notes;1998/8/19) 查詢方式類似SQL的語法 XSLT and XPath 結構化文件(樹狀)的查詢方式 Recommendation XQL:by Microsoft(Notes;1998/11/6) 結構化文件(樹狀)的查詢方式(XSLT-XPath的擴充) XSQL:by Oracle XML-Query Data Model Working Draft ;2000/5/11,SQL範例,SELECT Book.Title, RecSubjCategories.Category FROM Book INNER JOIN RecSubjCategories ON Book.BookID=RecSubjCategories.BookID WHERE Book.Author=“Kevin Williams”,Book,RecSubjCategories,XML-QL範例,CONSTRUCT WHERE $t IN “http:/www.wrox.com/XML/catalog.xml” CONSTRUCT $t , IE5 XML Programmers Reference Designing Distributed Applications ,Result Document,Relational Database和XML Documents的差異,SQL rows have unique identifiers. SQL rows dont imply sequence. SQL structures dont provide hierarchical encapsulation. XML confounds attributes and text-only content. XML allows a mixed content model for elements.,XQL,A general-purpose query language thats designed as an extension of XSL. Notes by Microsoft leaded Group Additional Ability of XQL Index the order of element siblings. Work with an irregular number of fields. Describe parent / child and ancestor / descendant relationships.,What is an XQL Query?,Search Context One or more XML document. Must be well-formed. Query A single node type Or adding qualifiers and filter. Result Set Most implementation return them as a well-formed XML document.,XQL Example ( I ), - - Raising Arizona Ethan Coen Joel Coen Ethan Coen Joel Coen Nicolas Cage Holly Hunter John Goodman A classic one-of-a-kind screwball love story. - Midnight Run George Gallo Martin Brest Martin Brest Robert De Niro Charles Grodin The quintessential road comedy. ,XQL Example ( II ),- The Usual Suspects Christopher McQuarrie Bryan Singer Michael McDonnell Bryan Singer Stephen Baldwin Gabriel Byrne Benicio Del Toro Chazz Palminteri Kevin Pollak Kevin Spacey A crime mystery with incredibly intricate plot twists. - The Abyss James Cameron Gale Anne Hurd James Cameron Ed Harris Mary Elizabeth Mastrantonio A very engaging underwater odyssey. ,Hierarchy Query Strings ( I ),Parent/Child Queries ( / ) Example : movie/title Result : Raising Arizone Midnight Run The Usual Suspects The Abyss ,Hierarchy Query Strings (II),Ancestor/Descendant ( / ) Example : movies/title Result : Raising Arizone Midnight Run The Usual Suspects The Abyss ,Hierarchy Query Strings (III),Wildcards( * ) Example : movies/*/title Result : Raising Arizone Midnight Run The Usual Suspects The Abyss ,Sequential Relationship Queries ( I ),Immediately Precedes Example : producer;producer Result : Michael McDonnell ,Sequential Relationship Queries (II),Precedes Example : producer ; producer Result : Michael McDonnell ,Querying to Find an Attribute ( I ),Syntax nodenameattributename Example : movietype = “comedy”/title Result : Raising Arizone Midnight Run ,Querying to Find an Attribute (II),Returning Attributes Example : movie/type Result : It will return all attribute of movie and with its value.,Querying to Find an Attribute (III),Handling White Space XQL are designed to be useable without white space. Example movie / title = movie/title,Using Filters,Nodename filter syntax Example : movietype = SciFi/title Result : The Abyss ,Boolean Statements,$and$ ( AND or & ) $or$ (OR or | ) $not$ (NOT or ! ),Comparision,XQL Methods,text() value() nodeType() nodeName() index() end(),Using Parentheses in Queries ( I ),Example Query 1 = movie/actorend() Result : John Goodman Charles Grodin Kevin Spacey Mary Elizabeth Mastrantonio ,Using Parentheses in Queries (II),Example Query 2 = (movie/actor)end() Result : Mary Elizabeth Mastrantonio ,Namespace Querying Methods,baseName ( ) namespace ( ) prefix ( ),Collection Methods,textNode ( ) comment ( ) pi ( ) element (name) attribute (name) node ( ) count ( ),Limitation of XQL,XQL cannot provide distinct information. XQL cannot pivot relationships.,XQL (Implementations),http:/xml.darmstadt.gmd.de/xql/ http:/www.globit.com/infonyte.htm,Limitations of File System,Size Concurrency The Right Tool for the Job Versioning Security Integration ( Centralization and Repetition),XML and Database,Size Databases can cope with extremely large amounts of information. Concurrency Database supports more than one user of access information. The Right Tool for the Job Database are usually back-end products. Versioning OO databases support for versioning. Security Dat
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号