Class: SkosExporter
- Inherits:
-
Object
- Object
- SkosExporter
- Includes:
- RdfHelper, RdfNamespacesHelper
- Defined in:
- app/aides/skos_exporter.rb
Instance Method Summary collapse
-
#initialize(file_path, type, default_namespace_url, logger = Rails.logger) ⇒ SkosExporter
constructor
A new instance of SkosExporter.
- #run ⇒ Object
Methods included from RdfNamespacesHelper
Methods included from RdfHelper
#render_collection, #render_concept, #render_scheme
Constructor Details
#initialize(file_path, type, default_namespace_url, logger = Rails.logger) ⇒ SkosExporter
Returns a new instance of SkosExporter.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/aides/skos_exporter.rb', line 10 def initialize(file_path, type, default_namespace_url, logger = Rails.logger) [:port] = URI.parse(default_namespace_url).port [:host] = URI.parse(default_namespace_url).to_s.gsub(/\/$/, '') @file_path = file_path @type = type @logger = logger @document = IqRdf::Document.new unless ['ttl', 'nt', 'xml'].include? @type raise "SkosExporter: Unknown rdf serialization. Parameter 'type' should be 'ttl' (Turtle), 'nt' (N-Triples) or 'xml' (RDF-XML)." end unless @file_path.is_a?(String) raise "SkosExporter#export: Parameter 'file' should be a String." end end |
Instance Method Details
#run ⇒ Object
28 29 30 |
# File 'app/aides/skos_exporter.rb', line 28 def run export end |