bbc_data_service 1.5 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bbc_data_service/rdf_parser.rb +1 -2
- data/lib/bbc_data_service/version.rb +1 -1
- data/spec/fixture_loader_spec.rb +2 -1
- data/spec/fixtures/test_config.rb +5 -17
- metadata +126 -70
@@ -46,14 +46,13 @@ module BBCDataService
|
|
46
46
|
query = RDF::Query.new({
|
47
47
|
RDF::URI(foreign_key) => self.generate_query(values[:mappings], values[:rdf_type])
|
48
48
|
})
|
49
|
-
fixtures = query.execute(graph)
|
50
49
|
else
|
51
50
|
query = RDF::Query.new({
|
52
51
|
:fixture => self.generate_query(values[:mappings], values[:rdf_type])
|
53
52
|
})
|
54
|
-
fixtures = query.execute(graph)
|
55
53
|
end
|
56
54
|
results = []
|
55
|
+
fixtures = query.execute(graph)
|
57
56
|
fixtures.each do |fixture|
|
58
57
|
current_fixture = BBCDataService::FeedFixture.new(self.instance_eval(self.execute_query(graph, query, values[:mappings])))
|
59
58
|
current_fixture.rdf_object = fixture
|
data/spec/fixture_loader_spec.rb
CHANGED
@@ -73,7 +73,8 @@ describe BBCDataService::FixtureLoader do
|
|
73
73
|
|
74
74
|
it "should allow finding of other resources" do
|
75
75
|
object = BBCDataService::FixtureLoader.load_fixture(:relationship_with_foreign_key)
|
76
|
-
object.first.
|
76
|
+
object.first.name == "Im Dong-Hyun"
|
77
|
+
object.first.team.first.team_name.should == "South Korea"
|
77
78
|
end
|
78
79
|
|
79
80
|
end
|
@@ -152,25 +152,13 @@ BBCDataService::AppFixture.register_fixture :multiple_items_with_filter, {
|
|
152
152
|
}
|
153
153
|
}
|
154
154
|
BBCDataService::AppFixture.register_fixture :relationship_with_foreign_key, {
|
155
|
-
:endpoint => "/dsp/sport/olympics/2012/athletes
|
155
|
+
:endpoint => "/dsp/sport/olympics/2012/athletes",
|
156
156
|
:type => :rdf,
|
157
|
-
:feed_url => File.expand_path("../
|
157
|
+
:feed_url => File.expand_path("../athletes.json", __FILE__),
|
158
158
|
:rdf_type => "sport:Person",
|
159
159
|
:mappings => {
|
160
|
-
:foaf => {
|
161
|
-
:family_name => "familyName",
|
162
|
-
:given_name => "givenName"
|
163
|
-
},
|
164
160
|
:domain => {
|
165
|
-
:name => "name"
|
166
|
-
:canonical_name => "canonicalName",
|
167
|
-
:url => "document"
|
168
|
-
},
|
169
|
-
:oly => {
|
170
|
-
:date_of_birth => "dateOfBirth",
|
171
|
-
:height => "height",
|
172
|
-
:weight => "weight",
|
173
|
-
:gender => "gender"
|
161
|
+
:name => "name"
|
174
162
|
},
|
175
163
|
:par => {
|
176
164
|
:role_at => "role_at"
|
@@ -182,8 +170,8 @@ BBCDataService::AppFixture.register_fixture :relationship_with_foreign_key, {
|
|
182
170
|
:rdf_type => "sport:CompetitiveSportingOrganisation",
|
183
171
|
:mappings => {
|
184
172
|
:domain => {
|
185
|
-
:
|
186
|
-
:
|
173
|
+
:team_name => "name",
|
174
|
+
:team_short_name => "shortName"
|
187
175
|
}
|
188
176
|
}
|
189
177
|
}
|
metadata
CHANGED
@@ -1,112 +1,159 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bbc_data_service
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 6
|
9
|
+
version: "1.6"
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Matthew Crouch
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2011-10-27 00:00:00 Z
|
18
|
+
dependencies:
|
19
|
+
- !ruby/object:Gem::Dependency
|
15
20
|
name: sinatra
|
16
|
-
|
21
|
+
prerelease: false
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
23
|
none: false
|
18
|
-
requirements:
|
24
|
+
requirements:
|
19
25
|
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 19
|
28
|
+
segments:
|
29
|
+
- 1
|
30
|
+
- 2
|
31
|
+
- 6
|
21
32
|
version: 1.2.6
|
22
33
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
26
36
|
name: activesupport
|
27
|
-
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
|
-
requirements:
|
40
|
+
requirements:
|
30
41
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 3
|
46
|
+
- 1
|
47
|
+
- 0
|
32
48
|
version: 3.1.0
|
33
49
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
37
52
|
name: activemodel
|
38
|
-
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
55
|
none: false
|
40
|
-
requirements:
|
56
|
+
requirements:
|
41
57
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
60
|
+
segments:
|
61
|
+
- 3
|
62
|
+
- 1
|
63
|
+
- 0
|
43
64
|
version: 3.1.0
|
44
65
|
type: :runtime
|
45
|
-
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Dependency
|
66
|
+
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
48
68
|
name: rdf-json
|
49
|
-
|
69
|
+
prerelease: false
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
71
|
none: false
|
51
|
-
requirements:
|
72
|
+
requirements:
|
52
73
|
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 19
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
- 3
|
79
|
+
- 0
|
54
80
|
version: 0.3.0
|
55
81
|
type: :runtime
|
56
|
-
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
82
|
+
version_requirements: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
59
84
|
name: nokogiri
|
60
|
-
|
85
|
+
prerelease: false
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
61
87
|
none: false
|
62
|
-
requirements:
|
63
|
-
- - =
|
64
|
-
- !ruby/object:Gem::Version
|
88
|
+
requirements:
|
89
|
+
- - "="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
92
|
+
segments:
|
93
|
+
- 1
|
94
|
+
- 5
|
95
|
+
- 0
|
65
96
|
version: 1.5.0
|
66
97
|
type: :runtime
|
67
|
-
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
98
|
+
version_requirements: *id005
|
99
|
+
- !ruby/object:Gem::Dependency
|
70
100
|
name: rspec
|
71
|
-
|
101
|
+
prerelease: false
|
102
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
72
103
|
none: false
|
73
|
-
requirements:
|
104
|
+
requirements:
|
74
105
|
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
hash: 23
|
108
|
+
segments:
|
109
|
+
- 2
|
110
|
+
- 6
|
111
|
+
- 0
|
76
112
|
version: 2.6.0
|
77
113
|
type: :development
|
78
|
-
|
79
|
-
|
80
|
-
- !ruby/object:Gem::Dependency
|
114
|
+
version_requirements: *id006
|
115
|
+
- !ruby/object:Gem::Dependency
|
81
116
|
name: turn
|
82
|
-
|
117
|
+
prerelease: false
|
118
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
83
119
|
none: false
|
84
|
-
requirements:
|
120
|
+
requirements:
|
85
121
|
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
hash: 59
|
124
|
+
segments:
|
125
|
+
- 0
|
126
|
+
- 8
|
127
|
+
- 2
|
87
128
|
version: 0.8.2
|
88
129
|
type: :development
|
89
|
-
|
90
|
-
|
91
|
-
- !ruby/object:Gem::Dependency
|
130
|
+
version_requirements: *id007
|
131
|
+
- !ruby/object:Gem::Dependency
|
92
132
|
name: rake
|
93
|
-
|
133
|
+
prerelease: false
|
134
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
94
135
|
none: false
|
95
|
-
requirements:
|
136
|
+
requirements:
|
96
137
|
- - ~>
|
97
|
-
- !ruby/object:Gem::Version
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
hash: 63
|
140
|
+
segments:
|
141
|
+
- 0
|
142
|
+
- 9
|
143
|
+
- 2
|
98
144
|
version: 0.9.2
|
99
145
|
type: :development
|
100
|
-
|
101
|
-
version_requirements: *2156476840
|
146
|
+
version_requirements: *id008
|
102
147
|
description: BBC Data Service for fixture management
|
103
|
-
email:
|
148
|
+
email:
|
104
149
|
- matthew.crouch@bbc.co.uk
|
105
|
-
executables:
|
150
|
+
executables:
|
106
151
|
- bbc_data_service
|
107
152
|
extensions: []
|
153
|
+
|
108
154
|
extra_rdoc_files: []
|
109
|
-
|
155
|
+
|
156
|
+
files:
|
110
157
|
- .gitignore
|
111
158
|
- Gemfile
|
112
159
|
- Rakefile
|
@@ -135,29 +182,38 @@ files:
|
|
135
182
|
- spec/spec_helper.rb
|
136
183
|
homepage: https://github.com/mobzilla/bbc-data-service
|
137
184
|
licenses: []
|
185
|
+
|
138
186
|
post_install_message:
|
139
187
|
rdoc_options: []
|
140
|
-
|
188
|
+
|
189
|
+
require_paths:
|
141
190
|
- lib
|
142
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
191
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
192
|
none: false
|
144
|
-
requirements:
|
145
|
-
- -
|
146
|
-
- !ruby/object:Gem::Version
|
147
|
-
|
148
|
-
|
193
|
+
requirements:
|
194
|
+
- - ">="
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
hash: 3
|
197
|
+
segments:
|
198
|
+
- 0
|
199
|
+
version: "0"
|
200
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
201
|
none: false
|
150
|
-
requirements:
|
151
|
-
- -
|
152
|
-
- !ruby/object:Gem::Version
|
153
|
-
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
hash: 3
|
206
|
+
segments:
|
207
|
+
- 0
|
208
|
+
version: "0"
|
154
209
|
requirements: []
|
210
|
+
|
155
211
|
rubyforge_project: bbc-data-service
|
156
212
|
rubygems_version: 1.8.10
|
157
213
|
signing_key:
|
158
214
|
specification_version: 3
|
159
215
|
summary: BBC Data Service
|
160
|
-
test_files:
|
216
|
+
test_files:
|
161
217
|
- spec/fixture_loader_spec.rb
|
162
218
|
- spec/fixtures/athlete.json
|
163
219
|
- spec/fixtures/countries.rdf.json
|