biointerchange 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.travis.yml +2 -2
- data/README.md +7 -6
- data/VERSION +1 -1
- data/examples/ReaderModelWriterSequenceDiagram.graffle +3073 -0
- data/examples/ReaderModelWriterSequenceDiagram.png +0 -0
- data/lib/biointerchange/core.rb +63 -58
- data/lib/biointerchange/faldo.rb +125 -35
- data/lib/biointerchange/genomics/gff3_feature_sequence.rb +36 -0
- data/lib/biointerchange/genomics/gff3_rdf_ntriples.rb +254 -147
- data/lib/biointerchange/genomics/gff3_reader.rb +22 -3
- data/lib/biointerchange/genomics/locations.rb +30 -0
- data/lib/biointerchange/gfvo.rb +1072 -0
- data/lib/biointerchange/phylogenetics/cdao_rdf_ntriples.rb +6 -5
- data/lib/biointerchange/textmining/text_mining_rdf_ntriples.rb +7 -4
- data/lib/biointerchange/writer.rb +138 -2
- data/spec/gff3_rdfwriter_spec.rb +5 -6
- data/spec/gvf_rdfwriter_spec.rb +5 -6
- data/spec/phylogenetics_spec.rb +1 -1
- data/web/images/BioInterchange120.png +0 -0
- data/web/images/BioInterchange120inv.png +0 -0
- data/web/images/BioInterchange160.png +0 -0
- data/web/images/BioInterchange160inv.png +0 -0
- data/web/images/BioInterchange300inv.png +0 -0
- data/web/index.html +5 -1
- data/web/ontologies.html +1538 -21
- metadata +31 -46
Binary file
|
data/lib/biointerchange/core.rb
CHANGED
@@ -7,15 +7,30 @@ module BioInterchange
|
|
7
7
|
|
8
8
|
### Global behaviour settings, which can be altered programmatically or via the CLI:
|
9
9
|
|
10
|
-
# If true, then RDF::Graph's
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
@@skip_rdf_graph
|
10
|
+
# If true, then RDF::Graph's & co will be used. Should only be applied for
|
11
|
+
# performance comparisons between the "standard" Ruby gem implementation and
|
12
|
+
# BioInterchange's optimized RDF handling.
|
13
|
+
@@evaluation = false
|
14
|
+
def self.evaluation
|
15
|
+
@@evaluation
|
17
16
|
end
|
18
17
|
|
18
|
+
# BioInterchange can output RDF in two formats: Turtle (default) and N-Triples.
|
19
|
+
# The two corresponding Ruby constants for these two output formats are:
|
20
|
+
# Turtle: `:turtle`
|
21
|
+
# N-Triples: `:ntriples`
|
22
|
+
@@format = :turtle
|
23
|
+
def self.format
|
24
|
+
@@format
|
25
|
+
end
|
26
|
+
|
27
|
+
# Default URI prefix that is used when RDFizing data:
|
28
|
+
@@default_uri_prefix = ''
|
29
|
+
|
30
|
+
# If input/rdf options permit batching, but no batchsize has been provided by
|
31
|
+
# the user, then use this default batch size.
|
32
|
+
@@default_batch_size = 100
|
33
|
+
|
19
34
|
# Custom Exceptions and Errors
|
20
35
|
require 'biointerchange/exceptions'
|
21
36
|
|
@@ -23,6 +38,7 @@ module BioInterchange
|
|
23
38
|
require 'biointerchange/cdao'
|
24
39
|
require 'biointerchange/faldo'
|
25
40
|
require 'biointerchange/gff3o'
|
41
|
+
require 'biointerchange/gfvo'
|
26
42
|
require 'biointerchange/goxref'
|
27
43
|
require 'biointerchange/gvf1o'
|
28
44
|
require 'biointerchange/sio'
|
@@ -61,6 +77,9 @@ module BioInterchange
|
|
61
77
|
|
62
78
|
### GFF3 ###
|
63
79
|
|
80
|
+
# Helper class for dealing with genomic locations
|
81
|
+
require 'biointerchange/genomics/locations'
|
82
|
+
|
64
83
|
# Reader
|
65
84
|
require 'biointerchange/genomics/gff3_reader'
|
66
85
|
|
@@ -68,6 +87,7 @@ module BioInterchange
|
|
68
87
|
require 'biointerchange/genomics/gff3_pragmas'
|
69
88
|
require 'biointerchange/genomics/gff3_feature_set'
|
70
89
|
require 'biointerchange/genomics/gff3_feature'
|
90
|
+
require 'biointerchange/genomics/gff3_feature_sequence.rb'
|
71
91
|
|
72
92
|
# Writer
|
73
93
|
require 'biointerchange/genomics/gff3_rdf_ntriples'
|
@@ -107,21 +127,28 @@ module BioInterchange
|
|
107
127
|
|
108
128
|
def self.cli
|
109
129
|
begin
|
110
|
-
|
130
|
+
opts = [
|
111
131
|
["--help", "-h", Getopt::BOOLEAN],
|
112
132
|
["--debug", "-d", Getopt::BOOLEAN], # set debug mode => print stack traces
|
113
|
-
["--no_rdf_graph_optimization", "-n", Getopt::BOOLEAN], # set self.skip_rdf_graph to false
|
114
133
|
["--batchsize", "-b", Getopt::OPTIONAL], # batchsize for readers/writers that support +postpone?+
|
134
|
+
["--ntriples", "-n", Getopt::BOOLEAN], # produce N-Triples instead of Turtle
|
135
|
+
["--evaluation", "-z", Getopt::BOOLEAN], # use RDF gem implementation for mem/speed comparison
|
136
|
+
["--uri", "-u", Getopt::OPTIONAL], # URI prefix to use when serializing RDF
|
115
137
|
["--input", "-i", Getopt::REQUIRED], # input file format
|
116
138
|
["--rdf", "-r", Getopt::REQUIRED], # output file format
|
117
|
-
["--annotate_name", Getopt::OPTIONAL], # name of resource/tool/person
|
118
|
-
["--annotate_name_id", Getopt::OPTIONAL], # uri of resource/tool/person
|
119
|
-
["--annotate_date", Getopt::OPTIONAL], # date of processing/annotation
|
120
|
-
["--annotate_version", Getopt::OPTIONAL], # version number of resource
|
121
139
|
["--file", "-f", Getopt::OPTIONAL], # file to read, will read from STDIN if not supplied
|
122
140
|
["--out", "-o", Getopt::OPTIONAL], # output file, will out to STDOUT if not supplied
|
123
141
|
["--version", "-v", Getopt::BOOLEAN] # output the version number of the gem and exit
|
124
|
-
|
142
|
+
]
|
143
|
+
reader_writer_pairs = Registry.reader_writer_pairs
|
144
|
+
reader_writer_pairs.each_index { |reader_writer_pair_index|
|
145
|
+
reader_id, writer_id = reader_writer_pairs[reader_writer_pair_index]
|
146
|
+
Registry.options_help(reader_id).each { |option_description|
|
147
|
+
option, description = option_description
|
148
|
+
opts |= [ [ "--annotate_#{option.sub(/\s.*$/, '')}", Getopt::OPTIONAL ] ]
|
149
|
+
}
|
150
|
+
}
|
151
|
+
opt = Getopt::Long.getopts(*opts)
|
125
152
|
|
126
153
|
if opt['help'] or not (opt['input'] and opt['rdf'] or opt['version']) then
|
127
154
|
puts "Usage: ruby #{$0} -i <format> -r <format> [options]"
|
@@ -137,18 +164,23 @@ module BioInterchange
|
|
137
164
|
}
|
138
165
|
puts ''
|
139
166
|
puts 'I/O options:'
|
167
|
+
puts ' -f <file> / --file <file> : file to read; STDIN used if not supplied'
|
168
|
+
puts ' -o <file> / --out <file> : output file; STDOUT used if not supplied'
|
169
|
+
puts ' -n / --ntriples : output RDF N-Triples (instead of RDF Turtle)'
|
170
|
+
puts ' -u <uri> / --uri <prefix> : URI prefix to use'
|
171
|
+
puts " (default: #{@@default_uri_prefix})"
|
140
172
|
puts ' -b <size>/--batchsize <size> : process input in batches of the given size'
|
141
|
-
puts ' (if supported, see below for valid input/rdf pairs
|
142
|
-
puts
|
143
|
-
puts ' -o <file>/--out <file> : output file; STDOUT used if not supplied'
|
173
|
+
puts ' (if supported, see below for valid input/rdf pairs;'
|
174
|
+
puts " if supported, but not set, default value is #{@@default_batch_size})"
|
144
175
|
puts ''
|
145
176
|
puts 'Other options:'
|
146
177
|
puts ' -v / --version : print the Gem\'s version number and exit'
|
147
178
|
puts ' -d / --debug : turn on debugging output (for stacktraces)'
|
179
|
+
puts ' -z / --evaluation : use \'RDF\' gem implementation (slow & memory intensive,'
|
180
|
+
puts ' only included for performance evaluation comparisons)'
|
148
181
|
puts ' -h --help : this message'
|
149
182
|
puts ''
|
150
|
-
puts 'Input-/
|
151
|
-
reader_writer_pairs = Registry.reader_writer_pairs
|
183
|
+
puts 'Input-/output-format specific options:'
|
152
184
|
reader_writer_pairs.each_index { |reader_writer_pair_index|
|
153
185
|
reader_id, writer_id = reader_writer_pairs[reader_writer_pair_index]
|
154
186
|
puts " Input format : #{reader_id}"
|
@@ -171,14 +203,21 @@ module BioInterchange
|
|
171
203
|
|
172
204
|
# Turn off optimization, if requested. This will generate an RDF graph in memory and
|
173
205
|
# at least double memory requirements and runtime.
|
174
|
-
@@
|
206
|
+
@@evaluation = true if opt['evaluation']
|
207
|
+
|
208
|
+
# Switch to N-Triples output:
|
209
|
+
@@format = :ntriples if opt['ntriples']
|
175
210
|
|
176
211
|
# Check if the input/rdf options are supported:
|
177
212
|
unsupported_combination unless Registry.is_supported?(opt['input'], opt['rdf'])
|
178
213
|
|
214
|
+
# If a batchsize is given, then use it. Otherwise, check if the input/rdf combination
|
215
|
+
# supports batching and set a default batch value.
|
179
216
|
if opt['batchsize'] then
|
180
217
|
batching_not_supported unless Registry.is_supporting_batch_processing?(opt['input'], opt['rdf'])
|
181
218
|
wrong_type('batchsize', 'a positive integer') unless opt['batchsize'].match(/^[1-9][0-9]*$/)
|
219
|
+
elsif Registry.is_supporting_batch_processing?(opt['input'], opt['rdf']) then
|
220
|
+
opt['batchsize'] = @@default_batch_size
|
182
221
|
end
|
183
222
|
|
184
223
|
# Create a parameter map that can be passed along to Reader implementations:
|
@@ -214,9 +253,12 @@ module BioInterchange
|
|
214
253
|
|
215
254
|
begin
|
216
255
|
model = reader.deserialize(input_source)
|
217
|
-
writer.serialize(model)
|
256
|
+
writer.serialize(model, opt['uri'])
|
218
257
|
end while reader.postponed?
|
219
258
|
|
259
|
+
rescue Interrupt
|
260
|
+
# The user hit Ctrl-C, which is okay and does not need error reporting.
|
261
|
+
exit 0
|
220
262
|
rescue ArgumentError => e
|
221
263
|
$stderr.puts e.message
|
222
264
|
$stderr.puts e.backtrace if opt['debug']
|
@@ -259,10 +301,6 @@ module BioInterchange
|
|
259
301
|
|
260
302
|
private
|
261
303
|
|
262
|
-
def self.batching_not_supported
|
263
|
-
raise ArgumentError, 'Batching is not supported for this input/output format combination.'
|
264
|
-
end
|
265
|
-
|
266
304
|
def self.unsupported_combination
|
267
305
|
raise ArgumentError, 'This input/output format combination is not supported.'
|
268
306
|
end
|
@@ -273,36 +311,3 @@ private
|
|
273
311
|
|
274
312
|
end
|
275
313
|
|
276
|
-
# Overwrite RDF::Graph implementation, in case we do not want to keep
|
277
|
-
# the complete graph in memory. If the implementing writer does not
|
278
|
-
# set an output stream via +fast_ostream+, then fall back to the original
|
279
|
-
# implementation.
|
280
|
-
module RDF
|
281
|
-
|
282
|
-
class Graph
|
283
|
-
# DO NOT keep old insert implementation due to infinite recursion caused by module loading dependencies!
|
284
|
-
# alias_method :graph_building_insert, :insert
|
285
|
-
|
286
|
-
# Set an output stream for writing in +insert+.
|
287
|
-
#
|
288
|
-
# +ostream+:: Output stream that is populated by +insert+, if optimization can be carried out.
|
289
|
-
def fast_ostream(ostream)
|
290
|
-
@ostream = ostream
|
291
|
-
end
|
292
|
-
|
293
|
-
# Alternative implementation to +insert+, which can immediately output N-Triples instead
|
294
|
-
# of building an in-memory graph first.
|
295
|
-
#
|
296
|
-
# +statement+:: RDF statement that should be serialized.
|
297
|
-
def insert(statement)
|
298
|
-
if BioInterchange::skip_rdf_graph and @ostream then
|
299
|
-
@ostream.puts(statement.to_ntriples)
|
300
|
-
else
|
301
|
-
insert_statement(statement)
|
302
|
-
end
|
303
|
-
end
|
304
|
-
|
305
|
-
end
|
306
|
-
|
307
|
-
end
|
308
|
-
|
data/lib/biointerchange/faldo.rb
CHANGED
@@ -3,7 +3,43 @@ module BioInterchange
|
|
3
3
|
|
4
4
|
class FALDO
|
5
5
|
|
6
|
-
#
|
6
|
+
# Used to describe a location that consists out of a number of Regions but where the order is not known. e.g. the odly named order keyword in a INSDC fle.
|
7
|
+
# (http://biohackathon.org/resource/faldo#BagOfRegions)
|
8
|
+
def self.BagOfRegions
|
9
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#BagOfRegions')
|
10
|
+
end
|
11
|
+
|
12
|
+
# Sometimes a location of a feature is defined by a collection of regions e.g. INSDC join and order. One should always try to model the semantics more accuratly these are fallback options to encode legacy data.
|
13
|
+
# (http://biohackathon.org/resource/faldo#CollectionOfRegions)
|
14
|
+
def self.CollectionOfRegions
|
15
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#CollectionOfRegions')
|
16
|
+
end
|
17
|
+
|
18
|
+
# The position is on the forward (positive, 5' to 3') strand. Shown as a '+' in GFF3 and GTF.
|
19
|
+
# (http://biohackathon.org/resource/faldo#ForwardStrandPosition)
|
20
|
+
def self.Positive_strand
|
21
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#ForwardStrandPosition')
|
22
|
+
end
|
23
|
+
|
24
|
+
# Part of the coordinate system denoting on which strand the feature can be found. If you do not yet know which stand the feature is on, you should tag the position with just this class. If you know more you should use one of the subclasses. This means a region descibred with a '.' in GFF3. A GFF3 unstranded position does not have this type in FALDO -- those are just a 'position'.
|
25
|
+
# (http://biohackathon.org/resource/faldo#StrandedPosition)
|
26
|
+
def self.Stranded_position
|
27
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#StrandedPosition')
|
28
|
+
end
|
29
|
+
|
30
|
+
# The 'both strands position' means that the region spans both strands instead of one. In GFF3 displayed as 0. This does not mean that the position is one or the other strand, but that is best described as being on both.
|
31
|
+
# (http://biohackathon.org/resource/faldo#BothStrandsPosition)
|
32
|
+
def self.Both_strands
|
33
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#BothStrandsPosition')
|
34
|
+
end
|
35
|
+
|
36
|
+
# The position is on the reverse (complement, 3' to 5') strand of the sequence. Shown as '-' in GTF and GFF3.
|
37
|
+
# (http://biohackathon.org/resource/faldo#ReverseStrandPosition)
|
38
|
+
def self.Negative_strand
|
39
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#ReverseStrandPosition')
|
40
|
+
end
|
41
|
+
|
42
|
+
# This denotes that a feature is in between two other positions that are both known exactly and next to each other. An example is a restriction enzyme cutting site. The cut is after one nucleotide position and before another nucleotide position (hence, in between).
|
7
43
|
# (http://biohackathon.org/resource/faldo#InBetweenPosition)
|
8
44
|
def self.In_between_positions
|
9
45
|
return RDF::URI.new('http://biohackathon.org/resource/faldo#InBetweenPosition')
|
@@ -21,58 +57,100 @@ class FALDO
|
|
21
57
|
return RDF::URI.new('http://biohackathon.org/resource/faldo#ExactPosition')
|
22
58
|
end
|
23
59
|
|
24
|
-
#
|
60
|
+
# This used to indicate that the feature is found before the exact position. Use to indicate, for example, a cleavage site. The cleavage happens between two amino acids before one and after the other.
|
61
|
+
# (http://biohackathon.org/resource/faldo#before)
|
62
|
+
def self.before
|
63
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#before')
|
64
|
+
end
|
65
|
+
|
66
|
+
# This predicate is used when you want to describe a non-inclusive range. Only used in the in between position to say it is after a nucleotide, but before the next one.
|
67
|
+
# (http://biohackathon.org/resource/faldo#after)
|
68
|
+
def self.after
|
69
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#after')
|
70
|
+
end
|
71
|
+
|
72
|
+
# The position must be one of the more detailed positions listed by the location predicate.
|
25
73
|
# (http://biohackathon.org/resource/faldo#OneOfPosition)
|
26
74
|
def self.One_of_positions
|
27
75
|
return RDF::URI.new('http://biohackathon.org/resource/faldo#OneOfPosition')
|
28
76
|
end
|
29
77
|
|
30
|
-
# Use when you have an idea of the range in which you can find the position but
|
78
|
+
# Use when you have an idea of the range in which you can find the position, but you cannot be sure about the exact position.
|
31
79
|
# (http://biohackathon.org/resource/faldo#InRangePosition)
|
32
80
|
def self.Indeterminate_position_within_a_range
|
33
81
|
return RDF::URI.new('http://biohackathon.org/resource/faldo#InRangePosition')
|
34
82
|
end
|
35
83
|
|
36
|
-
# Part of the coordinate system is on which strand the feature can be found. If you do not yet know which stand the feature is on you should tag the position with just this class. If you know more you should use one of the subclasses. This means a region descibred with a '.' in GFF3. An GFF3 Unstranded position does not have this type in FALDO those are just a Position.
|
37
|
-
# (http://biohackathon.org/resource/faldo#StrandedPosition)
|
38
|
-
def self.Stranded_position
|
39
|
-
return RDF::URI.new('http://biohackathon.org/resource/faldo#StrandedPosition')
|
40
|
-
end
|
41
|
-
|
42
84
|
# Use this class to indicate that you lack exact position data.
|
43
85
|
# (http://biohackathon.org/resource/faldo#FuzzyPosition)
|
44
86
|
def self.Fuzzy_position
|
45
87
|
return RDF::URI.new('http://biohackathon.org/resource/faldo#FuzzyPosition')
|
46
88
|
end
|
47
89
|
|
48
|
-
# The
|
49
|
-
# (http://biohackathon.org/resource/faldo#
|
50
|
-
def self.
|
51
|
-
return RDF::URI.new('http://biohackathon.org/resource/faldo#
|
90
|
+
# The inclusive begin position of a position. Also known as start.
|
91
|
+
# (http://biohackathon.org/resource/faldo#begin)
|
92
|
+
def self.begin
|
93
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#begin')
|
52
94
|
end
|
53
95
|
|
54
|
-
# The
|
55
|
-
# (http://biohackathon.org/resource/faldo#
|
56
|
-
def self.
|
57
|
-
return RDF::URI.new('http://biohackathon.org/resource/faldo#
|
96
|
+
# The inclusive end of the position.
|
97
|
+
# (http://biohackathon.org/resource/faldo#end)
|
98
|
+
def self.end
|
99
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#end')
|
58
100
|
end
|
59
101
|
|
60
|
-
#
|
61
|
-
# (http://biohackathon.org/resource/faldo#ReverseStrandPosition)
|
62
|
-
def self.Negative_strand
|
63
|
-
return RDF::URI.new('http://biohackathon.org/resource/faldo#ReverseStrandPosition')
|
64
|
-
end
|
65
|
-
|
66
|
-
# A region describes an length of sequence with a start and end position that represents a feature on a Sequence. i.e. a gene
|
102
|
+
# A region describes a length of sequence -- with a start position and end position -- that represents a feature on a Sequence. i.e. a gene
|
67
103
|
# (http://biohackathon.org/resource/faldo#Region)
|
68
104
|
def self.Region
|
69
105
|
return RDF::URI.new('http://biohackathon.org/resource/faldo#Region')
|
70
106
|
end
|
71
107
|
|
108
|
+
# A position on the first amino acid or nucleotide of a sequence has the value 1, i.e. Python style array indexing as opposed to Java/C indexes.
|
109
|
+
# (http://biohackathon.org/resource/faldo#position)
|
110
|
+
def self.position
|
111
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#position')
|
112
|
+
end
|
113
|
+
|
114
|
+
# The reference is the resource that determines where the position value offsets into. For example, it points to a contig or a genome assembly.
|
115
|
+
# (http://biohackathon.org/resource/faldo#reference)
|
116
|
+
def self.reference
|
117
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#reference')
|
118
|
+
end
|
119
|
+
|
120
|
+
# As an ordered list of regions (but the list might not be complete)
|
121
|
+
# (http://biohackathon.org/resource/faldo#ListOfRegions)
|
122
|
+
def self.ListOfRegions
|
123
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#ListOfRegions')
|
124
|
+
end
|
125
|
+
|
126
|
+
# This is the link between the concept whose location you are annotating the and its range or position. For example, when annotating the region that describes an exon, the exon would be the subject and the region would be the object of the triple or: 'active site' 'location' [is] 'position 3'.
|
127
|
+
# (http://biohackathon.org/resource/faldo#location)
|
128
|
+
def self.location
|
129
|
+
return RDF::URI.new('http://biohackathon.org/resource/faldo#location')
|
130
|
+
end
|
131
|
+
|
72
132
|
# Determines whether the given URI is an object property.
|
73
133
|
#
|
74
134
|
# +uri+:: URI that is tested for being an object property
|
75
135
|
def self.is_object_property?(uri)
|
136
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#before') then
|
137
|
+
return true
|
138
|
+
end
|
139
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#after') then
|
140
|
+
return true
|
141
|
+
end
|
142
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#begin') then
|
143
|
+
return true
|
144
|
+
end
|
145
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#end') then
|
146
|
+
return true
|
147
|
+
end
|
148
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#reference') then
|
149
|
+
return true
|
150
|
+
end
|
151
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#location') then
|
152
|
+
return true
|
153
|
+
end
|
76
154
|
return false
|
77
155
|
end
|
78
156
|
|
@@ -80,6 +158,9 @@ class FALDO
|
|
80
158
|
#
|
81
159
|
# +uri+:: URI that is tested for being a datatype property
|
82
160
|
def self.is_datatype_property?(uri)
|
161
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#position') then
|
162
|
+
return true
|
163
|
+
end
|
83
164
|
return false
|
84
165
|
end
|
85
166
|
|
@@ -87,39 +168,48 @@ class FALDO
|
|
87
168
|
#
|
88
169
|
# +uri+:: URI that is tested for being a class
|
89
170
|
def self.is_class?(uri)
|
90
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
171
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#BagOfRegions') then
|
91
172
|
return true
|
92
173
|
end
|
93
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
174
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#CollectionOfRegions') then
|
94
175
|
return true
|
95
176
|
end
|
96
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
177
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#ForwardStrandPosition') then
|
97
178
|
return true
|
98
179
|
end
|
99
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
180
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#StrandedPosition') then
|
100
181
|
return true
|
101
182
|
end
|
102
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
183
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#BothStrandsPosition') then
|
103
184
|
return true
|
104
185
|
end
|
105
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
186
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#ReverseStrandPosition') then
|
106
187
|
return true
|
107
188
|
end
|
108
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
189
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#InBetweenPosition') then
|
109
190
|
return true
|
110
191
|
end
|
111
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
192
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#Position') then
|
112
193
|
return true
|
113
194
|
end
|
114
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
195
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#ExactPosition') then
|
115
196
|
return true
|
116
197
|
end
|
117
|
-
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#
|
198
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#OneOfPosition') then
|
199
|
+
return true
|
200
|
+
end
|
201
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#InRangePosition') then
|
202
|
+
return true
|
203
|
+
end
|
204
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#FuzzyPosition') then
|
118
205
|
return true
|
119
206
|
end
|
120
207
|
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#Region') then
|
121
208
|
return true
|
122
209
|
end
|
210
|
+
if uri == RDF::URI.new('http://biohackathon.org/resource/faldo#ListOfRegions') then
|
211
|
+
return true
|
212
|
+
end
|
123
213
|
return false
|
124
214
|
end
|
125
215
|
|
@@ -153,7 +243,7 @@ class FALDO
|
|
153
243
|
end
|
154
244
|
|
155
245
|
private
|
156
|
-
@@parent_properties = { RDF::URI.new('http://biohackathon.org/resource/faldo#
|
246
|
+
@@parent_properties = { RDF::URI.new('http://biohackathon.org/resource/faldo#BagOfRegions') => RDF::URI.new('http://biohackathon.org/resource/faldo#CollectionOfRegions') , RDF::URI.new('http://biohackathon.org/resource/faldo#ForwardStrandPosition') => RDF::URI.new('http://biohackathon.org/resource/faldo#StrandedPosition') , RDF::URI.new('http://biohackathon.org/resource/faldo#StrandedPosition') => RDF::URI.new('http://biohackathon.org/resource/faldo#Position') , RDF::URI.new('http://biohackathon.org/resource/faldo#BothStrandsPosition') => RDF::URI.new('http://biohackathon.org/resource/faldo#StrandedPosition') , RDF::URI.new('http://biohackathon.org/resource/faldo#ReverseStrandPosition') => RDF::URI.new('http://biohackathon.org/resource/faldo#StrandedPosition') , RDF::URI.new('http://biohackathon.org/resource/faldo#OneOfPosition') => RDF::URI.new('http://biohackathon.org/resource/faldo#FuzzyPosition') , RDF::URI.new('http://biohackathon.org/resource/faldo#FuzzyPosition') => RDF::URI.new('http://biohackathon.org/resource/faldo#Position') , RDF::URI.new('http://biohackathon.org/resource/faldo#ListOfRegions') => RDF::URI.new('http://biohackathon.org/resource/faldo#CollectionOfRegions') }
|
157
247
|
|
158
248
|
end
|
159
249
|
|