lib/iqvoc/skos_importer.rb in iqvoc-4.0.1 vs lib/iqvoc/skos_importer.rb in iqvoc-4.0.2

- old
+ new

@@ -1,13 +1,14 @@ module Iqvoc class SkosImporter - FIRST_LEVEL_OBJECT_CLASSES = [Iqvoc::Concept.base_class] + FIRST_LEVEL_OBJECT_CLASSES = [Iqvoc::Concept.base_class, Iqvoc::Collection.base_class] SECOND_LEVEL_OBJECT_CLASSES = Iqvoc::Concept.labeling_classes.keys + Iqvoc::Concept.note_classes + Iqvoc::Concept.relation_classes + - Iqvoc::Concept.match_classes + Iqvoc::Concept.match_classes + + Iqvoc::Collection.member_classes def initialize(file, default_namespace_url, logger = Rails.logger) @logger = logger @@ -70,10 +71,13 @@ end end def import_first_level_objects(types, subject, predicate, object) + @logger.debug "types: #{types}" + @logger.debug "predicate: #{predicate}" + @logger.debug "subject: #{subject}" if (predicate == "rdf:type" && types[object] && subject =~ /^:(.+)$/) # We've found a subject definition with a class we know and which is in our responsibility (":") origin = $1 if (@existing_origins[origin]) @@ -84,9 +88,10 @@ end else @seen_first_level_objects[origin] = types[object].create!(:origin => origin) end end + end def import_second_level_objects(types, subject, predicate, object) return unless (subject =~ /^:(.*)$/ && types[predicate]) # We're not responsible for this