active_triples-solrizer 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ ENV['environment'] ||= 'test'
2
+ require 'coveralls'
3
+ Coveralls.wear!
4
+
5
+ require 'bundler/setup'
6
+ Bundler.setup
7
+
8
+ require 'active_triples/solrizer'
9
+ require 'active_triples'
10
+ require 'pry' unless ENV['CI']
11
+
12
+
13
+ Dir['./spec/support/**/*.rb'].each { |f| require f }
14
+
15
+ RSpec.configure do |config|
16
+ config.color = true
17
+ config.tty = true
18
+
19
+ # Uncomment the following line to get errors and backtrace for deprecation warnings
20
+ # config.raise_errors_for_deprecations!
21
+
22
+ # Use the specified formatter
23
+ config.formatter = :progress
24
+ end
@@ -0,0 +1,1125 @@
1
+ RSpec.shared_context "shared dummy resource class", :a => :b do
2
+ before do
3
+ class DummyResourceShort < ActiveTriples::Resource
4
+ configure :type => RDF::URI('http://example.org/SomeClass')
5
+ property :title, :predicate => RDF::SCHEMA.title do |index|
6
+ index.data_type = :text
7
+ index.as :indexed, :sortable # test tokenized text that also has sort field
8
+ end
9
+ property :description_si, :predicate => RDF::SCHEMA.description do |index|
10
+ index.data_type = :text
11
+ index.as :stored, :indexed
12
+ end
13
+ property :borrower_uri_i, :predicate => RDF::SCHEMA.borrower do |index|
14
+ index.data_type = :string
15
+ index.as :indexed
16
+ end
17
+ property :clip_number_simr, :predicate => RDF::SCHEMA.clipNumber do |index|
18
+ index.data_type = :integer
19
+ index.as :stored, :indexed, :multiValued, :range
20
+ end
21
+ property :price_s, :predicate => RDF::SCHEMA.price do |index|
22
+ index.data_type = :float
23
+ index.as :stored
24
+ end
25
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
26
+ end
27
+
28
+ # :coordinate - used to index the lat and long components for the "location"
29
+ # :location
30
+ # :guess - allow guessing of the type based on the type of the property value
31
+
32
+ class DummyResourceIndexed < ActiveTriples::Resource
33
+ configure :type => RDF::URI('http://example.org/SomeClass')
34
+ property :title, :predicate => RDF::SCHEMA.title do |index|
35
+ index.data_type = :text_en
36
+ index.as :indexed
37
+ end
38
+ property :description, :predicate => RDF::SCHEMA.description do |index|
39
+ index.data_type = :text
40
+ index.as :indexed
41
+ end
42
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
43
+ index.data_type = :string
44
+ index.as :indexed
45
+ end
46
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
47
+ index.data_type = :integer
48
+ index.as :indexed
49
+ end
50
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
51
+ index.data_type = :long
52
+ index.as :indexed
53
+ end
54
+ property :price, :predicate => RDF::SCHEMA.price do |index|
55
+ index.data_type = :float
56
+ index.as :indexed
57
+ end
58
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
59
+ index.data_type = :double
60
+ index.as :indexed
61
+ end
62
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
63
+ index.data_type = :date
64
+ index.as :indexed
65
+ end
66
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
67
+ index.data_type = :boolean
68
+ index.as :indexed
69
+ end
70
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
71
+ # index.data_type = :location
72
+ # index.as :indexed
73
+ # end
74
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
75
+ end
76
+
77
+ class DummyResourceStored < ActiveTriples::Resource
78
+ configure :type => RDF::URI('http://example.org/SomeClass')
79
+ property :title, :predicate => RDF::SCHEMA.title do |index|
80
+ index.data_type = :text_en
81
+ index.as :stored
82
+ end
83
+ property :description, :predicate => RDF::SCHEMA.description do |index|
84
+ index.data_type = :text
85
+ index.as :stored
86
+ end
87
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
88
+ index.data_type = :string
89
+ index.as :stored
90
+ end
91
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
92
+ index.data_type = :integer
93
+ index.as :stored
94
+ end
95
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
96
+ index.data_type = :long
97
+ index.as :stored
98
+ end
99
+ property :price, :predicate => RDF::SCHEMA.price do |index|
100
+ index.data_type = :float
101
+ index.as :stored
102
+ end
103
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
104
+ index.data_type = :double
105
+ index.as :stored
106
+ end
107
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
108
+ index.data_type = :date
109
+ index.as :stored
110
+ end
111
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
112
+ index.data_type = :boolean
113
+ index.as :stored
114
+ end
115
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
116
+ # index.data_type = :location
117
+ # index.as :stored
118
+ # end
119
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
120
+ end
121
+
122
+ class DummyResourceStoredIndexed < ActiveTriples::Resource
123
+ configure :type => RDF::URI('http://example.org/SomeClass')
124
+ property :title, :predicate => RDF::SCHEMA.title do |index|
125
+ index.data_type = :text_en
126
+ index.as :stored, :indexed
127
+ end
128
+ property :description, :predicate => RDF::SCHEMA.description do |index|
129
+ index.data_type = :text
130
+ index.as :stored, :indexed
131
+ end
132
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
133
+ index.data_type = :string
134
+ index.as :stored, :indexed
135
+ end
136
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
137
+ index.data_type = :integer
138
+ index.as :stored, :indexed
139
+ end
140
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
141
+ index.data_type = :long
142
+ index.as :stored, :indexed
143
+ end
144
+ property :price, :predicate => RDF::SCHEMA.price do |index|
145
+ index.data_type = :float
146
+ index.as :stored, :indexed
147
+ end
148
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
149
+ index.data_type = :double
150
+ index.as :stored, :indexed
151
+ end
152
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
153
+ index.data_type = :date
154
+ index.as :stored, :indexed
155
+ end
156
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
157
+ index.data_type = :boolean
158
+ index.as :stored, :indexed
159
+ end
160
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
161
+ # index.data_type = :location
162
+ # index.as :stored, :indexed
163
+ # end
164
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
165
+ end
166
+
167
+ class DummyResourceIndexedMulti < ActiveTriples::Resource
168
+ configure :type => RDF::URI('http://example.org/SomeClass')
169
+ property :title, :predicate => RDF::SCHEMA.title do |index|
170
+ index.data_type = :text_en
171
+ index.as :indexed, :multiValued
172
+ end
173
+ property :description, :predicate => RDF::SCHEMA.description do |index|
174
+ index.data_type = :text
175
+ index.as :indexed, :multiValued
176
+ end
177
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
178
+ index.data_type = :string
179
+ index.as :indexed, :multiValued
180
+ end
181
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
182
+ index.data_type = :integer
183
+ index.as :indexed, :multiValued
184
+ end
185
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
186
+ index.data_type = :long
187
+ index.as :indexed, :multiValued
188
+ end
189
+ property :price, :predicate => RDF::SCHEMA.price do |index|
190
+ index.data_type = :float
191
+ index.as :indexed, :multiValued
192
+ end
193
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
194
+ index.data_type = :double
195
+ index.as :indexed, :multiValued
196
+ end
197
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
198
+ index.data_type = :date
199
+ index.as :indexed, :multiValued
200
+ end
201
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
202
+ index.data_type = :boolean
203
+ index.as :indexed, :multiValued
204
+ end
205
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
206
+ # index.data_type = :location
207
+ # index.as :indexed, :multiValued
208
+ # end
209
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
210
+ end
211
+
212
+ class DummyResourceStoredMulti < ActiveTriples::Resource
213
+ configure :type => RDF::URI('http://example.org/SomeClass')
214
+ property :title, :predicate => RDF::SCHEMA.title do |index|
215
+ index.data_type = :text_en
216
+ index.as :stored, :multiValued, :multiValued
217
+ end
218
+ property :description, :predicate => RDF::SCHEMA.description do |index|
219
+ index.data_type = :text
220
+ index.as :stored, :multiValued
221
+ end
222
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
223
+ index.data_type = :string
224
+ index.as :stored, :multiValued
225
+ end
226
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
227
+ index.data_type = :integer
228
+ index.as :stored, :multiValued
229
+ end
230
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
231
+ index.data_type = :long
232
+ index.as :stored, :multiValued
233
+ end
234
+ property :price, :predicate => RDF::SCHEMA.price do |index|
235
+ index.data_type = :float
236
+ index.as :stored, :multiValued
237
+ end
238
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
239
+ index.data_type = :double
240
+ index.as :stored, :multiValued
241
+ end
242
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
243
+ index.data_type = :date
244
+ index.as :stored, :multiValued
245
+ end
246
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
247
+ index.data_type = :boolean
248
+ index.as :stored, :multiValued
249
+ end
250
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
251
+ # index.data_type = :location
252
+ # index.as :stored, :multiValued
253
+ # end
254
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
255
+ end
256
+
257
+ class DummyResourceStoredIndexedMulti < ActiveTriples::Resource
258
+ configure :type => RDF::URI('http://example.org/SomeClass')
259
+ property :title, :predicate => RDF::SCHEMA.title do |index|
260
+ index.data_type = :text_en
261
+ index.as :stored, :indexed, :multiValued
262
+ end
263
+ property :description, :predicate => RDF::SCHEMA.description do |index|
264
+ index.data_type = :text
265
+ index.as :stored, :indexed, :multiValued
266
+ end
267
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
268
+ index.data_type = :string
269
+ index.as :stored, :indexed, :multiValued
270
+ end
271
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
272
+ index.data_type = :integer
273
+ index.as :stored, :indexed, :multiValued
274
+ end
275
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
276
+ index.data_type = :long
277
+ index.as :stored, :indexed, :multiValued
278
+ end
279
+ property :price, :predicate => RDF::SCHEMA.price do |index|
280
+ index.data_type = :float
281
+ index.as :stored, :indexed, :multiValued
282
+ end
283
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
284
+ index.data_type = :double
285
+ index.as :stored, :indexed, :multiValued
286
+ end
287
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
288
+ index.data_type = :date
289
+ index.as :stored, :indexed, :multiValued
290
+ end
291
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
292
+ index.data_type = :boolean
293
+ index.as :stored, :indexed, :multiValued
294
+ end
295
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
296
+ # index.data_type = :location
297
+ # index.as :stored, :indexed, :multiValued
298
+ # end
299
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
300
+ end
301
+
302
+ class DummyResourceIndexedRange < ActiveTriples::Resource
303
+ configure :type => RDF::URI('http://example.org/SomeClass')
304
+ property :title, :predicate => RDF::SCHEMA.title do |index|
305
+ index.data_type = :text_en
306
+ index.as :indexed, :range
307
+ end
308
+ property :description, :predicate => RDF::SCHEMA.description do |index|
309
+ index.data_type = :text
310
+ index.as :indexed, :range
311
+ end
312
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
313
+ index.data_type = :string
314
+ index.as :indexed, :range
315
+ end
316
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
317
+ index.data_type = :integer
318
+ index.as :indexed, :range
319
+ end
320
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
321
+ index.data_type = :long
322
+ index.as :indexed, :range
323
+ end
324
+ property :price, :predicate => RDF::SCHEMA.price do |index|
325
+ index.data_type = :float
326
+ index.as :indexed, :range
327
+ end
328
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
329
+ index.data_type = :double
330
+ index.as :indexed, :range
331
+ end
332
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
333
+ index.data_type = :date
334
+ index.as :indexed, :range
335
+ end
336
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
337
+ index.data_type = :boolean
338
+ index.as :indexed, :range
339
+ end
340
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
341
+ # index.data_type = :location
342
+ # index.as :indexed, :range
343
+ # end
344
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
345
+ end
346
+
347
+ class DummyResourceIndexedSort < ActiveTriples::Resource
348
+ configure :type => RDF::URI('http://example.org/SomeClass')
349
+ property :title, :predicate => RDF::SCHEMA.title do |index|
350
+ index.data_type = :text_en
351
+ index.as :indexed, :sortable
352
+ end
353
+ property :description, :predicate => RDF::SCHEMA.description do |index|
354
+ index.data_type = :text
355
+ index.as :indexed, :sortable
356
+ end
357
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
358
+ index.data_type = :string
359
+ index.as :indexed, :sortable
360
+ end
361
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
362
+ index.data_type = :integer
363
+ index.as :indexed, :sortable
364
+ end
365
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
366
+ index.data_type = :long
367
+ index.as :indexed, :sortable
368
+ end
369
+ property :price, :predicate => RDF::SCHEMA.price do |index|
370
+ index.data_type = :float
371
+ index.as :indexed, :sortable
372
+ end
373
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
374
+ index.data_type = :double
375
+ index.as :indexed, :sortable
376
+ end
377
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
378
+ index.data_type = :date
379
+ index.as :indexed, :sortable
380
+ end
381
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
382
+ index.data_type = :boolean
383
+ index.as :indexed, :sortable
384
+ end
385
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
386
+ # index.data_type = :location
387
+ # index.as :indexed, :sortable
388
+ # end
389
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
390
+ end
391
+
392
+ class DummyResourceIndexedVector < ActiveTriples::Resource
393
+ configure :type => RDF::URI('http://example.org/SomeClass')
394
+ property :title, :predicate => RDF::SCHEMA.title do |index|
395
+ index.data_type = :text_en
396
+ index.as :indexed, :vectored
397
+ end
398
+ property :description, :predicate => RDF::SCHEMA.description do |index|
399
+ index.data_type = :text
400
+ index.as :indexed, :vectored
401
+ end
402
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
403
+ index.data_type = :string
404
+ index.as :indexed, :vectored
405
+ end
406
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
407
+ index.data_type = :integer
408
+ index.as :indexed, :vectored
409
+ end
410
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
411
+ index.data_type = :long
412
+ index.as :indexed, :vectored
413
+ end
414
+ property :price, :predicate => RDF::SCHEMA.price do |index|
415
+ index.data_type = :float
416
+ index.as :indexed, :vectored
417
+ end
418
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
419
+ index.data_type = :double
420
+ index.as :indexed, :vectored
421
+ end
422
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
423
+ index.data_type = :date
424
+ index.as :indexed, :vectored
425
+ end
426
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
427
+ index.data_type = :boolean
428
+ index.as :indexed, :vectored
429
+ end
430
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
431
+ # index.data_type = :location
432
+ # index.as :indexed, :vectored
433
+ # end
434
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
435
+ end
436
+
437
+ class DummyResourceIndexedGuess < ActiveTriples::Resource
438
+ configure :type => RDF::URI('http://example.org/SomeClass')
439
+ property :title, :predicate => RDF::SCHEMA.title do |index|
440
+ index.data_type = :guess
441
+ index.as :indexed
442
+ end
443
+ property :description, :predicate => RDF::SCHEMA.description do |index|
444
+ index.data_type = :guess
445
+ index.as :indexed
446
+ end
447
+ property :borrower_uri, :predicate => RDF::SCHEMA.borrower do |index|
448
+ index.data_type = :guess
449
+ index.as :indexed
450
+ end
451
+ property :clip_number, :predicate => RDF::SCHEMA.clipNumber do |index|
452
+ index.data_type = :guess
453
+ index.as :indexed
454
+ end
455
+ property :answer_count, :predicate => RDF::SCHEMA.answerCount do |index|
456
+ index.data_type = :guess
457
+ index.as :indexed
458
+ end
459
+ property :price, :predicate => RDF::SCHEMA.price do |index|
460
+ index.data_type = :guess
461
+ index.as :indexed
462
+ end
463
+ property :max_price, :predicate => RDF::SCHEMA.maxPrice do |index|
464
+ index.data_type = :guess
465
+ index.as :indexed
466
+ end
467
+ property :modified_time, :predicate => RDF::SCHEMA.modifiedTime do |index|
468
+ index.data_type = :guess
469
+ index.as :indexed
470
+ end
471
+ property :is_proprietary, :predicate => RDF::SCHEMA.isProprietary do |index|
472
+ index.data_type = :guess
473
+ index.as :indexed
474
+ end
475
+ # property :latitude, :predicate => RDF::SCHEMA.latitude do |index|
476
+ # index.data_type = :guess
477
+ # index.as :indexed
478
+ # end
479
+ property :bookEdition, :predicate => RDF::SCHEMA.bookEdition # test non-indexed property
480
+ end
481
+
482
+ ActiveTriples::Repositories.add_repository :default, RDF::Repository.new
483
+ end
484
+
485
+ after do
486
+ if Object
487
+ Object.send(:remove_const, "DummyResourceShort")
488
+ Object.send(:remove_const, "DummyResourceIndexed")
489
+ Object.send(:remove_const, "DummyResourceStored")
490
+ Object.send(:remove_const, "DummyResourceStoredIndexed")
491
+ Object.send(:remove_const, "DummyResourceIndexedMulti")
492
+ Object.send(:remove_const, "DummyResourceStoredMulti")
493
+ Object.send(:remove_const, "DummyResourceStoredIndexedMulti")
494
+ Object.send(:remove_const, "DummyResourceIndexedRange")
495
+ Object.send(:remove_const, "DummyResourceIndexedSort")
496
+ Object.send(:remove_const, "DummyResourceIndexedVector")
497
+ Object.send(:remove_const, "DummyResourceIndexedGuess")
498
+ end
499
+ ActiveTriples::Repositories.clear_repositories!
500
+ end
501
+
502
+ # ===================
503
+
504
+ let (:dr_short_all_values) do
505
+ dr = DummyResourceShort.new('http://www.example.org/dr1')
506
+ dr.title = 'Test Title'
507
+ dr.description_si = 'Test text description stored and indexed.'
508
+ dr.borrower_uri_i = 'http://example.org/i/b2'
509
+ dr.clip_number_simr = [7,8,9,10]
510
+ dr.price_s = 789.01
511
+ dr.bookEdition = 'Ed. 2'
512
+ dr
513
+ end
514
+
515
+ let (:expected_object_profile_short_all_values) do
516
+ '{"id":"http://www.example.org/dr1",'\
517
+ '"title":["Test Title"],'\
518
+ '"description_si":["Test text description stored and indexed."],'\
519
+ '"borrower_uri_i":["http://example.org/i/b2"],'\
520
+ '"clip_number_simr":[7,8,9,10],'\
521
+ '"price_s":[789.01],'\
522
+ '"bookEdition":["Ed. 2"]}'
523
+ end
524
+
525
+ let (:expected_solr_properties_short_all_values) do
526
+ {
527
+ :title_ti=>"Test Title",
528
+ :title_ssort=>"Test Title",
529
+ :description_si_tsi=>"Test text description stored and indexed.",
530
+ :borrower_uri_i_si=>"http://example.org/i/b2",
531
+ :clip_number_simr_itsim=>[7,8,9,10],
532
+ :price_s_fs=>789.01
533
+ }
534
+ end
535
+
536
+ let (:expected_solr_doc_short_all_values) do
537
+ {
538
+ :id=>"http://www.example.org/dr1",
539
+ :at_model_ssi=>"DummyResourceShort",
540
+ :object_profile_ss=>expected_object_profile_short_all_values,
541
+ }.merge(expected_solr_properties_short_all_values)
542
+ end
543
+
544
+ let (:dr_short_partial_values) do
545
+ dr = DummyResourceShort.new('http://www.example.org/dr1')
546
+ dr.title = 'Test Title'
547
+ dr.description_si = 'Test text description stored and indexed.'
548
+ dr.price_s = 789.01
549
+ dr.bookEdition = 'Ed. 2'
550
+ dr
551
+ end
552
+
553
+ let (:expected_object_profile_short_partial_values) do
554
+ '{"id":"http://www.example.org/dr1",'\
555
+ '"title":["Test Title"],'\
556
+ '"description_si":["Test text description stored and indexed."],'\
557
+ '"borrower_uri_i":[],'\
558
+ '"clip_number_simr":[],'\
559
+ '"price_s":[789.01],'\
560
+ '"bookEdition":["Ed. 2"]}'
561
+ end
562
+
563
+ let (:expected_solr_properties_short_partial_values) do
564
+ {
565
+ :title_ti=>"Test Title",
566
+ :title_ssort=>"Test Title",
567
+ :description_si_tsi=>"Test text description stored and indexed.",
568
+ :price_s_fs=>789.01
569
+ }
570
+ end
571
+
572
+ let (:expected_solr_doc_short_partial_values) do
573
+ {
574
+ :id=>"http://www.example.org/dr1",
575
+ :at_model_ssi=>"DummyResourceShort",
576
+ :object_profile_ss=>expected_object_profile_short_partial_values,
577
+ }.merge(expected_solr_properties_short_partial_values)
578
+ end
579
+
580
+ # ===================
581
+
582
+ let (:dr_indexed) do
583
+ dr = DummyResourceIndexed.new('http://www.example.org/dr_i')
584
+ dr.title = 'Test Title'
585
+ dr.description = 'Test text description indexed.'
586
+ dr.borrower_uri = 'http://example.org/b_i'
587
+ dr.clip_number = 1
588
+ dr.answer_count = 12345678901234567891
589
+ dr.price = 123.41
590
+ dr.max_price = 12345678901234567.81
591
+ dr.modified_time = '1995-12-31T23:59:51Z'
592
+ dr.is_proprietary = true
593
+ # dr.latitude =
594
+ dr.bookEdition = 'Ed. 1'
595
+ dr
596
+ end
597
+
598
+ let (:expected_object_profile_indexed) do
599
+ '{"id":"http://www.example.org/dr_i",'\
600
+ '"title":["Test Title"],'\
601
+ '"description":["Test text description indexed."],'\
602
+ '"borrower_uri":["http://example.org/b_i"],'\
603
+ '"clip_number":[1],'\
604
+ '"answer_count":[12345678901234567891],'\
605
+ '"price":[123.41],'\
606
+ '"max_price":[1.2345678901234568e+16],'\
607
+ '"modified_time":["1995-12-31T23:59:51Z"],'\
608
+ '"is_proprietary":[true],'\
609
+ '"bookEdition":["Ed. 1"]}'
610
+ end
611
+
612
+ let (:expected_solr_properties_indexed) do
613
+ {
614
+ :title_tei=>"Test Title",
615
+ :description_ti=>"Test text description indexed.",
616
+ :borrower_uri_si=>"http://example.org/b_i",
617
+ :clip_number_ii=>1,
618
+ :answer_count_li=>12345678901234567891,
619
+ :price_fi=>123.41,
620
+ :max_price_dbi=>12345678901234567.81,
621
+ :modified_time_dti=>"1995-12-31T23:59:51Z",
622
+ :is_proprietary_bi=>true
623
+ }
624
+ end
625
+
626
+ let (:expected_solr_doc_indexed) do
627
+ {
628
+ :id=>"http://www.example.org/dr_i",
629
+ :at_model_ssi=>"DummyResourceIndexed",
630
+ :object_profile_ss=>expected_object_profile_indexed,
631
+ }.merge(expected_solr_properties_indexed)
632
+ end
633
+
634
+ # ===================
635
+
636
+ let (:dr_stored) do
637
+ dr = DummyResourceStored.new('http://www.example.org/dr_s')
638
+ dr.title = 'Test Title'
639
+ dr.description = 'Test text description stored.'
640
+ dr.borrower_uri = 'http://example.org/b_s'
641
+ dr.clip_number = 2
642
+ dr.answer_count = 12345678901234567892
643
+ dr.price = 123.42
644
+ dr.max_price = 12345678901234567.82
645
+ dr.modified_time = '1995-12-31T23:59:52Z'
646
+ dr.is_proprietary = false
647
+ # dr.latitude =
648
+ dr.bookEdition = 'Ed. 2'
649
+ dr
650
+ end
651
+
652
+ let (:expected_object_profile_stored) do
653
+ '{"id":"http://www.example.org/dr_s",'\
654
+ '"title":["Test Title"],'\
655
+ '"description":["Test text description stored."],'\
656
+ '"borrower_uri":["http://example.org/b_s"],'\
657
+ '"clip_number":[2],'\
658
+ '"answer_count":[12345678901234567892],'\
659
+ '"price":[123.42],'\
660
+ '"max_price":[1.2345678901234568e+16],'\
661
+ '"modified_time":["1995-12-31T23:59:52Z"],'\
662
+ '"is_proprietary":[false],'\
663
+ '"bookEdition":["Ed. 2"]}'
664
+ end
665
+
666
+ let (:expected_solr_properties_stored) do
667
+ {
668
+ :title_tes=>"Test Title",
669
+ :description_ts=>"Test text description stored.",
670
+ :borrower_uri_ss=>"http://example.org/b_s",
671
+ :clip_number_is=>2,
672
+ :answer_count_ls=>12345678901234567892,
673
+ :price_fs=>123.42,
674
+ :max_price_dbs=>12345678901234567.82,
675
+ :modified_time_dts=>"1995-12-31T23:59:52Z",
676
+ :is_proprietary_bs=>false
677
+ }
678
+ end
679
+
680
+ let (:expected_solr_doc_stored) do
681
+ {
682
+ :id=>"http://www.example.org/dr_s",
683
+ :at_model_ssi=>"DummyResourceStored",
684
+ :object_profile_ss=>expected_object_profile_stored,
685
+ }.merge(expected_solr_properties_stored)
686
+ end
687
+
688
+ # ===================
689
+
690
+ let (:dr_stored_indexed) do
691
+ dr = DummyResourceStoredIndexed.new('http://www.example.org/dr_si')
692
+ dr.title = 'Test Title'
693
+ dr.description = 'Test text description stored and indexed.'
694
+ dr.borrower_uri = 'http://example.org/b_si'
695
+ dr.clip_number = 3
696
+ dr.answer_count = 12345678901234567893
697
+ dr.price = 123.43
698
+ dr.max_price = 12345678901234567.83
699
+ dr.modified_time = '1995-12-31T23:59:53Z'
700
+ dr.is_proprietary = false
701
+ # dr.latitude =
702
+ dr.bookEdition = 'Ed. 3'
703
+ dr
704
+ end
705
+
706
+ let (:expected_object_profile_stored_indexed) do
707
+ '{"id":"http://www.example.org/dr_si",'\
708
+ '"title":["Test Title"],'\
709
+ '"description":["Test text description stored and indexed."],'\
710
+ '"borrower_uri":["http://example.org/b_si"],'\
711
+ '"clip_number":[3],'\
712
+ '"answer_count":[12345678901234567893],'\
713
+ '"price":[123.43],'\
714
+ '"max_price":[1.2345678901234568e+16],'\
715
+ '"modified_time":["1995-12-31T23:59:53Z"],'\
716
+ '"is_proprietary":[false],'\
717
+ '"bookEdition":["Ed. 3"]}'
718
+ end
719
+
720
+ let (:expected_solr_properties_stored_indexed) do
721
+ {
722
+ :title_tesi=>"Test Title",
723
+ :description_tsi=>"Test text description stored and indexed.",
724
+ :borrower_uri_ssi=>"http://example.org/b_si",
725
+ :clip_number_isi=>3,
726
+ :answer_count_lsi=>12345678901234567893,
727
+ :price_fsi=>123.43,
728
+ :max_price_dbsi=>12345678901234567.83,
729
+ :modified_time_dtsi=>"1995-12-31T23:59:53Z",
730
+ :is_proprietary_bsi=>false
731
+ }
732
+ end
733
+
734
+ let (:expected_solr_doc_stored_indexed) do
735
+ {
736
+ :id=>"http://www.example.org/dr_si",
737
+ :at_model_ssi=>"DummyResourceStoredIndexed",
738
+ :object_profile_ss=>expected_object_profile_stored_indexed,
739
+ }.merge(expected_solr_properties_stored_indexed)
740
+ end
741
+
742
+ # ===================
743
+ # ===================
744
+
745
+ let (:dr_indexed_multi) do
746
+ dr = DummyResourceIndexedMulti.new('http://www.example.org/dr_im')
747
+ dr.title = ['Test Title','Title 2']
748
+ dr.description = ['Test text description indexed and multi values.','Desc 2','Desc 3']
749
+ dr.borrower_uri = ['http://example.org/b_im','http://example.org/b_im2']
750
+ dr.clip_number = [1,2,3,4]
751
+ dr.answer_count = [12345678901234567891,22345678901234567891]
752
+ dr.price = [123.41,223.41]
753
+ dr.max_price = [12345678901234567.81,22345678901234567.81]
754
+ dr.modified_time = ['1995-12-31T23:59:51Z','2015-12-31T23:59:51Z']
755
+ dr.is_proprietary = [true,false]
756
+ # dr.latitude =
757
+ dr.bookEdition = ['Ed. 1','Ed. 1a']
758
+ dr
759
+ end
760
+
761
+ let (:expected_object_profile_indexed_multi) do
762
+ '{"id":"http://www.example.org/dr_im",'\
763
+ '"title":["Test Title","Title 2"],'\
764
+ '"description":["Test text description indexed and multi values.","Desc 2","Desc 3"],'\
765
+ '"borrower_uri":["http://example.org/b_im","http://example.org/b_im2"],'\
766
+ '"clip_number":[1,2,3,4],'\
767
+ '"answer_count":[12345678901234567891,22345678901234567891],'\
768
+ '"price":[123.41,223.41],'\
769
+ '"max_price":[1.2345678901234568e+16,2.234567890123457e+16],'\
770
+ '"modified_time":["1995-12-31T23:59:51Z","2015-12-31T23:59:51Z"],'\
771
+ '"is_proprietary":[true,false],'\
772
+ '"bookEdition":["Ed. 1","Ed. 1a"]}'
773
+ end
774
+
775
+ let (:expected_solr_properties_indexed_multi) do
776
+ {
777
+ :title_teim=>["Test Title","Title 2"],
778
+ :description_tim=>["Test text description indexed and multi values.","Desc 2","Desc 3"],
779
+ :borrower_uri_sim=>["http://example.org/b_im","http://example.org/b_im2"],
780
+ :clip_number_iim=>[1,2,3,4],
781
+ :answer_count_lim=>[12345678901234567891,22345678901234567891],
782
+ :price_fim=>[123.41,223.41],
783
+ :max_price_dbim=>[12345678901234567.81,22345678901234567.81],
784
+ :modified_time_dtim=>["1995-12-31T23:59:51Z","2015-12-31T23:59:51Z"],
785
+ :is_proprietary_bi=>true # multi-value not allowed for boolean; use first value
786
+ }
787
+ end
788
+
789
+ let (:expected_solr_doc_indexed_multi) do
790
+ {
791
+ :id=>"http://www.example.org/dr_im",
792
+ :at_model_ssi=>"DummyResourceIndexedMulti",
793
+ :object_profile_ss=>expected_object_profile_indexed_multi,
794
+ }.merge(expected_solr_properties_indexed_multi)
795
+ end
796
+
797
+ # ===================
798
+
799
+ let (:dr_stored_multi) do
800
+ dr = DummyResourceStoredMulti.new('http://www.example.org/dr_sm')
801
+ dr.title = ['Test Title','Title 2']
802
+ dr.description = ['Test text description stored and multi values.','Desc 2','Desc 3']
803
+ dr.borrower_uri = ['http://example.org/b_sm','http://example.org/b_sm2']
804
+ dr.clip_number = [2,3,4,5]
805
+ dr.answer_count = [12345678901234567892,22345678901234567892]
806
+ dr.price = [123.42,223.42]
807
+ dr.max_price = [12345678901234567.82,22345678901234567.82]
808
+ dr.modified_time = ['1995-12-31T23:59:52Z','2015-12-31T23:59:52Z']
809
+ dr.is_proprietary = [false,true]
810
+ # dr.latitude =
811
+ dr.bookEdition = ['Ed. 2','Ed. 2a']
812
+ dr
813
+ end
814
+
815
+ let (:expected_object_profile_stored_multi) do
816
+ '{"id":"http://www.example.org/dr_sm",'\
817
+ '"title":["Test Title","Title 2"],'\
818
+ '"description":["Test text description stored and multi values.","Desc 2","Desc 3"],'\
819
+ '"borrower_uri":["http://example.org/b_sm","http://example.org/b_sm2"],'\
820
+ '"clip_number":[2,3,4,5],'\
821
+ '"answer_count":[12345678901234567892,22345678901234567892],'\
822
+ '"price":[123.42,223.42],'\
823
+ '"max_price":[1.2345678901234568e+16,2.234567890123457e+16],'\
824
+ '"modified_time":["1995-12-31T23:59:52Z","2015-12-31T23:59:52Z"],'\
825
+ '"is_proprietary":[false,true],'\
826
+ '"bookEdition":["Ed. 2","Ed. 2a"]}'
827
+ end
828
+
829
+ let (:expected_solr_properties_stored_multi) do
830
+ {
831
+ :title_tesm=>["Test Title","Title 2"],
832
+ :description_tsm=>["Test text description stored and multi values.","Desc 2","Desc 3"],
833
+ :borrower_uri_ssm=>["http://example.org/b_sm","http://example.org/b_sm2"],
834
+ :clip_number_ism=>[2,3,4,5],
835
+ :answer_count_lsm=>[12345678901234567892,22345678901234567892],
836
+ :price_fsm=>[123.42,223.42],
837
+ :max_price_dbsm=>[12345678901234567.82,22345678901234567.82],
838
+ :modified_time_dtsm=>["1995-12-31T23:59:52Z","2015-12-31T23:59:52Z"],
839
+ :is_proprietary_bs=>false
840
+ }
841
+ end
842
+
843
+ let (:expected_solr_doc_stored_multi) do
844
+ {
845
+ :id=>"http://www.example.org/dr_sm",
846
+ :at_model_ssi=>"DummyResourceStoredMulti",
847
+ :object_profile_ss=>expected_object_profile_stored_multi,
848
+ }.merge(expected_solr_properties_stored_multi)
849
+ end
850
+
851
+ # ===================
852
+
853
+ let (:dr_stored_indexed_multi) do
854
+ dr = DummyResourceStoredIndexedMulti.new('http://www.example.org/dr_sim')
855
+ dr.title = ['Test Title','Title 2']
856
+ dr.description = ['Test text description stored and indexed and multi values.','Desc 2','Desc 3']
857
+ dr.borrower_uri = ['http://example.org/b_sim','http://example.org/b_sim3']
858
+ dr.clip_number = [3,4,5,6]
859
+ dr.answer_count = [12345678901234567893,32345678901234567893]
860
+ dr.price = [123.43,323.43]
861
+ dr.max_price = [12345678901234567.83,32345678901234567.83]
862
+ dr.modified_time = ['1995-12-31T23:59:53Z','2015-12-31T23:59:53Z']
863
+ dr.is_proprietary = [false,true]
864
+ # dr.latitude =
865
+ dr.bookEdition = ['Ed. 3','Ed. 3a']
866
+ dr
867
+ end
868
+
869
+ let (:expected_object_profile_stored_indexed_multi) do
870
+ '{"id":"http://www.example.org/dr_sim",'\
871
+ '"title":["Test Title","Title 2"],'\
872
+ '"description":["Test text description stored and indexed and multi values.","Desc 2","Desc 3"],'\
873
+ '"borrower_uri":["http://example.org/b_sim","http://example.org/b_sim3"],'\
874
+ '"clip_number":[3,4,5,6],'\
875
+ '"answer_count":[12345678901234567893,32345678901234567893],'\
876
+ '"price":[123.43,323.43],'\
877
+ '"max_price":[1.2345678901234568e+16,3.234567890123457e+16],'\
878
+ '"modified_time":["1995-12-31T23:59:53Z","2015-12-31T23:59:53Z"],'\
879
+ '"is_proprietary":[false,true],'\
880
+ '"bookEdition":["Ed. 3","Ed. 3a"]}'
881
+ end
882
+
883
+ let (:expected_solr_properties_stored_indexed_multi) do
884
+ {
885
+ :title_tesim=>["Test Title","Title 2"],
886
+ :description_tsim=>["Test text description stored and indexed and multi values.","Desc 2","Desc 3"],
887
+ :borrower_uri_ssim=>["http://example.org/b_sim","http://example.org/b_sim3"],
888
+ :clip_number_isim=>[3,4,5,6],
889
+ :answer_count_lsim=>[12345678901234567893,32345678901234567893],
890
+ :price_fsim=>[123.43,323.43],
891
+ :max_price_dbsim=>[12345678901234567.83,32345678901234567.83],
892
+ :modified_time_dtsim=>["1995-12-31T23:59:53Z","2015-12-31T23:59:53Z"],
893
+ :is_proprietary_bsi=>false
894
+ }
895
+ end
896
+
897
+ let (:expected_solr_doc_stored_indexed_multi) do
898
+ {
899
+ :id=>"http://www.example.org/dr_sim",
900
+ :at_model_ssi=>"DummyResourceStoredIndexedMulti",
901
+ :object_profile_ss=>expected_object_profile_stored_indexed_multi,
902
+ }.merge(expected_solr_properties_stored_indexed_multi)
903
+ end
904
+
905
+ # ===================
906
+ # ===================
907
+
908
+ let (:dr_indexed_range) do
909
+ dr = DummyResourceIndexedRange.new('http://www.example.org/dr_ir')
910
+ dr.title = 'Test Title'
911
+ dr.description = 'Test text description indexed with range.'
912
+ dr.borrower_uri = 'http://example.org/b_ir'
913
+ dr.clip_number = 1
914
+ dr.answer_count = 12345678901234567891
915
+ dr.price = 123.41
916
+ dr.max_price = 12345678901234567.81
917
+ dr.modified_time = '1995-12-31T23:59:51Z'
918
+ dr.is_proprietary = true
919
+ # dr.latitude =
920
+ dr.bookEdition = 'Ed. 1'
921
+ dr
922
+ end
923
+
924
+ let (:expected_object_profile_indexed_range) do
925
+ '{"id":"http://www.example.org/dr_ir",'\
926
+ '"title":["Test Title"],'\
927
+ '"description":["Test text description indexed with range."],'\
928
+ '"borrower_uri":["http://example.org/b_ir"],'\
929
+ '"clip_number":[1],'\
930
+ '"answer_count":[12345678901234567891],'\
931
+ '"price":[123.41],'\
932
+ '"max_price":[1.2345678901234568e+16],'\
933
+ '"modified_time":["1995-12-31T23:59:51Z"],'\
934
+ '"is_proprietary":[true],'\
935
+ '"bookEdition":["Ed. 1"]}'
936
+ end
937
+
938
+ let (:expected_solr_properties_indexed_range) do
939
+ {
940
+ :title_tei=>"Test Title",
941
+ :description_ti=>"Test text description indexed with range.",
942
+ :borrower_uri_si=>"http://example.org/b_ir",
943
+ :clip_number_iti=>1,
944
+ :answer_count_lti=>12345678901234567891,
945
+ :price_fti=>123.41,
946
+ :max_price_dbti=>12345678901234567.81,
947
+ :modified_time_dtti=>"1995-12-31T23:59:51Z",
948
+ :is_proprietary_bi=>true
949
+ }
950
+ end
951
+
952
+ let (:expected_solr_doc_indexed_range) do
953
+ {
954
+ :id=>"http://www.example.org/dr_ir",
955
+ :at_model_ssi=>"DummyResourceIndexedRange",
956
+ :object_profile_ss=>expected_object_profile_indexed_range,
957
+ }.merge(expected_solr_properties_indexed_range)
958
+ end
959
+
960
+ # ===================
961
+
962
+ let (:dr_indexed_sort) do
963
+ dr = DummyResourceIndexedSort.new('http://www.example.org/dr_isort')
964
+ dr.title = 'Test Title'
965
+ dr.description = 'Test text description indexed and sortable.'
966
+ dr.borrower_uri = 'http://example.org/b_isort'
967
+ dr.clip_number = 1
968
+ dr.answer_count = 12345678901234567891
969
+ dr.price = 123.41
970
+ dr.max_price = 12345678901234567.81
971
+ dr.modified_time = '1995-12-31T23:59:51Z'
972
+ dr.is_proprietary = true
973
+ # dr.latitude =
974
+ dr.bookEdition = 'Ed. 1'
975
+ dr
976
+ end
977
+
978
+ let (:expected_object_profile_indexed_sort) do
979
+ '{"id":"http://www.example.org/dr_isort",'\
980
+ '"title":["Test Title"],'\
981
+ '"description":["Test text description indexed and sortable."],'\
982
+ '"borrower_uri":["http://example.org/b_isort"],'\
983
+ '"clip_number":[1],'\
984
+ '"answer_count":[12345678901234567891],'\
985
+ '"price":[123.41],'\
986
+ '"max_price":[1.2345678901234568e+16],'\
987
+ '"modified_time":["1995-12-31T23:59:51Z"],'\
988
+ '"is_proprietary":[true],'\
989
+ '"bookEdition":["Ed. 1"]}'
990
+ end
991
+
992
+ let (:expected_solr_properties_indexed_sort) do
993
+ {
994
+ :title_tei=>"Test Title",
995
+ :title_ssort=>"Test Title",
996
+ :description_ti=>"Test text description indexed and sortable.",
997
+ :description_ssort=>"Test text description indexed and sortable.",
998
+ :borrower_uri_si=>"http://example.org/b_isort",
999
+ :borrower_uri_ssort=>"http://example.org/b_isort",
1000
+ :clip_number_iti=>1,
1001
+ :answer_count_lti=>12345678901234567891,
1002
+ :price_fti=>123.41,
1003
+ :max_price_dbti=>12345678901234567.81,
1004
+ :modified_time_dtti=>"1995-12-31T23:59:51Z",
1005
+ :is_proprietary_bi=>true
1006
+ }
1007
+ end
1008
+
1009
+ let (:expected_solr_doc_indexed_sort) do
1010
+ {
1011
+ :id=>"http://www.example.org/dr_isort",
1012
+ :at_model_ssi=>"DummyResourceIndexedSort",
1013
+ :object_profile_ss=>expected_object_profile_indexed_sort,
1014
+ }.merge(expected_solr_properties_indexed_sort)
1015
+ end
1016
+
1017
+ # ===================
1018
+
1019
+ let (:dr_indexed_vector) do
1020
+ dr = DummyResourceIndexedVector.new('http://www.example.org/dr_iv')
1021
+ dr.title = 'Test Title'
1022
+ dr.description = 'Test text description indexed and vectored.'
1023
+ dr.borrower_uri = 'http://example.org/b_iv'
1024
+ dr.clip_number = 1
1025
+ dr.answer_count = 12345678901234567891
1026
+ dr.price = 123.41
1027
+ dr.max_price = 12345678901234567.81
1028
+ dr.modified_time = '1995-12-31T23:59:51Z'
1029
+ dr.is_proprietary = true
1030
+ # dr.latitude =
1031
+ dr.bookEdition = 'Ed. 1'
1032
+ dr
1033
+ end
1034
+
1035
+ let (:expected_object_profile_indexed_vector) do
1036
+ '{"id":"http://www.example.org/dr_iv",'\
1037
+ '"title":["Test Title"],'\
1038
+ '"description":["Test text description indexed and vectored."],'\
1039
+ '"borrower_uri":["http://example.org/b_iv"],'\
1040
+ '"clip_number":[1],'\
1041
+ '"answer_count":[12345678901234567891],'\
1042
+ '"price":[123.41],'\
1043
+ '"max_price":[1.2345678901234568e+16],'\
1044
+ '"modified_time":["1995-12-31T23:59:51Z"],'\
1045
+ '"is_proprietary":[true],'\
1046
+ '"bookEdition":["Ed. 1"]}'
1047
+ end
1048
+
1049
+ let (:expected_solr_properties_indexed_vector) do
1050
+ {
1051
+ :title_teiv=>"Test Title",
1052
+ :description_tiv=>"Test text description indexed and vectored.",
1053
+ :borrower_uri_si=>"http://example.org/b_iv",
1054
+ :clip_number_ii=>1,
1055
+ :answer_count_li=>12345678901234567891,
1056
+ :price_fi=>123.41,
1057
+ :max_price_dbi=>12345678901234567.81,
1058
+ :modified_time_dti=>"1995-12-31T23:59:51Z",
1059
+ :is_proprietary_bi=>true
1060
+ }
1061
+ end
1062
+
1063
+ let (:expected_solr_doc_indexed_vector) do
1064
+ {
1065
+ :id=>"http://www.example.org/dr_iv",
1066
+ :at_model_ssi=>"DummyResourceIndexedVector",
1067
+ :object_profile_ss=>expected_object_profile_indexed_vector,
1068
+ }.merge(expected_solr_properties_indexed_vector)
1069
+ end
1070
+
1071
+ # ===================
1072
+
1073
+ let (:dr_indexed_guess) do
1074
+ dr = DummyResourceIndexedGuess.new('http://www.example.org/dr_ig')
1075
+ dr.title = 'Test Title'
1076
+ dr.description = 'Test text description indexed and guess type.'
1077
+ dr.borrower_uri = 'http://example.org/b_ig'
1078
+ dr.clip_number = 1
1079
+ dr.answer_count = 12345678901234567891
1080
+ dr.price = 123.41
1081
+ dr.max_price = 12345678901234567.81
1082
+ dr.modified_time = '1995-12-31T23:59:51Z'
1083
+ dr.is_proprietary = true
1084
+ # dr.latitude =
1085
+ dr.bookEdition = 'Ed. 1'
1086
+ dr
1087
+ end
1088
+
1089
+ let (:expected_object_profile_indexed_guess) do
1090
+ '{"id":"http://www.example.org/dr_ig",'\
1091
+ '"title":["Test Title"],'\
1092
+ '"description":["Test text description indexed and guess type."],'\
1093
+ '"borrower_uri":["http://example.org/b_ig"],'\
1094
+ '"clip_number":[1],'\
1095
+ '"answer_count":[12345678901234567891],'\
1096
+ '"price":[123.41],'\
1097
+ '"max_price":[1.2345678901234568e+16],'\
1098
+ '"modified_time":["1995-12-31T23:59:51Z"],'\
1099
+ '"is_proprietary":[true],'\
1100
+ '"bookEdition":["Ed. 1"]}'
1101
+ end
1102
+
1103
+ let (:expected_solr_properties_indexed_guess) do
1104
+ {
1105
+ :title_ti=>"Test Title",
1106
+ :description_ti=>"Test text description indexed and guess type.",
1107
+ :borrower_uri_ti=>"http://example.org/b_ig",
1108
+ :clip_number_ii=>1,
1109
+ :answer_count_li=>12345678901234567891,
1110
+ :price_fi=>123.41,
1111
+ :max_price_fi=>12345678901234567.81,
1112
+ :modified_time_dti=>"1995-12-31T23:59:51Z",
1113
+ :is_proprietary_bi=>true
1114
+ }
1115
+ end
1116
+
1117
+ let (:expected_solr_doc_indexed_guess) do
1118
+ {
1119
+ :id=>"http://www.example.org/dr_ig",
1120
+ :at_model_ssi=>"DummyResourceIndexedGuess",
1121
+ :object_profile_ss=>expected_object_profile_indexed_guess,
1122
+ }.merge(expected_solr_properties_indexed_guess)
1123
+ end
1124
+
1125
+ end