-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
53 lines (42 loc) · 1.75 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
### 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)