| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
XSLT 1.0 conversion from RDF/XML BIBFRAME 2.0 to MARCXML.
bibframe2marc consists of an XSLT 1.0 stylesheet that takes a set of XML rules and compiles them into another stylesheet (bibframe2marc.xsl). The conversion stylesheet takes an RDF/XML document representing a single BIBFRAME 2.0 description and converts it to a MARCXML document. The bibframe2marc.xsl stylesheet can be used as part of a conversion pipeline, as for example with the Biblio::BF2MARC perl library.
libxslt -- specifically xsltproc -- is used by the root level Makefile to construct the bibframe2marc.xsl conversion stylesheet from the rules in the rules subdirectory. Any XSLT 1.0 processor should be able to build the conversion stylesheet.
XSpec is the test framework for both the rules compiler and the conversion spreadsheet. It is used by the root level Makefile for the test targets.
A Java JRE and the Saxon XSLT and XQuery processor are required by XSpec. For more information, see the installation pages on the XSpec wiki.
The included set of conversion rules represent an implementation of the BIBFRAME to MARC conversion specifications, maintained by the Library of Congress. The rules are implemented using an XML-based domain specific language -- the RDF2MARC Conversion Language. For details on the conversion language, see the RDF2MARC rules documentation. For convenience, the conversion specifications are included in the specs directory of this repository as Excel spreadsheets.
make in the root level of the working directory will create the bibframe2marc.xsl conversion stylesheet from the rules in the rules subdirectory. The destination stylesheet filename and path can be configured with the TARGET_XSL variable.
The bibframe2marc.xsl conversion stylesheet is an XSLT 1.0 application that converts a striped RDF/XML document containing a single BIBFRAME 2.0 "description" (defined as an RDF graph composed of exactly one top-level bf:Instance subject and one or zero top-level bf:Work subjects, linked using the bf:hasInstance or bf:instanceOf properties). It can be invoked as a standalone application using an XSLT 1.0 processor such as xsltproc, or it can be embedded in another application using a library such as libxslt for processing, as with the Biblio::BF2MARC perl library.
For more information about what consitutes a BIBFRAME description, see the design notes.
The converion stylesheet can take the following parameters:
pRecordId -- an internal system record ID for use (for example) in a MARC 001 control field. If pRecordId is not provided, the conversion will use the generate-id() function to generate a record ID.
pCatScript -- string for the default cataloging script found in xml:lang attributes. Defaults to Latn.
bcp47inferrence - Default is true. If true, BCP47 codes will not include the script component when it can be inferred from the language component. If false, the script component (the "-cyrl" of ru-cyrl) will be included in the code. At all times codes will be lowercased.
pGenerationTimestamp -- a timestamp for the conversion. If it is not provided, and if the date:date-time() function is available, it will be created from the value of date:date-time().
pSourceRecordId -- parameter to set the source record ID, for use in conversion rules. Used in generating the 884.
pConversionAgency -- parameter to set the conversion agency (default "DLC"), for use in conversion rules. Used in generating the 884.
pGenerationUri -- parameter to set the generation URI (default "https://github.com/lcnetdev/bibframe2marc"). Used in generating the 884.
pSRULookup -- parameter can be the string "true" or "false" (default "false"). If "true", use SRU to retrieve MARC authorities from the Library of Congress' SRU service instead of retrieving them directly by URL. This workaround is required for XSLT engines that have only rudimentary HTTP support (i.e., no HTTPS -- specifically, libxslt).
The conversion stylesheet is generated from the rules in the rules subdirectory by the compiler stylesheet src/compile.xsl. You can adapt the sample conversion provided to your own needs, or create your own conversion rules. For more information, see the RDF2MARC rules documentation.
To build a conversion stylesheet from a rules file, you can just run the compiler stylesheet with an XSLT 1.0 processor. For example, using xsltproc:
xsltproc src/compile.xsl rules.xml > bibframe2marc.xsl
The compiler stylesheet has XSpec tests written for it that can be run with make test_compile (assuming that XSpec is installed and configured). The tests are in the tests subdirectory.
Named templates for data conversion that are generated by the compiler stylesheet can be tested with make test_named_templates.
The rules in the rules subdirectory can be tested using XSpec with make test_rules. Rules tests are in the rules/tests subdirectory.
The test target of the Makefile runs test_compile, test_named_templates, and test_rules.
As a work of the United States government, this project is in the public domain within the United States.
Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication.
Legal Code (read the full text).
You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. ...
| Back | FazBrowse Home | New Git URL |