cul_scv_hydra 0.16.8 → 0.16.10
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 +8 -8
- data/app/models/generic_aggregator.rb +1 -1
- data/app/models/generic_resource.rb +2 -2
- data/config/predicate_mappings.yml +8 -5
- data/lib/cul_scv_hydra/solrizer/scv_mods_fieldable.rb +44 -5
- data/lib/cul_scv_hydra/version.rb +2 -1
- data/lib/cul_scv_hydra/version.rb~ +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjlkYzY2YTNkZmFiMjNlMGY4OGVlZjI2OTkxMmIzM2NmYTI4MzExMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzNiNTZiOWUzYmU1MDkwNDZhODhmNjNlNTIzNWFjYzM2MjYxNjZiYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmMzZGJkMTBhM2Q3YTgzZDVkZWNkM2Q1OTUwZmFiMzhkYjQyNjMxNGM2OGNh
|
10
|
+
NDg2MGRkYTM3OGFjZWU2YTU0MDM0YzJkNmJmNGZjNTk2ZmIxMTUyZTc4ZWZl
|
11
|
+
YjY3YjA5OTIwYmVhODRmMmY3OGMxYjUzNmI3NjZiNDljY2ZlZjI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWQyOTk1YjU5YTBlYzE3ZjI5ZWQxZmVmNWExNTBiOTM0Njk4YWZiNzI2MTM0
|
14
|
+
ODVmYWUxZjcyZTBlMjcxNTdiOWE4MzBlMDdiZjNiMWQyNzI3NzVlOWMzZDhm
|
15
|
+
ZDgzNTI0MTNhMjA5ZmRjZjU3NDAyOGY2Y2FmMDg2NDQxN2M3MzU=
|
@@ -16,7 +16,7 @@ class GenericAggregator < ::ActiveFedora::Base
|
|
16
16
|
def index_type_label
|
17
17
|
riquery = Cul::Scv::Hydra::Models::MEMBER_ITQL.gsub(/%PID%/, self.pid)
|
18
18
|
begin
|
19
|
-
docs = Cul::Scv::Fedora.repository.find_by_itql riquery, limit: 2, format: json
|
19
|
+
docs = Cul::Scv::Fedora.repository.find_by_itql riquery, limit: 2, format: 'json'
|
20
20
|
docs = JSON.parse(docs)['results']
|
21
21
|
rescue Exception=>e
|
22
22
|
Rails.logger.warn("#{self.class.name} failed to find children with TQL: #{e.message}")
|
@@ -109,8 +109,8 @@ class GenericResource < ::ActiveFedora::Base
|
|
109
109
|
|
110
110
|
dsuris.each do |dsuri|
|
111
111
|
dsid = dsuri.to_s.split('/')[-1]
|
112
|
-
width_rel = rels_int.relationships(dsuri, :
|
113
|
-
length_rel = rels_int.relationships(dsuri, :
|
112
|
+
width_rel = rels_int.relationships(dsuri, :image_width)[0]
|
113
|
+
length_rel = rels_int.relationships(dsuri, :image_length)[0]
|
114
114
|
extent_rel = rels_int.relationships(dsuri, :extent)[0]
|
115
115
|
props = {EXTENT_PREDICATE => [], WIDTH_PREDICATE => [], LENGTH_PREDICATE => []}
|
116
116
|
props[EXTENT_PREDICATE] << extent_rel.object.to_s unless extent_rel.blank?
|
@@ -18,6 +18,7 @@
|
|
18
18
|
:cul_has_member: hasMember
|
19
19
|
:cul_member_of: memberOf
|
20
20
|
:cul_metadata_for: metadataFor
|
21
|
+
:cul_obsolete_from: obsoleteFrom
|
21
22
|
http://creativecommons.org/ns#:
|
22
23
|
:cc_license: license
|
23
24
|
info:fedora/fedora-system:def/relations-external#:
|
@@ -47,8 +48,8 @@
|
|
47
48
|
info:fedora/fedora-system:def/model#:
|
48
49
|
:has_model: hasModel
|
49
50
|
http://purl.oclc.org/NET/CUL/RESOURCE/STILLIMAGE/BASIC/:
|
50
|
-
:
|
51
|
-
:
|
51
|
+
:cul_image_width: imageWidth
|
52
|
+
:cul_image_length: imageLength
|
52
53
|
http://purl.oclc.org/NET/CUL/RESOURCE/STILLIMAGE/ASSESSMENT/:
|
53
54
|
:x_sampling: xSamplingFrequency
|
54
55
|
:y_sampling: ySamplingFrequency
|
@@ -58,8 +59,8 @@
|
|
58
59
|
:format: format
|
59
60
|
:format_of: isFormatOf
|
60
61
|
http://www.w3.org/2003/12/exif/ns#:
|
61
|
-
:
|
62
|
-
:
|
62
|
+
:image_width: imageWidth
|
63
|
+
:image_length: imageLength
|
63
64
|
:x_resolution: xResolution
|
64
65
|
:y_resolution: yResolution
|
65
66
|
:resolution_unit: resolutionUnit
|
@@ -67,5 +68,7 @@
|
|
67
68
|
:foaf_image: image
|
68
69
|
:foaf_thumbnail: thumbnail
|
69
70
|
:foaf_zooming: zoomingImage
|
71
|
+
:foaf_depicts: depicts
|
72
|
+
:foaf_depiction: depiction
|
70
73
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#:
|
71
|
-
:rdf_type: type
|
74
|
+
:rdf_type: type
|
@@ -65,10 +65,17 @@ module Cul::Scv::Hydra::Solrizer
|
|
65
65
|
|
66
66
|
def titles(node=mods)
|
67
67
|
# all titles without descending into relatedItems
|
68
|
-
|
68
|
+
# For now, this only includes the main title and selected alternate_titles
|
69
|
+
all_titles = []
|
70
|
+
all_titles << main_title unless main_title.nil?
|
71
|
+
all_titles += alternative_titles unless alternative_titles.nil?
|
72
|
+
end
|
73
|
+
|
74
|
+
def alternative_titles(node=mods)
|
75
|
+
node.xpath('./mods:titleInfo[@type and (@type="alternative" or @type="abbreviated" or @type="translated" or @type="uniform")]', MODS_NS).collect do |t|
|
69
76
|
ScvModsFieldable.normalize(t.text)
|
70
77
|
end
|
71
|
-
|
78
|
+
end
|
72
79
|
|
73
80
|
def names(role_authority=nil, role=nil)
|
74
81
|
# get all the name nodes
|
@@ -93,7 +100,7 @@ module Cul::Scv::Hydra::Solrizer
|
|
93
100
|
# base_text = node.xpath('./mods:namePart', MODS_NS).collect { |c| c.text }.join(' ')
|
94
101
|
# names << ScvModsFieldable.normalize(base_text, true)
|
95
102
|
#end
|
96
|
-
|
103
|
+
|
97
104
|
names
|
98
105
|
end
|
99
106
|
|
@@ -205,15 +212,47 @@ module Cul::Scv::Hydra::Solrizer
|
|
205
212
|
item_in_context_url_val
|
206
213
|
end
|
207
214
|
|
215
|
+
def all_subjects(node=mods)
|
216
|
+
list_of_subjects = []
|
217
|
+
|
218
|
+
node.xpath("./mods:subject/mods:topic", MODS_NS).collect do |n|
|
219
|
+
list_of_subjects << ScvModsFieldable.normalize(n.text, true)
|
220
|
+
end
|
221
|
+
node.xpath("./mods:subject/mods:geographic", MODS_NS).collect do |n|
|
222
|
+
list_of_subjects << ScvModsFieldable.normalize(n.text, true)
|
223
|
+
end
|
224
|
+
node.xpath("./mods:subject/mods:name", MODS_NS).collect do |n|
|
225
|
+
list_of_subjects << ScvModsFieldable.normalize(n.text, true)
|
226
|
+
end
|
227
|
+
node.xpath("./mods:subject/mods:temporal", MODS_NS).collect do |n|
|
228
|
+
list_of_subjects << ScvModsFieldable.normalize(n.text, true)
|
229
|
+
end
|
230
|
+
node.xpath("./mods:subject/mods:titleInfo", MODS_NS).collect do |n|
|
231
|
+
list_of_subjects << ScvModsFieldable.normalize(n.text, true)
|
232
|
+
end
|
233
|
+
node.xpath("./mods:subject/mods:genre", MODS_NS).collect do |n|
|
234
|
+
list_of_subjects << ScvModsFieldable.normalize(n.text, true)
|
235
|
+
end
|
236
|
+
|
237
|
+
return list_of_subjects
|
238
|
+
end
|
239
|
+
|
208
240
|
def to_solr(solr_doc={})
|
209
241
|
solr_doc = (defined? super) ? super : solr_doc
|
242
|
+
|
243
|
+
solr_doc["all_text_teim"] ||= []
|
244
|
+
|
210
245
|
solr_doc["title_si"] = sort_title
|
211
246
|
solr_doc["title_ssm"] = titles
|
247
|
+
solr_doc["alternative_title_ssm"] = alternative_titles
|
248
|
+
solr_doc["all_text_teim"] += solr_doc["alternative_title_ssm"]
|
212
249
|
solr_doc["lib_collection_sim"] = collections
|
213
250
|
solr_doc["lib_name_sim"] = names
|
214
|
-
solr_doc["lib_name_teim"] =
|
215
|
-
solr_doc["all_text_teim"] ||= []
|
251
|
+
solr_doc["lib_name_teim"] = solr_doc["lib_name_sim"]
|
216
252
|
solr_doc["all_text_teim"] += solr_doc["lib_name_teim"]
|
253
|
+
solr_doc["lib_all_subjects_ssm"] = all_subjects
|
254
|
+
solr_doc["lib_all_subjects_teim"] = solr_doc["lib_all_subjects_ssm"]
|
255
|
+
solr_doc["all_text_teim"] += solr_doc["lib_all_subjects_teim"]
|
217
256
|
solr_doc["lib_name_ssm"] = solr_doc["lib_name_sim"]
|
218
257
|
solr_doc["lib_author_sim"] = names(:marcrelator, 'aut')
|
219
258
|
solr_doc["lib_recipient_sim"] = names(:marcrelator, 'rcp')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cul_scv_hydra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Armintor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|