Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/timclicks/okrand

A MARC21 to RDF converter
https://github.com/timclicks/okrand

Last synced: 3 days ago
JSON representation

A MARC21 to RDF converter

Awesome Lists containing this project

README

        

okrand - a MARC21 to RDF converter

about
=====

software
--------

This tool was originally used to convert the
National Library of New Zealand's MARC21
catalogue to RDF. It should be sufficiently
generic to do the task for any MARC21 file.

The conversion process loses some data. If
you know of an RDF vocabularly that matches
MARC21 perfectly, please contact the author.

Once converted, your

name
----

Marc Okrand invented Klingon. MARC21 seems
like Klingon for computers.

dependencies
============

okrand depends on two libraries to do its
heavy lifting:

RDFLib
pymarc

Both can be installed via the command line
with pip or easy_install:

$ pip install rdflib pymarc
$ easy_install rdflib pymarc

usage
=====

No command line usage yet. Open up a Python
interpreter and run the main function.

By example
----------

1. You want to parse catalog.mrc in memory:

>>> import okrand
>>> graph = okrand.main('catalog.mrc')

2. You want to parse a compressed
catalog.mrc.gz file and store the graph
on disk so that it can be used by RDFlib:

>>> okrand.main('catalog.mrc',
... store_type='Sleepycat',
... store_id='my_catalog',
... graph_id='my_catalog',
... gzipped=True)

Note: store_id and graph_id are arbitrary,
but are strongly recommended for
disk-based stores.

If you would like to serialize the graph, call
you can do so from the resulting object:

>>> graph.serialize('mycatalog.n3',
... format='n3')

licence
======

APGL v3.