active-fedora 9.7.3 → 9.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +6 -27
- data/History.txt +7 -3
- data/README.md +12 -13
- data/Rakefile +1 -1
- data/active-fedora.gemspec +4 -3
- data/config/fedora.yml +2 -2
- data/config/solr.yml +5 -5
- data/lib/active_fedora/autosave_association.rb +1 -1
- data/lib/active_fedora/file.rb +11 -1
- data/lib/active_fedora/indexing/map.rb +2 -1
- data/lib/active_fedora/nested_attributes.rb +1 -1
- data/lib/active_fedora/rdf/field_map.rb +4 -2
- data/lib/active_fedora/relation/finder_methods.rb +3 -3
- data/lib/active_fedora/scoping/named.rb +0 -1
- data/lib/active_fedora/solr_query_builder.rb +3 -10
- data/lib/active_fedora/version.rb +1 -1
- data/lib/generators/active_fedora/config/fedora/templates/fedora.yml +2 -2
- data/lib/generators/active_fedora/config/solr/solr_generator.rb +0 -1
- data/lib/generators/active_fedora/config/solr/templates/solr.yml +2 -2
- data/lib/tasks/active_fedora_dev.rake +13 -8
- data/solr/config/_rest_managed.json +3 -0
- data/solr/config/admin-extra.html +31 -0
- data/solr/config/elevate.xml +36 -0
- data/solr/config/mapping-ISOLatin1Accent.txt +246 -0
- data/solr/config/protwords.txt +21 -0
- data/solr/config/schema.xml +372 -0
- data/solr/config/scripts.conf +24 -0
- data/solr/config/solrconfig.xml +419 -0
- data/solr/config/spellings.txt +2 -0
- data/solr/config/stopwords.txt +58 -0
- data/solr/config/stopwords_en.txt +58 -0
- data/solr/config/synonyms.txt +31 -0
- data/solr/config/xslt/example.xsl +132 -0
- data/solr/config/xslt/example_atom.xsl +67 -0
- data/solr/config/xslt/example_rss.xsl +66 -0
- data/solr/config/xslt/luke.xsl +337 -0
- data/spec/integration/complex_rdf_datastream_spec.rb +8 -8
- data/spec/integration/datastream_rdf_nested_attributes_spec.rb +3 -3
- data/spec/integration/has_and_belongs_to_many_associations_spec.rb +1 -1
- data/spec/integration/ntriples_datastream_spec.rb +12 -1
- data/spec/integration/rdf_nested_attributes_spec.rb +51 -20
- data/spec/integration/scoped_query_spec.rb +1 -2
- data/spec/samples/hydra-mods_article_datastream.rb +4 -2
- data/spec/unit/active_fedora_spec.rb +0 -3
- data/spec/unit/base_spec.rb +1 -1
- data/spec/unit/finder_methods_spec.rb +2 -2
- data/spec/unit/ntriples_datastream_spec.rb +20 -10
- data/spec/unit/query_spec.rb +10 -10
- data/spec/unit/sparql_insert_spec.rb +1 -1
- metadata +42 -14
- data/config/solr_mappings_af_0.1.yml +0 -9
- data/config/solr_mappings_bl_2.4.yml +0 -17
- data/lib/generators/active_fedora/config/solr/templates/jetty.yml +0 -6
@@ -17,7 +17,7 @@ describe "Nested Rdf Objects" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
let(:ds) do
|
20
|
-
SpecDatastream.new(
|
20
|
+
SpecDatastream.new("#{ActiveFedora.fedora.host}/test/test:124/descMd")
|
21
21
|
end
|
22
22
|
|
23
23
|
describe "#new_record?" do
|
@@ -27,8 +27,8 @@ describe "Nested Rdf Objects" do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "does not be new when it's loaded from fedora" do
|
30
|
-
ds.content =
|
31
|
-
|
30
|
+
ds.content = "_:g70324142325120 <http://purl.org/dc/terms/title> \"Alternator\" .
|
31
|
+
<#{ActiveFedora.fedora.host}/test/test:124> <http://purl.org/dc/terms/hasPart> _:g70324142325120 ."
|
32
32
|
ds.resource.persist!
|
33
33
|
expect(ds.parts.first).to_not be_new_record
|
34
34
|
end
|
@@ -81,8 +81,8 @@ describe "Nested Rdf Objects" do
|
|
81
81
|
it "loads complex objects" do
|
82
82
|
ds.content = <<END
|
83
83
|
_:g70350851837440 <http://purl.org/dc/terms/title> "Alternator" .
|
84
|
-
|
85
|
-
|
84
|
+
<#{ActiveFedora.fedora.host}/test/test:124> <http://purl.org/dc/terms/hasPart> _:g70350851837440 .
|
85
|
+
<#{ActiveFedora.fedora.host}/test/test:124> <http://purl.org/dc/terms/hasPart> _:g70350851833380 .
|
86
86
|
_:g70350851833380 <http://purl.org/dc/terms/title> "Crankshaft" .
|
87
87
|
END
|
88
88
|
expect(ds.parts.first.label).to eq ["Alternator"]
|
@@ -140,7 +140,7 @@ END
|
|
140
140
|
after(:each) do
|
141
141
|
Object.send(:remove_const, :SpecDatastream)
|
142
142
|
end
|
143
|
-
let(:ds) { SpecDatastream.new(
|
143
|
+
let(:ds) { SpecDatastream.new("#{ActiveFedora.fedora.host}/test/test:124/descMd") }
|
144
144
|
|
145
145
|
it "stores the type of complex objects when type is specified" do
|
146
146
|
comp = SpecDatastream::MediatorUser.new nil, ds.graph
|
@@ -154,7 +154,7 @@ END
|
|
154
154
|
it "adds the type of complex object when it is not provided" do
|
155
155
|
ds.content = <<END
|
156
156
|
_:g70350851837440 <http://purl.org/dc/terms/title> "Mediation Person" .
|
157
|
-
|
157
|
+
<#{ActiveFedora.fedora.host}/test/test:124> <http://purl.org/dc/terms/mediator> _:g70350851837440 .
|
158
158
|
END
|
159
159
|
expect(ds.mediator.first.type.first.to_s).to eq "http://purl.org/dc/terms/AgentClass"
|
160
160
|
end
|
@@ -163,7 +163,7 @@ END
|
|
163
163
|
ds.content = <<END
|
164
164
|
_:g70350851837440 <http://purl.org/dc/terms/title> "Mediation Orgainzation" .
|
165
165
|
_:g70350851837440 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.ebu.ch/metadata/ontologies/ebucore#Organisation> .
|
166
|
-
|
166
|
+
<#{ActiveFedora.fedora.host}/test/test:124> <http://purl.org/dc/terms/mediator> _:g70350851837440 .
|
167
167
|
END
|
168
168
|
expect(ds.mediator.first.type.first.to_s).to eq "http://www.ebu.ch/metadata/ontologies/ebucore#Organisation"
|
169
169
|
end
|
@@ -91,7 +91,8 @@ describe "Nesting attribute behavior of RDFDatastream" do
|
|
91
91
|
}
|
92
92
|
# , "Hemings, Sally"
|
93
93
|
]
|
94
|
-
}
|
94
|
+
}
|
95
|
+
}
|
95
96
|
end
|
96
97
|
|
97
98
|
describe "on lists" do
|
@@ -159,8 +160,7 @@ describe "Nesting attribute behavior of RDFDatastream" do
|
|
159
160
|
{ label: 'Alternator' },
|
160
161
|
{ label: 'Distributor' },
|
161
162
|
{ label: 'Transmission' },
|
162
|
-
{ label: 'Fuel Filter' }
|
163
|
-
] }
|
163
|
+
{ label: 'Fuel Filter' }] }
|
164
164
|
end
|
165
165
|
let(:replace_object_id) { subject.parts[1].rdf_subject.to_s }
|
166
166
|
let(:remove_object_id) { subject.parts[3].rdf_subject.to_s }
|
@@ -49,12 +49,23 @@ describe ActiveFedora::NtriplesRDFDatastream do
|
|
49
49
|
@subject.save
|
50
50
|
end
|
51
51
|
|
52
|
+
let(:remote_content) do
|
53
|
+
<<EOF
|
54
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://purl.org/dc/terms/created> "2010-12-31"^^<http://www.w3.org/2001/XMLSchema#date> .
|
55
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://purl.org/dc/terms/title> "Title of work" .
|
56
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://purl.org/dc/terms/publisher> "Penn State" .
|
57
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://xmlns.com/foaf/0.1/based_near> "New York, NY, US" .
|
58
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://www.w3.org/2000/01/rdf-schema#seeAlso> <http://google.com/> .
|
59
|
+
<#{ActiveFedora.fedora.host}/test/test:1/content> <http://purl.org/dc/terms/title> "Title of datastream" .
|
60
|
+
EOF
|
61
|
+
end
|
62
|
+
|
52
63
|
it "saves content properly upon save" do
|
53
64
|
foo = RdfTest.new('test:1') # ID needs to match the subject in the loaded file
|
54
65
|
foo.title = 'Hamlet'
|
55
66
|
foo.save
|
56
67
|
expect(foo.title).to eq 'Hamlet'
|
57
|
-
foo.rdf.content =
|
68
|
+
foo.rdf.content = remote_content
|
58
69
|
foo.save
|
59
70
|
expect(foo.title).to eq 'Title of work'
|
60
71
|
end
|
@@ -4,10 +4,25 @@ describe "Nesting attribute behavior of RDF resources" do
|
|
4
4
|
before do
|
5
5
|
class DummyMADS < RDF::Vocabulary("http://www.loc.gov/mads/rdf/v1#")
|
6
6
|
property :Topic
|
7
|
+
property :Name
|
8
|
+
property :Source
|
9
|
+
end
|
10
|
+
|
11
|
+
class CustomName < ActiveFedora::Base
|
12
|
+
property :pref_label, predicate: ::RDF::SKOS.prefLabel, multiple: false
|
13
|
+
end
|
14
|
+
|
15
|
+
class CustomSource < ActiveFedora::Base
|
7
16
|
end
|
8
17
|
|
9
18
|
class ComplexResource < ActiveFedora::Base
|
10
19
|
property :topic, predicate: DummyMADS.Topic, class_name: "ComplexResource::Topic"
|
20
|
+
property :name, predicate: DummyMADS.Name, class_name: "CustomName" do |index|
|
21
|
+
index.as :stored_searchable, using: :pref_label
|
22
|
+
end
|
23
|
+
property :source, predicate: DummyMADS.Source, class_name: "CustomSource" do |index|
|
24
|
+
index.as :stored_searchable
|
25
|
+
end
|
11
26
|
|
12
27
|
class Topic < ActiveTriples::Resource
|
13
28
|
property :subject, predicate: ::RDF::Vocab::DC.subject
|
@@ -18,37 +33,53 @@ describe "Nesting attribute behavior of RDF resources" do
|
|
18
33
|
after do
|
19
34
|
Object.send(:remove_const, :ComplexResource)
|
20
35
|
Object.send(:remove_const, :DummyMADS)
|
36
|
+
Object.send(:remove_const, :CustomName)
|
37
|
+
Object.send(:remove_const, :CustomSource)
|
21
38
|
end
|
22
39
|
|
23
|
-
|
40
|
+
context "with an AT resource as a property" do
|
41
|
+
subject { ComplexResource.new }
|
24
42
|
|
25
|
-
|
43
|
+
let(:params) { [{ subject: 'Foo' }, { subject: 'Bar' }] }
|
26
44
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
45
|
+
before do
|
46
|
+
ComplexResource.accepts_nested_attributes_for(*args)
|
47
|
+
subject.topic_attributes = params
|
48
|
+
end
|
49
|
+
|
50
|
+
context "when no options are set" do
|
51
|
+
let(:args) { [:topic] }
|
31
52
|
|
32
|
-
|
33
|
-
|
53
|
+
it "sets the attributes" do
|
54
|
+
expect(subject.topic.size).to eq 2
|
55
|
+
expect(subject.topic.map(&:subject)).to eq [['Foo'], ['Bar']]
|
56
|
+
end
|
34
57
|
|
35
|
-
|
36
|
-
|
37
|
-
|
58
|
+
it "marks the attributes as changed" do
|
59
|
+
expect(subject.changed_attributes).to eq('topic' => [])
|
60
|
+
end
|
38
61
|
end
|
39
62
|
|
40
|
-
|
41
|
-
|
63
|
+
context "when reject_if is set" do
|
64
|
+
let(:args) { [:topic, reject_if: reject_proc] }
|
65
|
+
let(:reject_proc) { lambda { |attributes| attributes[:subject] == 'Bar' } }
|
66
|
+
let(:params) { [{ subject: 'Foo' }, { subject: 'Bar' }] }
|
67
|
+
|
68
|
+
it "does not add terms for which the proc is true" do
|
69
|
+
expect(subject.topic.map(&:subject)).to eq [['Foo']]
|
70
|
+
end
|
42
71
|
end
|
43
72
|
end
|
44
73
|
|
45
|
-
context "
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
74
|
+
context "with an AF::Base object as a property" do
|
75
|
+
describe "#to_solr" do
|
76
|
+
let(:name) { CustomName.create(pref_label: "Joe Schmo") }
|
77
|
+
let(:source) { CustomSource.create }
|
78
|
+
let(:solr_doc) { ComplexResource.new(name: [name], source: [source]).to_solr }
|
79
|
+
it "indexes the value of the properties accordingly" do
|
80
|
+
expect(solr_doc).to include("name_tesim" => ["Joe Schmo"])
|
81
|
+
expect(solr_doc).to include("source_tesim" => [source.uri])
|
82
|
+
end
|
52
83
|
end
|
53
84
|
end
|
54
85
|
end
|
@@ -39,7 +39,7 @@ describe ActiveFedora::Querying do
|
|
39
39
|
result = ModelIntegrationSpec::Basic.all.to_a
|
40
40
|
expect(result).to be_instance_of(Array)
|
41
41
|
# this test is meaningless if the array length is zero
|
42
|
-
expect(result).
|
42
|
+
expect(result.length > 0).to be true
|
43
43
|
expect(result).to all(be_an(ModelIntegrationSpec::Basic))
|
44
44
|
end
|
45
45
|
end
|
@@ -67,7 +67,6 @@ describe ActiveFedora::Querying do
|
|
67
67
|
field = ActiveFedora::SolrQueryBuilder.solr_name('foo', type: :string)
|
68
68
|
expect(ModelIntegrationSpec::Basic.where(field => 'Beta')).to eq [test_instance1]
|
69
69
|
expect(ModelIntegrationSpec::Basic.where('foo' => 'Beta')).to eq [test_instance1]
|
70
|
-
expect(ModelIntegrationSpec::Basic.where('foo' => ['Beta', 'Alpha'])).to eq [test_instance1, test_instance2]
|
71
70
|
end
|
72
71
|
it "orders" do
|
73
72
|
expect(ModelIntegrationSpec::Basic.order(ActiveFedora::SolrQueryBuilder.solr_name('foo', :sortable) + ' asc')).to eq [test_instance2, test_instance1, test_instance3]
|
@@ -253,7 +253,8 @@ module Hydra
|
|
253
253
|
"edt" => "Editor",
|
254
254
|
"ill" => "Illustrator",
|
255
255
|
"oth" => "Other",
|
256
|
-
"trl" => "Translator"
|
256
|
+
"trl" => "Translator"
|
257
|
+
}
|
257
258
|
end
|
258
259
|
|
259
260
|
def self.person_relator_terms
|
@@ -267,7 +268,8 @@ module Hydra
|
|
267
268
|
"res" => "Researcher",
|
268
269
|
"rth" => "Research team head",
|
269
270
|
"rtm" => "Research team member",
|
270
|
-
"trl" => "Translator"
|
271
|
+
"trl" => "Translator"
|
272
|
+
}
|
271
273
|
end
|
272
274
|
|
273
275
|
def self.conference_relator_terms
|
@@ -99,7 +99,6 @@ describe ActiveFedora do
|
|
99
99
|
solr_config_path = File.expand_path(File.join(File.dirname(__FILE__), "../fixtures/rails_root/config/solr.yml"))
|
100
100
|
allow(File).to receive(:open).with(fedora_config_path).and_return(fedora_config)
|
101
101
|
allow(File).to receive(:open).with(solr_config_path).and_return(solr_config)
|
102
|
-
allow(ActiveFedora::SolrService).to receive(:load_mappings) # For the solrizer solr_mappings.yml
|
103
102
|
|
104
103
|
described_class.init(fedora_config_path: fedora_config_path, solr_config_path: solr_config_path)
|
105
104
|
expect(described_class.solr.class).to eq ActiveFedora::SolrService
|
@@ -108,8 +107,6 @@ describe ActiveFedora do
|
|
108
107
|
|
109
108
|
describe "with no explicit config path" do
|
110
109
|
it "looks for the file in the path defined at Rails.root" do
|
111
|
-
allow(ActiveFedora::SolrService).to receive(:load_mappings) # necessary or else it will load the solrizer config and it breaks other tests in the suite.
|
112
|
-
|
113
110
|
stub_rails(root: File.join(File.dirname(__FILE__), "../fixtures/rails_root"))
|
114
111
|
described_class.init
|
115
112
|
expect(described_class.config.credentials[:url]).to eq "http://testhost.com:8983/fedora"
|
data/spec/unit/base_spec.rb
CHANGED
@@ -204,7 +204,7 @@ describe ActiveFedora::Base do
|
|
204
204
|
context "when its saved" do
|
205
205
|
before do
|
206
206
|
allow(@test_object).to receive(:new_record?).and_return(false)
|
207
|
-
allow(@test_object).to receive(:uri).and_return(
|
207
|
+
allow(@test_object).to receive(:uri).and_return("#{ActiveFedora.fedora.host}/test/one/two/three")
|
208
208
|
end
|
209
209
|
|
210
210
|
context "#to_param" do
|
@@ -43,8 +43,8 @@ describe ActiveFedora::FinderMethods do
|
|
43
43
|
|
44
44
|
context "when value is an array" do
|
45
45
|
let(:value) { ['one', 'four'] }
|
46
|
-
it { is_expected.to eq "
|
47
|
-
"_query_:\"{!raw f=library_id}four\"
|
46
|
+
it { is_expected.to eq "_query_:\"{!raw f=library_id}one\" AND " \
|
47
|
+
"_query_:\"{!raw f=library_id}four\"" }
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -1,6 +1,17 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe ActiveFedora::NtriplesRDFDatastream do
|
4
|
+
let(:remote_content) do
|
5
|
+
<<EOF
|
6
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://purl.org/dc/terms/created> "2010-12-31"^^<http://www.w3.org/2001/XMLSchema#date> .
|
7
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://purl.org/dc/terms/title> "Title of work" .
|
8
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://purl.org/dc/terms/publisher> "Penn State" .
|
9
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://xmlns.com/foaf/0.1/based_near> "New York, NY, US" .
|
10
|
+
<#{ActiveFedora.fedora.host}/test/test:1> <http://www.w3.org/2000/01/rdf-schema#seeAlso> <http://google.com/> .
|
11
|
+
<#{ActiveFedora.fedora.host}/test/test:1/content> <http://purl.org/dc/terms/title> "Title of datastream" .
|
12
|
+
EOF
|
13
|
+
end
|
14
|
+
|
4
15
|
describe "an instance with content" do
|
5
16
|
before do
|
6
17
|
class MyDatastream < ActiveFedora::NtriplesRDFDatastream
|
@@ -13,13 +24,13 @@ describe ActiveFedora::NtriplesRDFDatastream do
|
|
13
24
|
property :related_url, predicate: ::RDF::RDFS.seeAlso
|
14
25
|
end
|
15
26
|
@subject = MyDatastream.new(ActiveFedora::Base.id_to_uri('/test:1/descMetadata'))
|
16
|
-
@subject.content =
|
27
|
+
@subject.content = remote_content
|
17
28
|
end
|
18
29
|
after do
|
19
30
|
Object.send(:remove_const, :MyDatastream)
|
20
31
|
end
|
21
32
|
it "has a subject" do
|
22
|
-
expect(@subject.rdf_subject).to eq "
|
33
|
+
expect(@subject.rdf_subject).to eq "#{ActiveFedora.fedora.host}/test/test:1"
|
23
34
|
end
|
24
35
|
it "has mime_type" do
|
25
36
|
expect(@subject.mime_type).to eq 'text/plain'
|
@@ -83,7 +94,7 @@ describe ActiveFedora::NtriplesRDFDatastream do
|
|
83
94
|
describe "an instance with a custom subject" do
|
84
95
|
before do
|
85
96
|
class MyDatastream < ActiveFedora::NtriplesRDFDatastream
|
86
|
-
rdf_subject { |ds| "
|
97
|
+
rdf_subject { |ds| "#{ActiveFedora.fedora.host}/test/#{ds.id}/content" }
|
87
98
|
property :created, predicate: ::RDF::Vocab::DC.created
|
88
99
|
property :title, predicate: ::RDF::Vocab::DC.title
|
89
100
|
property :publisher, predicate: ::RDF::Vocab::DC.publisher
|
@@ -96,10 +107,6 @@ describe ActiveFedora::NtriplesRDFDatastream do
|
|
96
107
|
allow(@subject).to receive(:remote_content).and_return remote_content
|
97
108
|
end
|
98
109
|
|
99
|
-
let(:remote_content) do
|
100
|
-
File.new('spec/fixtures/mixed_rdf_descMetadata.nt').read
|
101
|
-
end
|
102
|
-
|
103
110
|
after do
|
104
111
|
Object.send(:remove_const, :MyDatastream)
|
105
112
|
end
|
@@ -109,20 +116,22 @@ describe ActiveFedora::NtriplesRDFDatastream do
|
|
109
116
|
end
|
110
117
|
|
111
118
|
it "has a custom subject" do
|
112
|
-
expect(@subject.rdf_subject).to eq
|
119
|
+
expect(@subject.rdf_subject).to eq "#{ActiveFedora.fedora.host}/test/test:1/content"
|
113
120
|
end
|
114
121
|
end
|
115
122
|
|
116
123
|
describe "a new instance" do
|
117
|
-
before
|
124
|
+
before do
|
118
125
|
class MyDatastream < ActiveFedora::NtriplesRDFDatastream
|
119
126
|
property :publisher, predicate: ::RDF::Vocab::DC.publisher
|
120
127
|
end
|
121
128
|
@subject = MyDatastream.new
|
122
129
|
end
|
123
|
-
|
130
|
+
|
131
|
+
after do
|
124
132
|
Object.send(:remove_const, :MyDatastream)
|
125
133
|
end
|
134
|
+
|
126
135
|
it "supports to_s method" do
|
127
136
|
expect(@subject.publisher.to_s).to eq [].to_s
|
128
137
|
@subject.publisher = "Bob"
|
@@ -183,6 +192,7 @@ describe ActiveFedora::NtriplesRDFDatastream do
|
|
183
192
|
doc = {}
|
184
193
|
expect(@subject.to_solr(doc)).to eq doc
|
185
194
|
end
|
195
|
+
|
186
196
|
describe "with an actual object" do
|
187
197
|
before(:each) do
|
188
198
|
class Foo < ActiveFedora::Base
|
data/spec/unit/query_spec.rb
CHANGED
@@ -78,8 +78,8 @@ describe ActiveFedora::Base do
|
|
78
78
|
let(:solr) { ActiveFedora::SolrService.instance.conn }
|
79
79
|
let(:expected_query) { "#{model_query} AND " \
|
80
80
|
"_query_:\"{!raw f=foo}bar\" AND " \
|
81
|
-
"
|
82
|
-
"_query_:\"{!raw f=baz}quack\"
|
81
|
+
"_query_:\"{!raw f=baz}quix\" AND " \
|
82
|
+
"_query_:\"{!raw f=baz}quack\"" }
|
83
83
|
let(:expected_params) { { params: { sort: [sort_query], fl: 'id', q: expected_query, qt: 'standard' } } }
|
84
84
|
let(:expected_sort_params) { { params: { sort: ["title_t desc"], fl: 'id', q: expected_query, qt: 'standard' } } }
|
85
85
|
let(:mock_docs) { [{ "id" => "changeme:30" }, { "id" => "changeme:22" }] }
|
@@ -137,8 +137,8 @@ describe ActiveFedora::Base do
|
|
137
137
|
let(:solr) { ActiveFedora::SolrService.instance.conn }
|
138
138
|
let(:expected_query) { "#{model_query} AND " \
|
139
139
|
"_query_:\"{!raw f=foo}bar\" AND " \
|
140
|
-
"
|
141
|
-
"_query_:\"{!raw f=baz}quack\"
|
140
|
+
"_query_:\"{!raw f=baz}quix\" AND " \
|
141
|
+
"_query_:\"{!raw f=baz}quack\"" }
|
142
142
|
let(:expected_params) { { params: { sort: [sort_query], fl: 'id', q: expected_query, qt: 'standard' } } }
|
143
143
|
let(:mock_docs) { [{ "id" => "changeme-30" }, { "id" => "changeme-22" }] }
|
144
144
|
|
@@ -158,8 +158,8 @@ describe ActiveFedora::Base do
|
|
158
158
|
let(:solr) { ActiveFedora::SolrService.instance.conn }
|
159
159
|
let(:expected_query) { "#{model_query} AND " \
|
160
160
|
"_query_:\"{!raw f=foo}bar\" AND " \
|
161
|
-
"
|
162
|
-
"_query_:\"{!raw f=baz}quack\"
|
161
|
+
"_query_:\"{!raw f=baz}quix\" AND " \
|
162
|
+
"_query_:\"{!raw f=baz}quack\"" }
|
163
163
|
let(:expected_params) { { params: { sort: [sort_query], fl: 'id', q: expected_query, qt: 'standard' } } }
|
164
164
|
let(:mock_docs) { double('docs') }
|
165
165
|
|
@@ -253,8 +253,8 @@ describe ActiveFedora::Base do
|
|
253
253
|
context "with a hash of conditions" do
|
254
254
|
let(:expected_query) { "#{model_query} AND " \
|
255
255
|
"_query_:\"{!raw f=foo}bar\" AND " \
|
256
|
-
"
|
257
|
-
"_query_:\"{!raw f=baz}quack\"
|
256
|
+
"_query_:\"{!raw f=baz}quix\" AND " \
|
257
|
+
"_query_:\"{!raw f=baz}quack\"" }
|
258
258
|
let(:conditions) { { foo: 'bar', baz: ['quix', 'quack'] } }
|
259
259
|
|
260
260
|
it "makes a query to solr and returns the results" do
|
@@ -265,8 +265,8 @@ describe ActiveFedora::Base do
|
|
265
265
|
context "with quotes in the params" do
|
266
266
|
let(:expected_query) { "#{model_query} AND " \
|
267
267
|
"_query_:\"{!raw f=foo}9\\\" Nails\" AND " \
|
268
|
-
"
|
269
|
-
"_query_:\"{!raw f=baz}quack\"
|
268
|
+
"_query_:\"{!raw f=baz}7\\\" version\" AND " \
|
269
|
+
"_query_:\"{!raw f=baz}quack\"" }
|
270
270
|
let(:conditions) { { foo: '9" Nails', baz: ['7" version', 'quack'] } }
|
271
271
|
|
272
272
|
it "escapes quotes" do
|
@@ -25,7 +25,7 @@ describe ActiveFedora::SparqlInsert do
|
|
25
25
|
let(:base) { Book.create }
|
26
26
|
|
27
27
|
it "returns the string" do
|
28
|
-
expect(subject.build).to eq "DELETE { <> <info:fedora/fedora-system:def/relations-external#hasConstituent> ?change . }\n WHERE { <> <info:fedora/fedora-system:def/relations-external#hasConstituent> ?change . } ;\nDELETE { <> <http://purl.org/dc/terms/title> ?change . }\n WHERE { <> <http://purl.org/dc/terms/title> ?change . } ;\nINSERT { \n<> <info:fedora/fedora-system:def/relations-external#hasConstituent>
|
28
|
+
expect(subject.build).to eq "DELETE { <> <info:fedora/fedora-system:def/relations-external#hasConstituent> ?change . }\n WHERE { <> <info:fedora/fedora-system:def/relations-external#hasConstituent> ?change . } ;\nDELETE { <> <http://purl.org/dc/terms/title> ?change . }\n WHERE { <> <http://purl.org/dc/terms/title> ?change . } ;\nINSERT { \n<> <info:fedora/fedora-system:def/relations-external#hasConstituent> <#{ActiveFedora.fedora.host}/test/foo> .\n<> <http://purl.org/dc/terms/title> \"bar\" .\n}\n WHERE { }"
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
@@ -181,19 +181,33 @@ dependencies:
|
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: '0'
|
183
183
|
- !ruby/object:Gem::Dependency
|
184
|
-
name:
|
184
|
+
name: solr_wrapper
|
185
185
|
requirement: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- - "
|
187
|
+
- - "~>"
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version:
|
189
|
+
version: '0.4'
|
190
190
|
type: :development
|
191
191
|
prerelease: false
|
192
192
|
version_requirements: !ruby/object:Gem::Requirement
|
193
193
|
requirements:
|
194
|
-
- - "
|
194
|
+
- - "~>"
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0.4'
|
197
|
+
- !ruby/object:Gem::Dependency
|
198
|
+
name: fcrepo_wrapper
|
199
|
+
requirement: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - "~>"
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0.1'
|
204
|
+
type: :development
|
205
|
+
prerelease: false
|
206
|
+
version_requirements: !ruby/object:Gem::Requirement
|
207
|
+
requirements:
|
208
|
+
- - "~>"
|
195
209
|
- !ruby/object:Gem::Version
|
196
|
-
version:
|
210
|
+
version: '0.1'
|
197
211
|
- !ruby/object:Gem::Dependency
|
198
212
|
name: rspec
|
199
213
|
requirement: !ruby/object:Gem::Requirement
|
@@ -256,28 +270,28 @@ dependencies:
|
|
256
270
|
requirements:
|
257
271
|
- - "~>"
|
258
272
|
- !ruby/object:Gem::Version
|
259
|
-
version: 0.
|
273
|
+
version: '0.34'
|
260
274
|
type: :development
|
261
275
|
prerelease: false
|
262
276
|
version_requirements: !ruby/object:Gem::Requirement
|
263
277
|
requirements:
|
264
278
|
- - "~>"
|
265
279
|
- !ruby/object:Gem::Version
|
266
|
-
version: 0.
|
280
|
+
version: '0.34'
|
267
281
|
- !ruby/object:Gem::Dependency
|
268
282
|
name: rubocop-rspec
|
269
283
|
requirement: !ruby/object:Gem::Requirement
|
270
284
|
requirements:
|
271
285
|
- - "~>"
|
272
286
|
- !ruby/object:Gem::Version
|
273
|
-
version: 1.
|
287
|
+
version: '1.3'
|
274
288
|
type: :development
|
275
289
|
prerelease: false
|
276
290
|
version_requirements: !ruby/object:Gem::Requirement
|
277
291
|
requirements:
|
278
292
|
- - "~>"
|
279
293
|
- !ruby/object:Gem::Version
|
280
|
-
version: 1.
|
294
|
+
version: '1.3'
|
281
295
|
description: ActiveFedora provides for creating and managing objects in the Fedora
|
282
296
|
Repository Architecture.
|
283
297
|
email:
|
@@ -307,8 +321,6 @@ files:
|
|
307
321
|
- config/predicate_mappings.yml
|
308
322
|
- config/service_mappings.yml
|
309
323
|
- config/solr.yml
|
310
|
-
- config/solr_mappings_af_0.1.yml
|
311
|
-
- config/solr_mappings_bl_2.4.yml
|
312
324
|
- lib/active-fedora.rb
|
313
325
|
- lib/active_fedora.rb
|
314
326
|
- lib/active_fedora/association_hash.rb
|
@@ -466,7 +478,6 @@ files:
|
|
466
478
|
- lib/generators/active_fedora/config/fedora/fedora_generator.rb
|
467
479
|
- lib/generators/active_fedora/config/fedora/templates/fedora.yml
|
468
480
|
- lib/generators/active_fedora/config/solr/solr_generator.rb
|
469
|
-
- lib/generators/active_fedora/config/solr/templates/jetty.yml
|
470
481
|
- lib/generators/active_fedora/config/solr/templates/solr.yml
|
471
482
|
- lib/generators/active_fedora/config/solr/templates/solr_conf/conf/schema.xml
|
472
483
|
- lib/generators/active_fedora/config/solr/templates/solr_conf/conf/solrconfig.xml
|
@@ -481,6 +492,22 @@ files:
|
|
481
492
|
- script/console
|
482
493
|
- script/destroy
|
483
494
|
- script/generate
|
495
|
+
- solr/config/_rest_managed.json
|
496
|
+
- solr/config/admin-extra.html
|
497
|
+
- solr/config/elevate.xml
|
498
|
+
- solr/config/mapping-ISOLatin1Accent.txt
|
499
|
+
- solr/config/protwords.txt
|
500
|
+
- solr/config/schema.xml
|
501
|
+
- solr/config/scripts.conf
|
502
|
+
- solr/config/solrconfig.xml
|
503
|
+
- solr/config/spellings.txt
|
504
|
+
- solr/config/stopwords.txt
|
505
|
+
- solr/config/stopwords_en.txt
|
506
|
+
- solr/config/synonyms.txt
|
507
|
+
- solr/config/xslt/example.xsl
|
508
|
+
- solr/config/xslt/example_atom.xsl
|
509
|
+
- solr/config/xslt/example_rss.xsl
|
510
|
+
- solr/config/xslt/luke.xsl
|
484
511
|
- spec/config_helper.rb
|
485
512
|
- spec/fixtures/damsObjectModel.xml
|
486
513
|
- spec/fixtures/dino.jpg
|
@@ -643,3 +670,4 @@ signing_key:
|
|
643
670
|
specification_version: 4
|
644
671
|
summary: A convenience libary for manipulating documents in the Fedora Repository.
|
645
672
|
test_files: []
|
673
|
+
has_rdoc:
|