Package: pybibframe
pybibframeRequires Python 3.5+. To install:python setup.py installUsageConverting MARC/XML to RDF or Versa output (command line)Note: Versa is a model for Web resources and relationships. Think of it
as an evolution of Resource Description Framework (RDF) that's at once
simpler and more expressive. It's the default internal representation
for pybibframe, though regular RDF is an optional output.marc2bf records.mrxReads MARC/XML from the file records.mrx and outputs a Versa
representation of the resulting BIBFRAME records in JSON format. You can
send that output to a file as well:marc2bf -o resources.versa.json records.mrxThe Versa representation is the primary format for ongoing, pipeline
processing.If you want an RDF/Turtle representation of this file you can do:marc2bf -o resources.versa.json --rdfttl resources.ttl records.mrxIf you want an RDF/XML representation of this file you can do:marc2bf -o resources.versa.json --rdfxml resources.rdf records.mrxThese options do build the full RDF model in memory, so they can slow
things down quite a bit.You can get the source MARC/XML from standard input:curl http://lccn.loc.gov/2006013175/marcxml | marc2bf -c /Users/uche/dev/zepheira/pybibframe-plus/test/resource/config1.json --mod=bibframe.zextra -o /tmp/marc2bf.versa.jsonIn this case a record is pulled from the Web, in particular Library of
Congress Online Catalog / LCCN Permalink. Another example, Das Innere
des Glaspalastes in London:curl http://lccn.loc.gov/2012659481/marcxml | marc2bf -c /Users/uche/dev/zepheira/pybibframe-plus/test/resource/config1.json --mod=bibframe.zextra -o /tmp/marc2bf.versa.jsonYou can process more than one MARC/XML file at a time by listing them on
the command line:marc2bf records1.mrx records2.mrx records3.mrxOr by using wildcards:marc2bf records?.mrxPyBibframe is highly configurable and extensible. You can specify
plug-ins from the command line. You need to specify the Python module
from which the plugins can be imported and a configuration file
specifying how the plugins are to be used. For example, to use thelinkreportplugin that comes with PyBibframe you can do:marc2bf -c config1.json --mod=bibframe.plugin records.mrxWhere the contents of config1.json might be:{
    "plugins": [
            {"id": "http://bibfra.me/tool/pybibframe#labelizer",
             "lookup": {
                 "http://bibfra.me/vocab/lite/Work": "http://bibfra.me/vocab/lite/title",
                 "http://bibfra.me/vocab/lite/Instance": "http://bibfra.me/vocab/lite/title"
            }
    ]
}Which in this case will add RDFS label statements for Works and
Instances to the output.Converting MARC/XML to RDF or Versa output (API)Thebibframe.reader.bfconvertfunction can be used as an API to run
the conversion.>>> from bibframe.reader import bfconvert
>>> inputs = open('records.mrx', 'r')
>>> out = open('resorces.versa.json', 'w')
>>> bfconvert(inputs=inputs, entbase='http://example.org', out=out)Configurationmarcspecials-vocab—List of vocabulary (base) IRIs to qualify
relationships and resource types generated from processing the
special MARC fields 006, 007, 008 and the leader.Transforms'transforms': {     'bib': 'http://example.org/vocab/marc-bib-transforms', }See alsoSome open-source tools for working with BIBFRAME (seehttp://bibframe.org)Note: very useful to have around yaz-marcdump (which e.g. you can use to
conver other MARC formats to MARC/XML)Download fromhttp://ftp.indexdata.com/pub/yaz/, unpack then do:$ ./configure --prefix=$HOME/.local
$ make && make installIf you're on a Debian-based Linux you might find usefulthese
installation notes.MarcEditcan also convert to MARC/XML.
Just install, select "MARC Tools" from the menu, choose your input file,
specify an output file, and specify the conversion you need to perform,
e.g. "MARC21->MARC21XML" for MARC to MARC/XML. Note the availability of
the UTF-8 output option too.