semantically-taggable 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/semantically_taggable/skos_importer.rb +1 -1
- data/lib/tasks/import.rake +1 -1
- data/spec/debug.log +36300 -0
- data/spec/semantically_taggable/shared_spec_helpers.rb +1 -1
- data/spec/semantically_taggable/testdata/dg_abridged.rdf +8 -8
- data/spec/semantically_taggable/testdata/dg_two_roots.rdf +2 -2
- metadata +12 -22
@@ -57,7 +57,7 @@ module SemanticallyTaggable
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def lookup_tag(pointer_node)
|
60
|
-
url_xpath = "//skos:Concept[@rdf:
|
60
|
+
url_xpath = "//skos:Concept[@rdf:about='#{pointer_node['resource']}']"
|
61
61
|
concept_node = pointer_node.at_xpath(url_xpath) || (raise RuntimeError, "Concept at #{url_xpath} not found")
|
62
62
|
pref_label = concept_node.at_xpath('skos:prefLabel').content
|
63
63
|
@scheme.tags.find_by_name pref_label
|
data/lib/tasks/import.rake
CHANGED
@@ -4,7 +4,7 @@ namespace :import do
|
|
4
4
|
scheme = SemanticallyTaggable::Scheme.by_name args.scheme_name
|
5
5
|
scheme.import_skos(args.skos_filename) do |tag, node|
|
6
6
|
# Extract original_id from the rdf:resource URI
|
7
|
-
tag.original_id = node['
|
7
|
+
tag.original_id = node['about'].match(%r{.*/([0-9]*)$})[1]
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|