HiOA HiOA

Making use of XML

Tor Arne Dahl, 24.08.2011

Overview

Suggested solution to yesterday's exercise

reviews.dtd

XML-related W3C Recommendations

XSLT (XML Transformation)

XPath (XML Path Language)

XSLT processing

XSLT processing

Client-side XSLT processing

XSLT processing in the browser

Server-side XSLT processing

XSLT processing on the server

How it works

Linking the XSLT stylesheet to the XML document

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="reviews.xsl"?>
<reviews>
   ...
</reviews>

An example

A transformation of the example XML document into XHTML.

Interoperability: OAI-PMH

Data and service providers

Data provider
A data provider has a repository with metadata and possibly full text documents and makes these metadata available through the OAI-PMH protocol. Examples:
  • Subject repositories: arXiv.org (mainly physics), CiteSeerx (computer and information science)
  • Institutional repositories: ODA (Oslo and Akershus University College of Applied Sciences), DUO (University of Oslo), BORA (University of Bergen) and Munin (University of Tromsų)
  • Repositories globally: Repository 66 Repository Maps
Service provider
A service provider installs harvester software that can harvest metadata from one or more data providers. The metadata is typically stored in a database, and is harvested at regular intervals using OAI-PMH requests. Examples:

OAI-PMH: Architecture

The architecture of the OAI-PMH protocol

Concepts

Resource
An object or "a thing" that the metadata describes. The resources themselves are not part of the protocol.
Item
A constituent of a repository from which metadata about a resource can be disseminated or extracted. Each item has a unique identifier.
Record
A manifestation of metadata expressed in a specific metadata format. A record is XML-encoded, and one or more records are returned as response to an OAI-PMH request.

Records: Metadata formats

Records: An example from arXiv.org

<record>
   <header>
      <identifier>oai:arXiv.org:adap-org/9311003</identifier>
      <datestamp>2008-02-03</datestamp>
      <setSpec>nlin</setSpec>
      <setSpec>q-bio</setSpec>
   </header>
   <metadata>
      <oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
      xmlns:dc="http://purl.org/dc/elements/1.1/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/
      http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
         <dc:title>Chaos as a Source of Complexity and Diversity in Evolution</dc:title>
         <dc:creator>Kaneko, Kunihiko</dc:creator>
         <dc:subject>Nonlinear Sciences - Adaptation and Self-Organizing Systems</dc:subject>
         <dc:subject>Quantitative Biology</dc:subject>
         <dc:description>  The relevance of chaos to evolution is discussed in the context of the origin
         and maintenance of diversity and complexity. Evolution to the edge of chaos is
         demonstrated in an imitation game. As an origin of diversity, dynamic
         clustering of identical chaotic elements, globally coupled each to other, is
         briefly reviewed. The clustering is extended to nonlinear dynamics on
         hypercubic lattices, which enables us to construct a self-organizing genetic
         algorithm. A mechanism of maintenance of diversity, ``homeochaos", is given in
         an ecological system with interaction among many species. Homeochaos provides a
         dynamic stability sustained by high-dimensional weak chaos. A novel mechanism
         of cell differentiation is presented, based on dynamic clustering. Here, a new
         concept -- ``open chaos" -- is proposed for the instability in a dynamical
         system with growing degrees of freedom. It is suggested that studies based on
         interacting chaotic elements can replace both top-down and bottom-up
         approaches.</dc:description>
         <dc:description>Comment: to appear in Artificial Life</dc:description>
         <dc:date>1993-11-25</dc:date>
         <dc:type>text</dc:type>
         <dc:identifier>http://arxiv.org/abs/adap-org/9311003</dc:identifier>
     </oai_dc:dc>
   </metadata>
</record>

Six verbs

The OAI-PMH specification defines six verbs (or commands) that a harvester can issue to a repository. The verbs are given as parameters in the URL to the OIA-PMH data provider server. In the examples below arXiv.org is used as the data provider. The base URL to the server is http://arxiv.org/oai2.

Verb Description and example
Identify Describes the service.
Example: http://arxiv.org/oai2?verb=Identify
ListMetadataFormats Lists the metadata formats available.
Example: http://arxiv.org/oai2?verb=ListMetadataFormats
ListSets The metadata can be divided into sets (for instance by discipline or faculty). The response to this verb will be a list of all these sets in the repository.
Example: http://arxiv.org/oai2?verb=ListSets
ListIdentifiers Lists all identifiers to the items in the repository. The parameter metadataPrefix is also mandatory when using this verb.
Example: http://arxiv.org/oai2?verb=ListIdentifiers&metadataPrefix=oai_dc
ListRecords Lists all record in the metadata format provided by the metadataPrefix parameter.
Example: http://arxiv.org/oai2?verb=ListRecords&metadataPrefix=oai_dc&set=nlin
GetRecord Fetches a record with a given identifier and metadata format.
Example: http://arxiv.org/oai2?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:arXiv.org:adap-org/9311003

Software

References

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Tor Arne Dahl
Tor-Arne.Dahl@hioa.no
Last modified: 23 August 2011