marc2linkeddata 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f53bf2a4de09468d82acd96afa56333d7d12bf2c
4
- data.tar.gz: bcc81582e5ad1b723c56d87213165fba35b7d55b
3
+ metadata.gz: 543898af0ce1ceaa309d3998c8cbfa2b12df00f9
4
+ data.tar.gz: 45fe5fb9d27c32c66b5d385154ea60ccb9368262
5
5
  SHA512:
6
- metadata.gz: af891eb4a3dbb3b9fbba41d1d900c5e57bcfd417b0ba602a6b0a537382d2984923fdbc40b0fcf2c193af2291a8c7ff88318ff51930e7b4b263a196279a464bb5
7
- data.tar.gz: 29acc2ad5d26f2d68079d1e10b9b29ace1616c469a356946173dadfe17dd02ff81bebdc2620bbf7af8162a24a4d3387c83d98db3692def042deb44c1c0e8a86f
6
+ metadata.gz: f0458ac1a99307bf1988628298c9eda642fa1015b37dd92abe6fc8ad09d7f4746a962bbdf90ef3948e30c433d686df84d2d628094202097b21e21177b56911b1
7
+ data.tar.gz: 06a32b1595aee813138e1705663e2d1fdb92e9d57d03692e5f4dd9e7582c363b014e462641f49100ac561e01b0e7ea1acc6a91e70c0a173dde25a2761de408ea
data/.env_example CHANGED
@@ -29,6 +29,7 @@ export THREADS=true
29
29
  export THREAD_LIMIT=25
30
30
 
31
31
  # Authority record field numbers for useful link data
32
+ export FIELD_AUTH_ID=001
32
33
  export FIELD_AUTH_LOC=920
33
34
  export FIELD_AUTH_VIAF=921
34
35
  export FIELD_AUTH_ISNI=922
data/README.md CHANGED
@@ -86,7 +86,8 @@ Scripting
86
86
  # First configure (see details above).
87
87
  # Translate a MARC21 authority file to a turtle file.
88
88
  # It's assumed that '*.mrc' files contain multiple MARC21
89
- # records and the record identifier is in field 001.
89
+ # records and the record identifier is configured in the
90
+ # ENV['FIELD_AUTH_ID'] value, it defaults to MARC field 001.
90
91
  # marcAuthority2LD [ authfile1.mrc .. authfileN.mrc ]
91
92
  marcAuthority2LD auth.mrc
92
93
 
@@ -9,6 +9,7 @@ module Marc2LinkedData
9
9
  attr_accessor :threads
10
10
  attr_accessor :thread_limit
11
11
 
12
+ attr_accessor :field_auth_id
12
13
  attr_accessor :field_auth_loc
13
14
  attr_accessor :field_auth_isni
14
15
  attr_accessor :field_auth_oclc
@@ -81,6 +82,7 @@ module Marc2LinkedData
81
82
  @prefixes['viaf'] = 'http://viaf.org/viaf/'
82
83
 
83
84
  # Authority parse options
85
+ @field_auth_id = ENV['FIELD_AUTH_ID'] || '001'
84
86
  @field_auth_loc = ENV['FIELD_AUTH_LOC']
85
87
  @field_auth_isni = ENV['FIELD_AUTH_ISNI']
86
88
  @field_auth_oclc = ENV['FIELD_AUTH_OCLC']
@@ -36,7 +36,7 @@ module Marc2LinkedData
36
36
  #field001 = record.fields.select {|f| f if f.tag == '001' }.first.value
37
37
  #field003 = record.fields.select {|f| f if f.tag == '003' }.first.value
38
38
  #"#{field003}-#{field001}"
39
- get_fields('001').first.value
39
+ get_fields(@@config.field_auth_id).first.value
40
40
  end
41
41
 
42
42
  def get_iri(field, iri_pattern)
@@ -4,7 +4,7 @@ $:.unshift lib unless $:.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'marc2linkeddata'
7
- s.version = '0.1.4'
7
+ s.version = '0.2.0'
8
8
  s.licenses = ['Apache-2.0']
9
9
 
10
10
  # mysql and bson_ext only install on MRI (c-ruby)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marc2linkeddata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Weber