Sha256: efe565f34e5eb2b53d0292889b5a56426f9def2b2766e77fed82cf90baf51761
Contents?: true
Size: 612 Bytes
Versions: 3
Compression:
Stored size: 612 Bytes
Contents
#!/usr/bin/env ruby require 'json' n = 0 puts '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">' Dir.glob('/Volumes/Geo3TB/document_cache/??/???/??/????/mods') do |fn| # puts fn if fn =~ %r{(../\d\d\d/../\d\d\d\d)/mods$} druid = $1.gsub(/\//, '') else raise ArgumentError, fn end s = File.read(fn) if s =~ %r{(<subject>\s*<cartographics>.*<coordinates>.*</coordinates>.*</cartographics>\s*</subject>)}mi puts "<rdf:Description rdf:about=\"#{druid}\">" puts $1 puts '</rdf:Description>' n = n + 1 end end puts '</rdf:RDF>' STDERR.puts "Wrote #{n} records"
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
geohydra-0.3.3 | scripts/ingest_mods.rb |
geohydra-0.3.1 | scripts/ingest_mods.rb |
geohydra-0.3 | scripts/ingest_mods.rb |