Skip to content
Ethan Gruber edited this page Jul 13, 2017 · 4 revisions

The OAI-PMH for Primo is generated by a variety of underlying SPARQL queries that are transformed from RDF in the DPLA MAP by XSLT into OAI-PMH. The underlying query and the OAI-PMH output vary according to the OAI verb. The OAI-PMH output feed is fully conformant to the specification.

The pipeline, {$serverurl}/oai-pmh/, as defined in the Page Flow Controller, has a view defined by xpl/controllers/oai-pmh.xpl. This XPL file contains a series of conditionals to read the verb request parameter, submit the relevant SPARQL query, and pipe the RDF/XML response through the appropriate XSLT template in /ui/xslt/serializations/sparql/oai-pmh.xsl.

Verbs

The Identify verb provides basic metadata about the OAI-PMH service. Example: http://harvester.orbiscascade.org/oai-pmh/?verb=Identify

http://harvester.orbiscascade.org/oai-pmh/?verb=GetRecord&identifier=oai:harvester.orbiscascade.org:6c94990ae7292a167fa67b4142f22dc4&metadataPrefix=oai_dc

GetRecord requires an identifier, metadataPrefix (always oai_dc), and verb=GetRecord. The identifier is formed by concatenating oai, the domain name, and the MD5 hash-encoded CHO URI. This MD5 encoded CHO URI will always be consistently unique across all sets, as URIs themselves are unique. The hash is the identifier for the http://harvester.orbiscascade.org/record/ namespace. See http://harvester.orbiscascade.org/record/6c94990ae7292a167fa67b4142f22dc4, for example. The underlying GetRecord SPARQL query is DESCRIBE for this record URI (the ore:Aggregation URI) in the Harvester. The get-record.xpl is used for both the GetRecord OAI-PMH response and the HTML and machine-readable renditions of the record URI.

http://harvester.orbiscascade.org/oai-pmh/?verb=ListRecords&set=primo&metadataPrefix=oai_dc http://harvester.orbiscascade.org/oai-pmh/?verb=ListIdentifiers&set=primo&metadataPrefix=oai_dc

This two verbs are built on the same two SPARQL queries: the first query gets a count of relevant ore:Aggregations for constructing pagination by means of the resumptionToken, and the second query gets the ore:Aggregations. Much like the DPLA export query, this query will yield ore:Aggregations, dpla:SourceResources, edm:WebResources, as well as relevant collection and concept information to construct human readable labels in the Primo Dublin Core output rather than VIAF and Getty AAT URIs. The Primo OAI-PMH is limited to ore:Aggregations designated with a doap:audience of "primo." Furthermore, it supports restricting by date with the from and until request parameters. These request parameters must conform to xsd:date format (YYYY-MM-DD).

This XSLT stylesheet (contained within xpl/models/sparql/oai-list.xpl) is used to read the set, resumptionToken, from, and until request parameters, construct the SPARQL query, and generate the XML template for the Orbeon URL Generator Processor, which submits the query to the SPARQL endpoint and yields an RDF/XML response, which is then transformed into OAI-PMH with an XSLT stylesheet.

The OAI-PMH structure is expressed by ui/xslt/serializations/sparql/oai-pmh.xsl. Individual templates for transforming the DPLA MAP properties into Alliance Primo-compliant Dublin Core are in ui/xslt/serializations/sparql/oai-pmh-templates.xsl.

The XSLT includes templates to display the skos:prefLabel for concepts instead of the URI and to denormalize XSD dates into Dublin Core date ranges.

Clone this wiki locally