Sha256: f00f4e1c6564a80d6cc786e96b3a6f4048e2d4f2efade5b2ee57e6c8543dc4d9

Contents?: true

Size: 962 Bytes

Versions: 7

Compression:

Stored size: 962 Bytes

Contents

require 'multi_logger'

namespace :iqvoc do

  desc 'Exports iQvoc data to rdf serialization (turtle, ntriples, rdf/xml)'
  task :export => :environment do
    require 'iqvoc/skos_exporter'

    raise "You have to specify an rdf serialization format (turtle, ntriples or rdf/xml) for the data file to be exported. Example: rake iqvoc:import TYPE=... NAMESPACE=... [FILE=...]" unless ENV['TYPE']
    raise "You have to specify a default namespace for the data to be imported. Example: rake iqvoc:import TYPE=... NAMESPACE=... [FILE=...]" unless ENV['NAMESPACE']

    stdout_logger = Logger.new(STDOUT)
    stdout_logger.level = Logger::INFO

    timestamp = Time.now.strftime("%Y-%m-%d_%H-%M")
    file_path = ENV['FILE'] || Rails.root.join(Iqvoc.export_path, "iqvoc_dump-#{timestamp}.#{ENV['TYPE']}").to_s

    exporter = Iqvoc::SkosExporter.new(file_path, ENV['TYPE'], ENV['NAMESPACE'], MultiLogger.new(stdout_logger, Rails.logger))
    exporter.run
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
iqvoc-4.7.0 lib/tasks/exporter.rake
iqvoc-4.6.1 lib/tasks/exporter.rake
iqvoc-4.5.2 lib/tasks/exporter.rake
iqvoc-4.6.0 lib/tasks/exporter.rake
iqvoc-4.5.1 lib/tasks/exporter.rake
iqvoc-4.5.0 lib/tasks/exporter.rake
iqvoc-4.4.0 lib/tasks/exporter.rake