bbc_data_service 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +0 -1
- data/bbc_data_service.gemspec +1 -0
- data/lib/bbc_data_service/service_config.rb +2 -1
- data/lib/bbc_data_service/version.rb +1 -1
- data/lib/bbc_data_service/vocabulary.rb +9 -2
- data/spec/fixture_loader_spec.rb +6 -0
- data/spec/fixtures/sports.xml +25 -0
- data/spec/fixtures/test_config.rb +12 -0
- metadata +120 -61
data/Rakefile
CHANGED
data/bbc_data_service.gemspec
CHANGED
@@ -7,10 +7,10 @@ module BBCDataService
|
|
7
7
|
end
|
8
8
|
|
9
9
|
module ClassMethods
|
10
|
+
|
10
11
|
def vocabularies
|
11
|
-
{
|
12
|
+
vocabulary = {
|
12
13
|
:foaf => RDF::Vocabulary.new("http://xmlns.com/foaf/0.1/"),
|
13
|
-
:domain => RDF::Vocabulary.new("http://www.bbc.co.uk/ontologies/domain/"),
|
14
14
|
:owlim => RDF::Vocabulary.new("http://www.ontotext.com/"),
|
15
15
|
:tzont => RDF::Vocabulary.new("http://www.w3.org/2006/timezone#"),
|
16
16
|
:ns => RDF::Vocabulary.new("http://xmlns.com/foaf/0.1/"),
|
@@ -84,6 +84,13 @@ module BBCDataService
|
|
84
84
|
:geo_pol => RDF::Vocabulary.new("http://www.bbc.co.uk/ontologies/geopolitical/"),
|
85
85
|
:par => RDF::Vocabulary.new("http://purl.org/vocab/participation/schema#")
|
86
86
|
}
|
87
|
+
if ServiceConfig[:vocabularies].size > 0
|
88
|
+
ServiceConfig[:vocabularies].each do |v|
|
89
|
+
key = v.first
|
90
|
+
vocabulary[key] = v.last
|
91
|
+
end
|
92
|
+
end
|
93
|
+
vocabulary
|
87
94
|
end
|
88
95
|
end
|
89
96
|
end
|
data/spec/fixture_loader_spec.rb
CHANGED
@@ -38,4 +38,10 @@ describe BBCDataService::FixtureLoader do
|
|
38
38
|
object.long_name.should == "United Kingdom of Great Britain and Northern Ireland"
|
39
39
|
end
|
40
40
|
|
41
|
+
it "should allow custom vocabularies" do
|
42
|
+
ServiceConfig[:vocabularies] = {:domain => RDF::Vocabulary.new("http://www.bbc.co.uk/ontologies/domain/")}
|
43
|
+
object = BBCDataService::FixtureLoader.load_fixture(:custom_vocabulary)
|
44
|
+
object.name.should == "Athletics"
|
45
|
+
end
|
46
|
+
|
41
47
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<rdf:RDF
|
3
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
4
|
+
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
|
5
|
+
xmlns:owl="http://www.w3.org/2002/07/owl#"
|
6
|
+
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
7
|
+
xmlns:event="http://purl.org/NET/c4dm/event.owl#"
|
8
|
+
xmlns:tl="http://purl.org/NET/c4dm/timeline.owl#"
|
9
|
+
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
|
10
|
+
xmlns:geoname="http://www.geonames.org/ontology#"
|
11
|
+
xmlns:dcterms="http://purl.org/dc/terms/"
|
12
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
|
13
|
+
xmlns:exif="http://www.w3.org/2003/12/exif/ns#"
|
14
|
+
xmlns:sport="http://www.bbc.co.uk/ontologies/sport/"
|
15
|
+
xmlns:asset="http://www.bbc.co.uk/ontologies/asset/"
|
16
|
+
xmlns:tag="http://www.bbc.co.uk/ontologies/tag/"
|
17
|
+
xmlns:domain="http://www.bbc.co.uk/ontologies/domain/"
|
18
|
+
xmlns:sesame="http://www.openrdf.org/schema/sesame#"
|
19
|
+
xmlns:owlim="http://www.ontotext.com/"
|
20
|
+
xmlns:oly="http://www.bbc.co.uk/ontologies/2012olympics/">
|
21
|
+
<sport:SportsDiscipline rdf:about="http://www.bbc.co.uk/things/b3a086df-ab42-2b44-be8b-76b600bfcdce#id">
|
22
|
+
<domain:document rdf:resource="http://www.bbc.co.uk/sport/olympics/2012/sports/athletics"/>
|
23
|
+
<domain:name rdf:datatype="xsd:string">Athletics</domain:name>
|
24
|
+
</sport:SportsDiscipline>
|
25
|
+
</rdf:RDF>
|
@@ -15,6 +15,18 @@ BBCDataService::AppFixture.register_fixture :single_instance, {
|
|
15
15
|
}
|
16
16
|
}
|
17
17
|
}
|
18
|
+
BBCDataService::AppFixture.register_fixture :custom_vocabulary, {
|
19
|
+
:endpoint => "/dsp/sport/olympics/2012/sports",
|
20
|
+
:type => :rdf,
|
21
|
+
:feed_url => File.expand_path("../sports.xml", __FILE__),
|
22
|
+
:rdf_type => "sport:SportsDiscipline",
|
23
|
+
:mappings => {
|
24
|
+
:domain => {
|
25
|
+
:document => "document",
|
26
|
+
:name => "name"
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
18
30
|
BBCDataService::AppFixture.register_fixture :parent_instance, {
|
19
31
|
:parent => :single_instance
|
20
32
|
}
|
metadata
CHANGED
@@ -1,90 +1,144 @@
|
|
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: 5
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 15
|
10
|
+
version: 0.1.15
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Matthew Crouch
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2011-09-27 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: sinatra
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
25
|
+
requirements:
|
19
26
|
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 19
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 2
|
32
|
+
- 6
|
21
33
|
version: 1.2.6
|
22
34
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
26
37
|
name: activemodel
|
27
|
-
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
40
|
none: false
|
29
|
-
requirements:
|
41
|
+
requirements:
|
30
42
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 3
|
47
|
+
- 1
|
48
|
+
- 0
|
32
49
|
version: 3.1.0
|
33
50
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
37
53
|
name: rdf-rdfxml
|
38
|
-
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
56
|
none: false
|
40
|
-
requirements:
|
57
|
+
requirements:
|
41
58
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 27
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
- 3
|
64
|
+
- 4
|
43
65
|
version: 0.3.4
|
44
66
|
type: :runtime
|
45
|
-
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Dependency
|
67
|
+
version_requirements: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
48
69
|
name: rdf-json
|
49
|
-
|
70
|
+
prerelease: false
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
72
|
none: false
|
51
|
-
requirements:
|
73
|
+
requirements:
|
52
74
|
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 19
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
- 3
|
80
|
+
- 0
|
54
81
|
version: 0.3.0
|
55
82
|
type: :runtime
|
56
|
-
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
83
|
+
version_requirements: *id004
|
84
|
+
- !ruby/object:Gem::Dependency
|
59
85
|
name: rspec
|
60
|
-
|
86
|
+
prerelease: false
|
87
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
61
88
|
none: false
|
62
|
-
requirements:
|
89
|
+
requirements:
|
63
90
|
- - ~>
|
64
|
-
- !ruby/object:Gem::Version
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 23
|
93
|
+
segments:
|
94
|
+
- 2
|
95
|
+
- 6
|
96
|
+
- 0
|
65
97
|
version: 2.6.0
|
66
98
|
type: :development
|
67
|
-
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
99
|
+
version_requirements: *id005
|
100
|
+
- !ruby/object:Gem::Dependency
|
70
101
|
name: turn
|
71
|
-
|
102
|
+
prerelease: false
|
103
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
72
104
|
none: false
|
73
|
-
requirements:
|
105
|
+
requirements:
|
74
106
|
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
hash: 59
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
- 8
|
112
|
+
- 2
|
76
113
|
version: 0.8.2
|
77
114
|
type: :development
|
115
|
+
version_requirements: *id006
|
116
|
+
- !ruby/object:Gem::Dependency
|
117
|
+
name: rake
|
78
118
|
prerelease: false
|
79
|
-
|
119
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
hash: 63
|
125
|
+
segments:
|
126
|
+
- 0
|
127
|
+
- 9
|
128
|
+
- 2
|
129
|
+
version: 0.9.2
|
130
|
+
type: :development
|
131
|
+
version_requirements: *id007
|
80
132
|
description: BBC Data Service for fixture management
|
81
|
-
email:
|
133
|
+
email:
|
82
134
|
- matthew.crouch@bbc.co.uk
|
83
|
-
executables:
|
135
|
+
executables:
|
84
136
|
- bbc_data_service
|
85
137
|
extensions: []
|
138
|
+
|
86
139
|
extra_rdoc_files: []
|
87
|
-
|
140
|
+
|
141
|
+
files:
|
88
142
|
- .gitignore
|
89
143
|
- Gemfile
|
90
144
|
- Rakefile
|
@@ -105,43 +159,48 @@ files:
|
|
105
159
|
- spec/fixtures/country.rdf.json
|
106
160
|
- spec/fixtures/groups-individual.json
|
107
161
|
- spec/fixtures/groups.json
|
162
|
+
- spec/fixtures/sports.xml
|
108
163
|
- spec/fixtures/test_config.rb
|
109
164
|
- spec/spec_helper.rb
|
110
165
|
homepage: https://github.com/mobzilla/bbc-data-service
|
111
166
|
licenses: []
|
167
|
+
|
112
168
|
post_install_message:
|
113
169
|
rdoc_options: []
|
114
|
-
|
170
|
+
|
171
|
+
require_paths:
|
115
172
|
- lib
|
116
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
174
|
none: false
|
118
|
-
requirements:
|
119
|
-
- -
|
120
|
-
- !ruby/object:Gem::Version
|
121
|
-
|
122
|
-
segments:
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
hash: 3
|
179
|
+
segments:
|
123
180
|
- 0
|
124
|
-
|
125
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
+
version: "0"
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
183
|
none: false
|
127
|
-
requirements:
|
128
|
-
- -
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
|
131
|
-
segments:
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
hash: 3
|
188
|
+
segments:
|
132
189
|
- 0
|
133
|
-
|
190
|
+
version: "0"
|
134
191
|
requirements: []
|
192
|
+
|
135
193
|
rubyforge_project: bbc-data-service
|
136
|
-
rubygems_version: 1.8.
|
194
|
+
rubygems_version: 1.8.10
|
137
195
|
signing_key:
|
138
196
|
specification_version: 3
|
139
197
|
summary: BBC Data Service
|
140
|
-
test_files:
|
198
|
+
test_files:
|
141
199
|
- spec/fixture_loader_spec.rb
|
142
200
|
- spec/fixtures/countries.rdf.json
|
143
201
|
- spec/fixtures/country.rdf.json
|
144
202
|
- spec/fixtures/groups-individual.json
|
145
203
|
- spec/fixtures/groups.json
|
204
|
+
- spec/fixtures/sports.xml
|
146
205
|
- spec/fixtures/test_config.rb
|
147
206
|
- spec/spec_helper.rb
|