bio-publisci 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +1 -1
  3. data/Gemfile +1 -1
  4. data/Rakefile +4 -6
  5. data/features/integration_steps.rb +1 -1
  6. data/features/metadata.feature +24 -0
  7. data/features/metadata_steps.rb +21 -0
  8. data/lib/bio-publisci/dataset/ORM/data_cube_orm.rb +36 -14
  9. data/lib/bio-publisci/dataset/ORM/observation.rb +1 -1
  10. data/lib/bio-publisci/dataset/data_cube.rb +192 -131
  11. data/lib/bio-publisci/dataset/dataset_for.rb +150 -0
  12. data/lib/bio-publisci/dataset/interactive.rb +70 -55
  13. data/lib/bio-publisci/metadata/metadata.rb +81 -8
  14. data/lib/bio-publisci/parser.rb +76 -1
  15. data/lib/bio-publisci/readers/big_cross.rb +118 -117
  16. data/lib/bio-publisci/readers/csv.rb +37 -2
  17. data/lib/bio-publisci/readers/r_matrix.rb +1 -1
  18. data/lib/bio-publisci/store.rb +31 -31
  19. data/lib/bio-publisci/writers/arff.rb +48 -49
  20. data/lib/bio-publisci.rb +3 -0
  21. data/resources/queries/code_resources.rq +10 -0
  22. data/resources/queries/dimension_ranges.rq +3 -3
  23. data/resources/queries/dimensions.rq +3 -3
  24. data/resources/queries/measures.rq +3 -3
  25. data/resources/queries/observation_labels.rq +8 -0
  26. data/resources/queries/properties.rq +8 -0
  27. data/scripts/islet_mlratio.rb +6 -0
  28. data/scripts/scan_islet.rb +6 -0
  29. data/scripts/update_reference.rb +20 -0
  30. data/spec/ORM/data_cube_orm_spec.rb +12 -0
  31. data/spec/data_cube_spec.rb +1 -1
  32. data/spec/generators/dataframe_spec.rb +1 -1
  33. data/spec/generators/r_matrix_spec.rb +1 -1
  34. data/spec/r_builder_spec.rb +6 -6
  35. data/spec/resource/.RData +0 -0
  36. data/spec/resource/example.Rhistory +3 -0
  37. data/spec/turtle/bacon +4 -22
  38. data/spec/turtle/reference +9 -27
  39. metadata +37 -56
  40. data/lib/bio-publisci/loader.rb +0 -36
  41. data/spec/bio-publisci_spec.rb +0 -7
@@ -11,7 +11,7 @@ describe R2RDF::Reader::Dataframe do
11
11
  graph
12
12
  end
13
13
 
14
- context "with r/qtl dataframe" do
14
+ context "with r/qtl dataframe", no_travis: true do
15
15
  before(:all) do
16
16
  @r = Rserve::Connection.new
17
17
  @generator = R2RDF::Reader::Dataframe.new
@@ -22,7 +22,7 @@ describe R2RDF::Reader::RMatrix do
22
22
  @connection = Rserve::Connection.new
23
23
  end
24
24
 
25
- it "generators a simple output automatically" do
25
+ it "generators a simple output automatically", no_travis: true do
26
26
  f=Tempfile.new('matrix')
27
27
  @connection.eval "mat = matrix(c(2, 4, 3, 1, 5, 7), nrow=3, ncol=2)"
28
28
  @generator.generate_n3(@connection,'mat',f.path,{quiet: true})
@@ -9,7 +9,7 @@ require_relative '../lib/bio-publisci.rb'
9
9
 
10
10
  describe R2RDF::Writer::Dataframe do
11
11
 
12
- context "when using r/qtl dataframe" do
12
+ context "when using r/qtl dataframe", no_travis: true do
13
13
 
14
14
  before(:all) do
15
15
  @r = Rserve::Connection.new
@@ -21,13 +21,13 @@ EOF
21
21
  @builder = R2RDF::Writer::Builder.new
22
22
  end
23
23
 
24
- it "produces equivalent dataframe from rdf" do
24
+ it "produces equivalent dataframe from rdf" #do
25
25
  #(a) problem is that builder and the @r connection are different b/c of
26
26
  #how rserve works
27
- @builder.from_turtle(File.dirname(__FILE__) +'/turtle/reference', @r, 'mr', 'mo', false, false)
28
- puts @r.eval('ls()').payload.to_ruby
29
- @r.eval('identical(mr,mo)').to_ruby.should == true
30
- end
27
+ # @builder.from_turtle(File.dirname(__FILE__) +'/turtle/reference', @r, 'mr', 'mo', false, false)
28
+ # puts @r.eval('ls()').payload.to_ruby
29
+ # @r.eval('identical(mr,mo)').to_ruby.should == true
30
+ #end
31
31
 
32
32
  end
33
33
  end
Binary file
@@ -0,0 +1,3 @@
1
+ library(qtl)
2
+ data(listeria)
3
+ mr = scanone(listeria,method='mr')
data/spec/turtle/bacon CHANGED
@@ -8,7 +8,6 @@
8
8
  @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
9
9
  @prefix cs: <http://www.rqtl.org/dc/dataset/bacon/cs/> .
10
10
  @prefix code: <http://www.rqtl.org/dc/dataset/bacon/code/> .
11
- @prefix class: <http://www.rqtl.org/dc/dataset/bacon/class/> .
12
11
  @prefix owl: <http://www.w3.org/2002/07/owl#> .
13
12
  @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
14
13
  @prefix foaf: <http://xmlns.com/foaf/0.1/> .
@@ -16,32 +15,15 @@
16
15
  @prefix prov: <http://www.w3.org/ns/prov#> .
17
16
 
18
17
  ns:dsd-bacon a qb:DataStructureDefinition;
19
- qb:component
20
- cs:chunkiness ,
21
- cs:deliciousness ,
22
- cs:producer ,
23
- cs:pricerange .
18
+ qb:component [ qb:dimension prop:producer ] ;
19
+ qb:component [ qb:dimension prop:pricerange ] ;
20
+ qb:component [ qb:measure prop:chunkiness ] ;
21
+ qb:component [ qb:measure prop:deliciousness ] .
24
22
 
25
23
  ns:dataset-bacon a qb:DataSet ;
26
24
  rdfs:label "bacon"@en ;
27
25
  qb:structure ns:dsd-bacon .
28
26
 
29
- cs:producer a qb:ComponentSpecification ;
30
- rdfs:label "producer Component" ;
31
- qb:dimension prop:producer .
32
-
33
- cs:pricerange a qb:ComponentSpecification ;
34
- rdfs:label "pricerange Component" ;
35
- qb:dimension prop:pricerange .
36
-
37
- cs:chunkiness a qb:ComponentSpecification ;
38
- rdfs:label "chunkiness Component" ;
39
- qb:measure prop:chunkiness .
40
-
41
- cs:deliciousness a qb:ComponentSpecification ;
42
- rdfs:label "deliciousness Component" ;
43
- qb:measure prop:deliciousness .
44
-
45
27
  prop:producer a rdf:Property, qb:DimensionProperty ;
46
28
  rdfs:label "producer"@en ;
47
29
  qb:codeList code:producer ;
@@ -8,7 +8,6 @@
8
8
  @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
9
9
  @prefix cs: <http://www.rqtl.org/dc/dataset/mr/cs/> .
10
10
  @prefix code: <http://www.rqtl.org/dc/dataset/mr/code/> .
11
- @prefix class: <http://www.rqtl.org/dc/dataset/mr/class/> .
12
11
  @prefix owl: <http://www.w3.org/2002/07/owl#> .
13
12
  @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
14
13
  @prefix foaf: <http://xmlns.com/foaf/0.1/> .
@@ -16,32 +15,15 @@
16
15
  @prefix prov: <http://www.w3.org/ns/prov#> .
17
16
 
18
17
  ns:dsd-mr a qb:DataStructureDefinition;
19
- qb:component
20
- cs:chr ,
21
- cs:pos ,
22
- cs:lod ,
23
- cs:refRow .
18
+ qb:component [ qb:dimension prop:refRow ] ;
19
+ qb:component [ qb:measure prop:chr ] ;
20
+ qb:component [ qb:measure prop:pos ] ;
21
+ qb:component [ qb:measure prop:lod ] .
24
22
 
25
23
  ns:dataset-mr a qb:DataSet ;
26
24
  rdfs:label "mr"@en ;
27
25
  qb:structure ns:dsd-mr .
28
26
 
29
- cs:refRow a qb:ComponentSpecification ;
30
- rdfs:label "refRow Component" ;
31
- qb:dimension prop:refRow .
32
-
33
- cs:chr a qb:ComponentSpecification ;
34
- rdfs:label "chr Component" ;
35
- qb:measure prop:chr .
36
-
37
- cs:pos a qb:ComponentSpecification ;
38
- rdfs:label "pos Component" ;
39
- qb:measure prop:pos .
40
-
41
- cs:lod a qb:ComponentSpecification ;
42
- rdfs:label "lod Component" ;
43
- qb:measure prop:lod .
44
-
45
27
  prop:refRow a rdf:Property, qb:DimensionProperty ;
46
28
  rdfs:label "refRow"@en ;
47
29
  qb:codeList code:refrow ;
@@ -58,15 +40,15 @@ prop:lod a rdf:Property, qb:MeasureProperty ;
58
40
 
59
41
  code:Refrow a rdfs:Class, owl:Class;
60
42
  rdfs:subClassOf skos:Concept ;
61
- rdfs:label "Code list for refRow - codelist class"@en;
62
- rdfs:comment "Specifies the refRow for each observation";
43
+ rdfs:label "Code list for refrow - codelist class"@en;
44
+ rdfs:comment "Specifies the refrow for each observation";
63
45
  rdfs:seeAlso code:refrow .
64
46
 
65
47
  code:refrow a skos:ConceptScheme;
66
- skos:prefLabel "Code list for refRow - codelist scheme"@en;
67
- rdfs:label "Code list for refRow - codelist scheme"@en;
48
+ skos:prefLabel "Code list for refrow - codelist scheme"@en;
49
+ rdfs:label "Code list for refrow - codelist scheme"@en;
68
50
  skos:notation "CL_REFROW";
69
- skos:note "Specifies the refRow for each observation";
51
+ skos:note "Specifies the refrow for each observation";
70
52
  skos:hasTopConcept <code/refrow/D10M44> ;
71
53
  skos:hasTopConcept <code/refrow/D1M3> ;
72
54
  skos:hasTopConcept <code/refrow/D1M75> ;
metadata CHANGED
@@ -1,100 +1,88 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-publisci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - wstrinz
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-20 00:00:00.000000000 Z
11
+ date: 2013-07-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rdf
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rdf-4store
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rdf-turtle
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rserve-client
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: sparql
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rspec
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rdoc
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ~>
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ~>
124
109
  - !ruby/object:Gem::Version
@@ -126,23 +111,20 @@ dependencies:
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: cucumber
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - '>='
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - '>='
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: jeweler
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ~>
148
130
  - !ruby/object:Gem::Version
@@ -150,7 +132,6 @@ dependencies:
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ~>
156
137
  - !ruby/object:Gem::Version
@@ -158,39 +139,34 @@ dependencies:
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: bundler
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
- - - ! '>='
143
+ - - '>='
164
144
  - !ruby/object:Gem::Version
165
145
  version: 1.0.21
166
146
  type: :development
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
- - - ! '>='
150
+ - - '>='
172
151
  - !ruby/object:Gem::Version
173
152
  version: 1.0.21
174
153
  - !ruby/object:Gem::Dependency
175
154
  name: bio
176
155
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
156
  requirements:
179
- - - ! '>='
157
+ - - '>='
180
158
  - !ruby/object:Gem::Version
181
159
  version: 1.4.2
182
160
  type: :development
183
161
  prerelease: false
184
162
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
163
  requirements:
187
- - - ! '>='
164
+ - - '>='
188
165
  - !ruby/object:Gem::Version
189
166
  version: 1.4.2
190
167
  - !ruby/object:Gem::Dependency
191
168
  name: rdoc
192
169
  requirement: !ruby/object:Gem::Requirement
193
- none: false
194
170
  requirements:
195
171
  - - ~>
196
172
  - !ruby/object:Gem::Version
@@ -198,13 +174,12 @@ dependencies:
198
174
  type: :development
199
175
  prerelease: false
200
176
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
177
  requirements:
203
178
  - - ~>
204
179
  - !ruby/object:Gem::Version
205
180
  version: '3.12'
206
- description: ! 'A toolkit for publishing scientific results and datasets using RDF
207
- and related technologies '
181
+ description: 'A toolkit for publishing scientific results and datasets using RDF and
182
+ related technologies '
208
183
  email: wstrinz@gmail.com
209
184
  executables:
210
185
  - bio-publisci
@@ -226,6 +201,8 @@ files:
226
201
  - features/create_generator.feature
227
202
  - features/integration.feature
228
203
  - features/integration_steps.rb
204
+ - features/metadata.feature
205
+ - features/metadata_steps.rb
229
206
  - features/orm.feature
230
207
  - features/orm_steps.rb
231
208
  - features/reader.feature
@@ -241,8 +218,8 @@ files:
241
218
  - lib/bio-publisci/dataset/ORM/data_cube_orm.rb
242
219
  - lib/bio-publisci/dataset/ORM/observation.rb
243
220
  - lib/bio-publisci/dataset/data_cube.rb
221
+ - lib/bio-publisci/dataset/dataset_for.rb
244
222
  - lib/bio-publisci/dataset/interactive.rb
245
- - lib/bio-publisci/loader.rb
246
223
  - lib/bio-publisci/metadata/metadata.rb
247
224
  - lib/bio-publisci/parser.rb
248
225
  - lib/bio-publisci/query/query_helper.rb
@@ -278,16 +255,22 @@ files:
278
255
  - lib/vocabs/wot.rb
279
256
  - lib/vocabs/xhtml.rb
280
257
  - lib/vocabs/xsd.rb
258
+ - resources/queries/code_resources.rq
281
259
  - resources/queries/codes.rq
282
260
  - resources/queries/dataset.rq
283
261
  - resources/queries/dimension_ranges.rq
284
262
  - resources/queries/dimensions.rq
285
263
  - resources/queries/measures.rq
264
+ - resources/queries/observation_labels.rq
286
265
  - resources/queries/observations.rq
266
+ - resources/queries/properties.rq
287
267
  - resources/queries/test.rq
288
268
  - resources/weather.numeric.arff
269
+ - scripts/islet_mlratio.rb
270
+ - scripts/scan_islet.rb
271
+ - scripts/update_reference.rb
272
+ - spec/ORM/data_cube_orm_spec.rb
289
273
  - spec/analyzer_spec.rb
290
- - spec/bio-publisci_spec.rb
291
274
  - spec/csv/bacon.csv
292
275
  - spec/csv/moar_bacon.csv
293
276
  - spec/data_cube_spec.rb
@@ -305,35 +288,33 @@ files:
305
288
  - spec/queries/integrity/4.rq
306
289
  - spec/queries/integrity/5.rq
307
290
  - spec/r_builder_spec.rb
291
+ - spec/resource/.RData
292
+ - spec/resource/example.Rhistory
308
293
  - spec/spec_helper.rb
309
294
  - spec/turtle/bacon
310
295
  - spec/turtle/reference
311
296
  homepage: http://github.com/wstrinz/bioruby-publisci
312
297
  licenses:
313
298
  - MIT
299
+ metadata: {}
314
300
  post_install_message:
315
301
  rdoc_options: []
316
302
  require_paths:
317
303
  - lib
318
304
  required_ruby_version: !ruby/object:Gem::Requirement
319
- none: false
320
305
  requirements:
321
- - - ! '>='
306
+ - - '>='
322
307
  - !ruby/object:Gem::Version
323
308
  version: '0'
324
- segments:
325
- - 0
326
- hash: -1178175655966297191
327
309
  required_rubygems_version: !ruby/object:Gem::Requirement
328
- none: false
329
310
  requirements:
330
- - - ! '>='
311
+ - - '>='
331
312
  - !ruby/object:Gem::Version
332
313
  version: '0'
333
314
  requirements: []
334
315
  rubyforge_project:
335
- rubygems_version: 1.8.25
316
+ rubygems_version: 2.0.3
336
317
  signing_key:
337
- specification_version: 3
318
+ specification_version: 4
338
319
  summary: Publish science data using semantic web ontologies
339
320
  test_files: []
@@ -1,36 +0,0 @@
1
- # This is temporary, just to help w/ development so I don't have to rewrite r2rdf.rb to be
2
- # a standard gem base yet. Also load s the files instead of require for easy reloading
3
- require 'tempfile'
4
- require 'rdf'
5
- require 'csv'
6
- require 'rserve'
7
- require 'sparql'
8
- require 'sparql/client'
9
- require 'rdf/turtle'
10
-
11
- def load_folder(folder)
12
- Dir.foreach(File.dirname(__FILE__) + "/#{folder}") do |file|
13
- unless file == "." or file == ".."
14
- load File.dirname(__FILE__) + "/#{folder}/" + file
15
- end
16
- end
17
- end
18
-
19
- load File.dirname(__FILE__) + '/dataset/interactive.rb'
20
- load File.dirname(__FILE__) + '/query/query_helper.rb'
21
- load File.dirname(__FILE__) + '/parser.rb'
22
- load File.dirname(__FILE__) + '/r_client.rb'
23
- load File.dirname(__FILE__) + '/analyzer.rb'
24
- load File.dirname(__FILE__) + '/store.rb'
25
- load File.dirname(__FILE__) + '/dataset/data_cube.rb'
26
-
27
-
28
- load_folder('metadata')
29
- load_folder('readers')
30
- load_folder('writers')
31
- load_folder('dataset/ORM')
32
- # Dir.foreach(File.dirname(__FILE__) + '/generators') do |file|
33
- # unless file == "." or file == ".."
34
- # load File.dirname(__FILE__) + '/generators/' + file
35
- # end
36
- # end
@@ -1,7 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "BioPublisci" do
4
- it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
6
- end
7
- end