krikri 0.7.4 → 0.7.5
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 312dac3d8fca2156e749a365f55d5b49d7cc0f03
|
4
|
+
data.tar.gz: 3c41cf1762291dcec6e25fd1b62d66ef0359b81a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dffe7c155cdb6256b5f3d6521db608a22dfb0211ec88646e0a0bc46ff1e1906698030a77a8a73834bd3d59bda6537127ea26be637747f63cc1b7a4b1b1e337e
|
7
|
+
data.tar.gz: c6e5280a113ec27ca7e43a93543b0c8a2dc09459963ec0f5f045b13caee00426b2aa0458f7a33e06f0d27832154fc96a6fde3fad1bb94c9d5c67b4f77b21f8b6
|
@@ -110,8 +110,11 @@ module Krikri::Enrichments
|
|
110
110
|
match = match_iso(label.to_s)
|
111
111
|
match = match_label(label.to_s) if match.node?
|
112
112
|
|
113
|
-
|
113
|
+
# if match is still a node, we didn't find anything
|
114
|
+
return node if match.node?
|
114
115
|
|
116
|
+
node.exactMatch = match
|
117
|
+
node.prefLabel = RDF::ISO_639_3[match.rdf_subject.qname[1]].label.last
|
115
118
|
node
|
116
119
|
end
|
117
120
|
|
@@ -25,7 +25,7 @@ module Krikri
|
|
25
25
|
def render_enriched_record(document)
|
26
26
|
agg = document.aggregation
|
27
27
|
return error_msg('Aggregation not found.') unless agg.present?
|
28
|
-
JSON.pretty_generate(agg.to_jsonld)
|
28
|
+
JSON.pretty_generate(agg.to_jsonld['@graph'])
|
29
29
|
end
|
30
30
|
|
31
31
|
# Render original record for view
|
data/lib/krikri/version.rb
CHANGED
@@ -30,6 +30,11 @@ describe Krikri::RecordsHelper, :type => :helper do
|
|
30
30
|
result = helper.render_enriched_record(document)
|
31
31
|
expect { JSON.parse(result) }.not_to raise_error
|
32
32
|
end
|
33
|
+
|
34
|
+
it 'does not include context' do
|
35
|
+
expect(helper.render_enriched_record(document))
|
36
|
+
.not_to include '@context'
|
37
|
+
end
|
33
38
|
end
|
34
39
|
|
35
40
|
context 'without existing aggregation' do
|
@@ -35,6 +35,11 @@ describe Krikri::Enrichments::LanguageToLexvo do
|
|
35
35
|
expect(subject.enrich_value('finnish')).to be_node
|
36
36
|
end
|
37
37
|
|
38
|
+
it 'adds a prefLabel' do
|
39
|
+
expect(subject.enrich_value('finnish').prefLabel)
|
40
|
+
.to contain_exactly 'Finnish'
|
41
|
+
end
|
42
|
+
|
38
43
|
context 'and no match' do
|
39
44
|
it 'gives a language' do
|
40
45
|
expect(subject.enrich_value('INVALID'))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: krikri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Audrey Altman
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-07-
|
14
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|