$baseURL = "http://$SERVER_NAME$SCRIPT_NAME"; $xslURL = "http://www.language-archives.org/tools/vida/xsl/olac.xsl"; $java = "/pkg/j/j2sdk1.4.0/bin/java"; $xalan = "/mnt/unagi/ldc/wwwhome/jakarta-tomcat-3.2.3-sb/lib/xalan.jar"; $xerces = "/pkg/x/xerces-2_0_1/xercesImpl.jar"; $xslt = "$java -classpath $xalan:$xerces org.apache.xalan.xslt.Process -xsl $xslURL"; ### ### Functions ### function document() { global $baseURL; print <<< END
![]() |
Vida: OLAC Virtual Data Provider |
Vida (for "Virtual data provider") was a service developed by OLAC in late 2001 to implement the OAI protocol (version 1.1) for metadata harvesting on a static XML document describing the holdings of an archive. In the meantime, the OAI (as part of its version 2.0 family of guidelines) has developed a standard for encoding static repositories and for harvesting them through a gateway service. The original Vida service has been made obsolete by this new OAI standard. This page is maintained to give historical documentation of the Vida service. If you are interested in using the service, go to the OLAC Static Repository Gateway which has replaced it.
append the URL of the mini repository xml file to the url of the
virtual data provider then add cgi parameters.
Example:
The base url of virtual data provider is:
Given a url of a mini repository xml file (for example:http://www.ldc.upenn.edu/Projects/OLAC/ldc.xml),
the full url for the data provider is:
And it can be harvested using the OAI metadata harvesting protocol, e.g.:
The data provider can be tested with the repository explorer:
http://oai.dlib.vt.edu/~oai/cgi-bin/Explorer/oai1.1/testoai?archive=$baseURL/your/server/xmlfile.xml
E.g.:
Description:
The virtual data provider is a
PHP script
to make metadata available for service providers using the
OAI
or OLAC
metadata harvesting protocol. It applies an
XSL stylesheet to the xml
document given in the PATHINFO (appended to the base url of the
script) using the
Xalan java XSLT
processor. The xml file that it takes as an argument has to conform to
the oryx
schema.
Usage:
END;
} # end of function document()
function archive_document()
{
$metadata_formats = array();
$metadata_formats['oai_dc'] = 'http://www.openarchives.org/OAI/dc.xsd';
$metadata_formats['olac'] = 'http://www.language-archives.org/OLAC/0.4/olac.xsd';
$namespace = array();
$namespace['oai_dc'] = 'http://purl.org/dc/elements/1.1/';
$namespace['olac'] = 'http://www.language-archives.org/OLAC/0.4/';
$protocol_version = '1.1';
global $baseURL;
$xmlns = "http://www.openarchives.org/OAI/1.1";
$longdate = strftime("%A, %D %T");
$mdf_section = "";
while (list($name,$schema) = each($metadata_formats))
$mdf_section .= "
olac-admin@language-archives.org
2002.07.15
$name" .
"$schema";
$mdf_section = "$protocol_version$baseURL
For arguments (O) indicates optional, (M) indicates mandatory, and (E) indicates exclusive (ie. that parameter and no others may be specified, otherwise that parameter may no be specified).
Document
verb=Document
Identify
$xmlns/OAI_Identify.xsd
verb=Identify
ListIdentifiers
until(O), from(O), set(O)
$xmlns/OAI_ListIdentifiers.xsd
verb=ListIdentifiers
ListMetadataFormats
identifier(O)
$xmlns/OAI_ListMetadataFormats.xsd
verb=ListMetadataFormats
ListRecords
until(O), from(O), set(O), metadataPrefix(M)
$xmlns/OAI_ListRecords.xsd
verb=ListRecords&metadataPrefix=oai_dc
ListSets
$xmlns/OAI_ListSets.xsd
verb=ListSets
VIDA Error: Repositoy '$xmlURL' not found."; exit; } error_reporting($mask); # restore error reporting # no OAI verb # -- show OAI interface if ($verb == "Document" || $verb == "") { archive_document(); exit; } ### ### OAI service starts ### # check if the OAI request is well-formed (protocol version 1.1) request_syntax_check(); # if not ok, exit # prepare xalan call $param_string = "&$QUERY_STRING"; $param_string = str_replace("=", " ", $param_string); $param_string = str_replace("&", " -param ", $param_string); $param_string .= " -param baseURL $baseURL "; $command = "$xslt -in $xmlURL $param_string"; exec($command, $result); header("Content-Type: text/xml"); print join("\n", $result); ?>