Coder Social home page Coder Social logo

marc_tools's Introduction

### MARCTOOLS - Collection of MARC conversion tools
### Ruby and Perl scripts

# Creator: Benjamin Rokseth
# Date: 15.11.2011

##########
## csv2rdf.rb -- ruby script to Convert comma-separated table to semantic markup using headers as properties
##########

## FEATURES ##
takes csv and uses column headers as properties
first column is used as resource id, using base_uri from command line
rdf type given in command line
output can be .nt .rdf or .n3

## USAGE ##
csv2rdf.rb  -i input_file.csv -o output_file -b base_uri -t rdf_type [-r recordlimit]
  -i input_file must be comma-separated file
  -o output_file extension can be either .rdf (slooow) .n3 (sloow) or .nt (very fast)
  -b base_uri must be uri
  -t rdf_type must be uri
  -r [number] stops processing after given number of records
  
## EXAMPLE ##
ruby csv2rdf.rb -i example.csv -b http://example.com/bookreviews/ -t http://purl.org/stuff/rev#Review -o example.rdf

##########
## marc2csv.rb -- ruby script to convert NORMARC file to CSV
##########

Usage: ruby marc2csv.rb -i input_file.mrc -o output_file.csv [-r recordlimit]

##########
## marcfix.pl  -- Perl script removes breaking 000 fields from NORMARC
##########
Usage: perl marcfix.pl inputfile.mrc > outputfile.mrc

##########
## marc2csv.rb -- ruby script to convert NORMARC binary file to CSV
########## 
Usage: ruby marc2xml.rb -i InputFile.mrc [-o OutputFile.csv] [-r recordlimit]\n"
  
## REQUIREMENTS ##
ruby >= 1.8.7
rdf.rb (thanks to Arto Bendiken et.al. for the brilliant RDF library for ruby)
rdf-rdfxml.rb (for rdf-xml output, requires development libraries libxml2 and libxslt1)
rdf-n3.rb (for n3 output)

## UBUNTU INSTALL ##
(for rdf-xml support)
sudo apt-get install libxml2-dev libxslt1-dev
gem install rdf rdf-rdfxml rdf-n3 (csv if ruby < 1.9)

marc_tools's People

Contributors

bensinober avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.