320 likes | 328 Views
Workshop on XML-Based Library Applications 4. XML Standards and Tools. Outline. XML and Related Standards XSLT OAI-PMH ZING XML Tools and Software XML Database Systems. XML and Related Standards (1). Categories of XML and Related Standards:
E N D
Workshop on XML-Based Library Applications4. XML Standards and Tools Hong Kong University of Science & Technology Library
Outline • XML and Related Standards • XSLT • OAI-PMH • ZING • XML Tools and Software • XML Database Systems Hong Kong University of Science & Technology Library
XML and Related Standards (1) Categories of XML and Related Standards: • Family of standards that facilitate the use of XML documents e.g. DOM, XPath, XSL, XSLT, XML Schema, XML Query, XPointer, XLink, XML Encryption, XML Signature, etc. • Protocols that allow interchange of data and messages in XML format. e.g. SOAP, OAI-PMH, ZING’s SRW, etc. Hong Kong University of Science & Technology Library
XML and Related Standards (2) • Standards that specify data and metadata in XML format e.g. EAD, RDF, MARC XML, METS, EAC XML, TEI, MathML, NewsML, etc. Hong Kong University of Science & Technology Library
XSLT, OAI and ZING • XSLT (for Transformation) XSL (eXtensible Stylesheet Language) Transformation • OAI-PMH (for Harvesting) Open Archives Initiative Protocol for Metadata Harvesting • ZING (for Searching) Z39.50 International : Next Generation Hong Kong University of Science & Technology Library
What is XSLT? • XSL (eXtensible Stylesheet Language) Transformation. • Developed by W3C for transforming XML documents into other XML documents, using one or more XSLT stylesheets. • XSLT stylesheet is itself an XML document. • It instructs an XSLT Processor on how to transform the XML document. Hong Kong University of Science & Technology Library
XSLT Example (1) Given an XML document: <?xml version="1.0" encoding="UTF-8"?> <name> <surname>Smith</surname> <firstname>John</firstname> </name> Hong Kong University of Science & Technology Library
XSLT Example (2) And you want to transform it to the following XML document: <?xml version="1.0" encoding="UTF-8"?> <person>John Smith</person> Hong Kong University of Science & Technology Library
XSLT Example (3) Fragment of an XSLT Stylesheet showing how this transformation can be achieved: <xsl:template match="/"> <person> <xsl:value-of select="//firstname"/> <xsl:text> </xsl:text> <xsl:value-of select="//surname"/> </person> </xsl:template> Hong Kong University of Science & Technology Library
XPath • To address parts of an XML document • Used heavily in XSLT • Example (assume you have a book marked up as an XML document): //chapter /book/chapter/section[title = 'Conclusion'] following-sibling::chapter[position()=1] count(//figure) Hong Kong University of Science & Technology Library
XSLT and Web (1) • Use XSLT to transform an XML document to HTML (Web page). • Unlike HTML documents, which mix content and page layout in the same document, with XML and XSLT, you can separate content from layout (presentation). Different views of the same content can be presented through the Web via XSLT transformation. Hong Kong University of Science & Technology Library
XSLT and Web (2) • By applying different XSLT stylesheets to the same <name> XML file, completely different output can be generated: • Most Wanted Person • My Dearest Father Hong Kong University of Science & Technology Library
Client/Server Side XSLT • Client-side Transformation • Perform the transformation on the client, e.g. via the web browser, or through client-side scripts. • Platform dependent. • Server-side Transformation • Perform the transformation on the server and transmit the resulting document to the client. • No need to predict a heterogeneous client platform. Hong Kong University of Science & Technology Library
XSLT Processor • Software program to perform transformation based on an XSLT stylesheet. • Many such programs are available for free download from the Internet. See: http://xml.coverpages.org/xslSoftware.html • HKUST Library uses Xsltproc of Libxslt (http://xmlsoft.org/XSLT/) Hong Kong University of Science & Technology Library
OAI-PMH • Open Archives Initiative Protocol for Metadata Harvesting • An interoperability standard for exposing and harvesting XML-formatted metadata. • http://www.openarchives.org/ • Why OAI? • Once OAI-enabled, metadata can be readily harvested Hong Kong University of Science & Technology Library
OAI Data and Service Providers (1) • Data Provider • exposes metadata about its content • e.g. HKUST’s Institutional Repository, XML Name Access Control Repository, DOAJ, etc. • Service Provider • harvest metadata from data provider • e.g. OAIster – collects (harvests) freely available, difficult-to-access, academically-oriented digital resources. Hong Kong University of Science & Technology Library
Service Provider Service Provider Service Provider XML-Formatted Metadata Data Provider OAI Framework OAI Data and Service Providers (2) Hong Kong University of Science & Technology Library
OAI Data and Service Providers (3) Data Provider (e.g. HKUST Institutional Repository) Data Provider (e.g. HKU Theses Online) Data Provider (e.g. LC American Memory) XML-Formatted Metadata Service Provider (e.g. OAIster) OAI Framework Hong Kong University of Science & Technology Library
OAI-PMH Protocol Requests • The five OAI-PMH Protocol Request Commands: • Identify • ListMetadataFormats • ListIdentifiers • GetRecord • ListRecords e.g. http://repository.ust.hk/oai/?verb=Identify Hong Kong University of Science & Technology Library
OAI-PMH Demonstrations • HKUST’s Institutional Repository • Identify, ListMetadataFormats, ListSets, ListRecords, ListIdentifiers, GetRecord • XML Name Access Control Repository • Identify, ListMetadataFormats, ListSets, ListRecords, ListIdentifiers, GetRecord-MARC21A, GetRecord-MARC21B, GetRecord-EACXML. Hong Kong University of Science & Technology Library
ZING • Z39.50 International: Next Generation • Covers a collection of initiatives by Z39.50 implementers. • http://www.loc.gov/z3950/agency/zing Hong Kong University of Science & Technology Library
Why ZING? • ZING is an effort to re-deploy Z39.50 in the modern computing environment using Web- and XML-based technologies. • It retains the intellectual contents of Z39.50 and experience gained in the past 20 years of Z39.50 implementations. • 脫胎換骨 Hong Kong University of Science & Technology Library
What is Z39.50? • Information retrieval protocol and service (NISO Z39.50-1995 and ISO 23950) • Allows searching of heterogeneous databases by a common search client • Very popular in the library world and has a 2-decade history of implementation • But very little usage outside of the library world Hong Kong University of Science & Technology Library
Problems of Z39.50 • Uses uncommon syntaxes and protocols (OSI-based); incompatible with the modern Web- and XML-based environment • High learning curve for implementers • High implementation cost • Not attractive to non-library applications Bath Profile (http://www.nlc-bnc.ca/bath/bp-current.htm) Hong Kong University of Science & Technology Library
ZING’s SRW • SRW - Search and Retrieval for the Web • Retain core functionality of Z39.50 in the form of a SOAP-based Web service • Major concepts in Z39.50 are retained • Communication mechanisms • by SOAP messages • by URL (also known as SRU – Search and Retrieval by URL) • Search query by: CQL (Common Query Language) Hong Kong University of Science & Technology Library
SRW and SOAP SRW SOAP Request: <SOAP:Envelope> <SOAP:Body> <SRW:searchRetrieveRequest …> Give me all titles by John Smith </SRW:searchRetrieveRequest> </SOAP:Body> </SOAP:Envelope> SRW SOAP Response: <SOAP:Envelope> <SOAP:Body> <SRW:searchRetrieveResponse …> No problem, here you are… </SRW:searchRetrieveResponse> </SOAP:Body> </SOAP:Envelope> Web (HTTP) Server Client Request Response Hong Kong University of Science & Technology Library
SRU Demonstration • Search the XML Name Access Control Repository by SRU. • The following URL searches the Repository for exact name 'Ding Yi' : http://lbxml.ust.hk/nac/srw.pl?query=bath.name+exact+ding+yi Hong Kong University of Science & Technology Library
XML Tools and Databases • Free XML Tools and Software http://www.garshol.priv.no/download/xmltools/ • XML and Databases by Ronald Bourret http://www.rpbourret.com/xml/XMLAndDatabases.htm • XML Databases Products http://www.rpbourret.com/xml/XMLDatabaseProds.htm Hong Kong University of Science & Technology Library
XML Database Systems • Native XML Database Systems • Designed to store XML documents • Fundamental unit of storage is XML document • Examples: Tamino, Berkeley DB XML • XML-Enabled Database Systems • Any database system that has a gateway to accept XML data, conduct XML-based query, and output XML formatted data. • Examples: Oracle, Microsoft SQL Server Hong Kong University of Science & Technology Library
Native or not Native? • Native XML Databases are most suitable for applications that have: • document-oriented data (e.g. full text of a book) • loosely-structured data with deep nesting (hierarchical) (e.g. bibliographic data) • data already in XML format (e.g. SOAP messages) Highly structured data fits best with Relational Database Systems (e.g. order record) Hong Kong University of Science & Technology Library
Database System Evaluation (1) • HKUST Library conducted an evaluation of Native XML Database Systems in March 2001, with an objective to build an XML document storage and retrieval infrastructure for the Library. • Tamino from Software AG was selected • Most mature and complete at that time • Supports a rich set of programming languages • Query by URL Hong Kong University of Science & Technology Library
Database System Evaluation (2) • Software AG is an active participant in XML standards • Unicode-based, and support major character encodings Hong Kong University of Science & Technology Library