bbc_data_service 1.6 → 1.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -54,9 +54,9 @@ module BBCDataService
|
|
54
54
|
results = []
|
55
55
|
fixtures = query.execute(graph)
|
56
56
|
fixtures.each do |fixture|
|
57
|
-
|
58
|
-
|
59
|
-
results <<
|
57
|
+
relationship_fixture = BBCDataService::FeedFixture.new(self.instance_eval(self.execute_query(graph, query, values[:mappings])))
|
58
|
+
relationship_fixture.rdf_object = fixture
|
59
|
+
results << relationship_fixture
|
60
60
|
end
|
61
61
|
current_fixture.add_relationship(key, results)
|
62
62
|
end
|
data/spec/fixture_loader_spec.rb
CHANGED
@@ -74,6 +74,7 @@ describe BBCDataService::FixtureLoader do
|
|
74
74
|
it "should allow finding of other resources" do
|
75
75
|
object = BBCDataService::FixtureLoader.load_fixture(:relationship_with_foreign_key)
|
76
76
|
object.first.name == "Im Dong-Hyun"
|
77
|
+
object.first.surname == "Dong-Hyun"
|
77
78
|
object.first.team.first.team_name.should == "South Korea"
|
78
79
|
end
|
79
80
|
|
@@ -154,15 +154,22 @@ BBCDataService::AppFixture.register_fixture :multiple_items_with_filter, {
|
|
154
154
|
BBCDataService::AppFixture.register_fixture :relationship_with_foreign_key, {
|
155
155
|
:endpoint => "/dsp/sport/olympics/2012/athletes",
|
156
156
|
:type => :rdf,
|
157
|
-
:feed_url => File.expand_path("../athletes.json", __FILE__),
|
158
157
|
:rdf_type => "sport:Person",
|
158
|
+
:feed_url => File.expand_path("../athletes.json", __FILE__),
|
159
159
|
:mappings => {
|
160
160
|
:domain => {
|
161
|
-
:name => "name"
|
161
|
+
:name => "name",
|
162
|
+
:url => "document"
|
163
|
+
},
|
164
|
+
:oly => {
|
165
|
+
:gender => "gender"
|
166
|
+
},
|
167
|
+
:foaf => {
|
168
|
+
:surname => "familyName"
|
162
169
|
},
|
163
170
|
:par => {
|
164
171
|
:role_at => "role_at"
|
165
|
-
}
|
172
|
+
}
|
166
173
|
},
|
167
174
|
:relationships => {
|
168
175
|
:team => {
|
metadata
CHANGED