biointerchange 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +49 -4
- data/VERSION +1 -1
- data/examples/chromosome_BF.gff +1701 -0
- data/examples/estd176_Banerjee_et_al_2011.2012-11-29.NCBI36.gvf +4326 -0
- data/examples/pubannotation.10096561.json +1 -0
- data/examples/{pubannotation.json → pubannotation.10096561.json.old} +0 -0
- data/examples/pubannotation.2626671.json +1 -0
- data/lib/biointerchange/core.rb +58 -16
- data/lib/biointerchange/genomics/gff3_feature.rb +1 -0
- data/lib/biointerchange/genomics/gff3_feature_set.rb +31 -1
- data/lib/biointerchange/genomics/gff3_pragmas.rb +35 -0
- data/lib/biointerchange/genomics/gff3_rdf_ntriples.rb +60 -23
- data/lib/biointerchange/genomics/gff3_reader.rb +74 -40
- data/lib/biointerchange/genomics/gvf_feature.rb +24 -0
- data/lib/biointerchange/genomics/gvf_feature_set.rb +14 -0
- data/lib/biointerchange/genomics/gvf_pragmas.rb +6 -0
- data/lib/biointerchange/genomics/gvf_reader.rb +37 -0
- data/lib/biointerchange/gff3o.rb +1 -1
- data/lib/biointerchange/gvf1o.rb +145 -17
- data/lib/biointerchange/textmining/content.rb +1 -0
- data/lib/biointerchange/textmining/content_connection.rb +74 -0
- data/lib/biointerchange/textmining/document.rb +3 -1
- data/lib/biointerchange/textmining/pubannos_json_reader.rb +87 -9
- data/lib/biointerchange/textmining/text_mining_rdf_ntriples.rb +58 -2
- data/spec/gff3_rdfwriter_spec.rb +9 -1
- data/spec/gvf_rdfwriter_spec.rb +81 -0
- data/spec/text_mining_pubannos_json_reader_spec.rb +82 -10
- data/spec/text_mining_rdfwriter_spec.rb +11 -0
- data/web/api.html +30 -23
- metadata +156 -138
@@ -0,0 +1,24 @@
|
|
1
|
+
module BioInterchange::Genomics
|
2
|
+
|
3
|
+
# Represents a single genomic feature of a GVF file.
|
4
|
+
class GVFFeature < GFF3Feature
|
5
|
+
|
6
|
+
# Creates a new feature representation. A feature is described on one line of the GVF file.
|
7
|
+
#
|
8
|
+
# +sequence_id+:: an identifier that determines the coordinate system for the feature
|
9
|
+
# +source+:: a text description of the origin of this feature description
|
10
|
+
# +type+:: either a SOFA accession, SOFA term, or textual description (the former are URIs, the latter is a string)
|
11
|
+
# +start_coordinate+:: an integer denoting the start coordinate of the feature
|
12
|
+
# +end_coordinate+:: an integer denoting the end coordinate of the feature, which is equal or larger than the start coordinate
|
13
|
+
# +score+:: a floating point score
|
14
|
+
# +strand+:: a constant determining whether the feature is NOT_STRANDED, the strand is UNKNOWN, or the feature is on the POSITIVE or NEGATIVE strand
|
15
|
+
# +attributes+:: a map of additional attributes associated with the feature
|
16
|
+
def initialize(sequence_id, source, type, start_coordinate, end_coordinate, score = nil, strand = NOT_STRANDED, attributes = {})
|
17
|
+
# Fill in phase, which is always omitted in GVF features (after 'strand', before 'attributes'):
|
18
|
+
super(sequence_id, source, type, start_coordinate, end_coordinate, score, strand, nil, attributes)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
module BioInterchange::Genomics
|
3
|
+
|
4
|
+
# A GVF feature set, which encapsules information of a single GVF file.
|
5
|
+
class GVFFeatureSet < GFF3FeatureSet
|
6
|
+
|
7
|
+
def uri
|
8
|
+
super.sub(/^biointerchange:\/\/gff3\//, 'biointerchange://gvf/')
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module BioInterchange::Genomics
|
2
|
+
|
3
|
+
class GVFReader < GFF3Reader
|
4
|
+
|
5
|
+
# Creates a new instance of a Genome Variation Format (GVF) reader.
|
6
|
+
#
|
7
|
+
# +name+:: Optional name of the person who generated the GVF file.
|
8
|
+
# +name_uri+:: Optional e-mail address of the person who generated the GVF file.
|
9
|
+
# +date+:: Optional date of when the GVF file was produced.
|
10
|
+
def initialize(name = nil, name_uri = nil, date = nil)
|
11
|
+
# Remember: calling super without brackets passes all arguments of initialize!
|
12
|
+
super
|
13
|
+
end
|
14
|
+
|
15
|
+
protected
|
16
|
+
|
17
|
+
def create_feature_set
|
18
|
+
BioInterchange::Genomics::GVFFeatureSet.new()
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_pragma(feature_set, line)
|
22
|
+
line.chomp!
|
23
|
+
name, value = line[2..-1].split(/\s/, 2)
|
24
|
+
value.strip!
|
25
|
+
|
26
|
+
# Interpret pragmas, and if not known, delegate to GFF3Reader:
|
27
|
+
if name == 'gvf-version' then
|
28
|
+
feature_set.set_pragma(name, { name => value.to_f })
|
29
|
+
else
|
30
|
+
super(feature_set, line)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
data/lib/biointerchange/gff3o.rb
CHANGED
@@ -488,7 +488,7 @@ class GFF3O
|
|
488
488
|
end
|
489
489
|
|
490
490
|
private
|
491
|
-
@@parent_properties = { RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0010') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0012') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0014') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0015') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0025') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0021') => RDF::URI.new('http://www.biointerchange.org/gff3o#
|
491
|
+
@@parent_properties = { RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0010') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0012') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0014') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0015') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0025') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0021') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0023') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0025') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0034') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0035') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0039') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0045') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0044') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0047') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0026') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0050') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0044') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0004') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0005') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0006') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0007') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0008') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0009') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0011') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0013') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0029') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0022') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0027') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0024') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0027') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0032') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0031') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0033') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0031') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0036') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0037') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0041') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0040') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0042') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0040') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0043') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0040') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0046') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0048') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') , RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0049') => RDF::URI.new('http://www.biointerchange.org/gff3o#GFF3_0028') }
|
492
492
|
|
493
493
|
end
|
494
494
|
|
data/lib/biointerchange/gvf1o.rb
CHANGED
@@ -2,10 +2,17 @@ module BioInterchange
|
|
2
2
|
|
3
3
|
class GVF1O
|
4
4
|
|
5
|
-
#
|
6
|
-
#
|
5
|
+
# Either:
|
6
|
+
# Strand of the feature.
|
7
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0010)
|
8
|
+
# Or:
|
9
|
+
# Strand of the breakpoint.
|
10
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0083)
|
11
|
+
# Or:
|
12
|
+
# Strand of a target -- if applicable.
|
13
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0091)
|
7
14
|
def self.strand
|
8
|
-
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0010')
|
15
|
+
return [ RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0010'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0083'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0091') ]
|
9
16
|
end
|
10
17
|
|
11
18
|
# Tag name/value pair attributes of a feature.
|
@@ -32,8 +39,11 @@ class GVF1O
|
|
32
39
|
# Or:
|
33
40
|
# FALDO "Region" instance replacement for a breakpoint's start, stop, strand properties.
|
34
41
|
# (http://www.biointerchange.org/gvf1o#GVF1_0079)
|
42
|
+
# Or:
|
43
|
+
# FALDO "Region" instance replacement for a target's start, stop, strand properties.
|
44
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0090)
|
35
45
|
def self.region
|
36
|
-
return [ RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0021'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0079') ]
|
46
|
+
return [ RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0021'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0079'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0090') ]
|
37
47
|
end
|
38
48
|
|
39
49
|
# NCBI Taxonomy Ontology "NCBITaxon_1" (or sub-classes) instance that denotes the species for a feature set.
|
@@ -54,6 +64,12 @@ class GVF1O
|
|
54
64
|
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0036')
|
55
65
|
end
|
56
66
|
|
67
|
+
# Zygosity of a variant.
|
68
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0038)
|
69
|
+
def self.zygosity
|
70
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0038')
|
71
|
+
end
|
72
|
+
|
57
73
|
# An effect of a particular feature variant.
|
58
74
|
# (http://www.biointerchange.org/gvf1o#GVF1_0041)
|
59
75
|
def self.effect
|
@@ -164,6 +180,22 @@ class GVF1O
|
|
164
180
|
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0078')
|
165
181
|
end
|
166
182
|
|
183
|
+
# Potential source or destination of zero-length sequence alterations.
|
184
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0080)
|
185
|
+
def self.breakpoint
|
186
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0080')
|
187
|
+
end
|
188
|
+
|
189
|
+
# Either:
|
190
|
+
# Properties that are directly associated with Target class instances.
|
191
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0089)
|
192
|
+
# Or:
|
193
|
+
# Properties that are directly associated with Target class instances.
|
194
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0092)
|
195
|
+
def self.target_properties
|
196
|
+
return [ RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0089'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0092') ]
|
197
|
+
end
|
198
|
+
|
167
199
|
# Either:
|
168
200
|
# ID of the landmark that establishes the coordinate system for a feature.
|
169
201
|
# (http://www.biointerchange.org/gvf1o#GVF1_0004)
|
@@ -195,8 +227,11 @@ class GVF1O
|
|
195
227
|
# Or:
|
196
228
|
# Start coordinate of the feature on the seqid landmark.
|
197
229
|
# (http://www.biointerchange.org/gvf1o#GVF1_0073)
|
230
|
+
# Or:
|
231
|
+
# Start coordinate of the target.
|
232
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0094)
|
198
233
|
def self.start
|
199
|
-
return [ RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0007'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0048'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0073') ]
|
234
|
+
return [ RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0007'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0048'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0073'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0094') ]
|
200
235
|
end
|
201
236
|
|
202
237
|
# Either:
|
@@ -208,8 +243,11 @@ class GVF1O
|
|
208
243
|
# Or:
|
209
244
|
# End coordinate of the feature on the seqid landmark.
|
210
245
|
# (http://www.biointerchange.org/gvf1o#GVF1_0074)
|
246
|
+
# Or:
|
247
|
+
# End coordinate of the target.
|
248
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0095)
|
211
249
|
def self.end
|
212
|
-
return [ RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0008'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0049'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0074') ]
|
250
|
+
return [ RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0008'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0049'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0074'), RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0095') ]
|
213
251
|
end
|
214
252
|
|
215
253
|
# Score of the feature. For example, an E-value for sequence similarity features or a P-value for ab initio gene prediction features.
|
@@ -226,7 +264,7 @@ class GVF1O
|
|
226
264
|
|
227
265
|
# Version of the GVF specification that defines the feature set contents.
|
228
266
|
# (http://www.biointerchange.org/gvf1o#GVF1_0022)
|
229
|
-
def self.
|
267
|
+
def self.gvf_version
|
230
268
|
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0022')
|
231
269
|
end
|
232
270
|
|
@@ -284,12 +322,6 @@ class GVF1O
|
|
284
322
|
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0037')
|
285
323
|
end
|
286
324
|
|
287
|
-
# Zygosity of a feature locus.
|
288
|
-
# (http://www.biointerchange.org/gvf1o#GVF1_0038)
|
289
|
-
def self.zygosity
|
290
|
-
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0038')
|
291
|
-
end
|
292
|
-
|
293
325
|
# Frequency of a variant in a population.
|
294
326
|
# (http://www.biointerchange.org/gvf1o#GVF1_0039)
|
295
327
|
def self.variant_freq
|
@@ -350,6 +382,24 @@ class GVF1O
|
|
350
382
|
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0076')
|
351
383
|
end
|
352
384
|
|
385
|
+
# Version of the GFF specification that defines the feature set contents apart from GVF related definitions.
|
386
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0081)
|
387
|
+
def self.gff_version
|
388
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0081')
|
389
|
+
end
|
390
|
+
|
391
|
+
# Creation date of the GVF file that this set stems from.
|
392
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0082)
|
393
|
+
def self.file_date
|
394
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0082')
|
395
|
+
end
|
396
|
+
|
397
|
+
# ID or accession of the target alignment.
|
398
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0093)
|
399
|
+
def self.target_id
|
400
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0093')
|
401
|
+
end
|
402
|
+
|
353
403
|
# Set of genomic sequence features, whose identifiers are unique within the set.
|
354
404
|
# (http://www.biointerchange.org/gvf1o#GVF1_0001)
|
355
405
|
def self.Set
|
@@ -414,6 +464,18 @@ class GVF1O
|
|
414
464
|
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0058')
|
415
465
|
end
|
416
466
|
|
467
|
+
# Denotes the zygosity of alleles.
|
468
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0084)
|
469
|
+
def self.Zygosity
|
470
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0084')
|
471
|
+
end
|
472
|
+
|
473
|
+
# Indicates a feature's "target" of a nucleotide-to-nucleotide or protein-to-nucleotide alignment.
|
474
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0088)
|
475
|
+
def self.Target
|
476
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0088')
|
477
|
+
end
|
478
|
+
|
417
479
|
# Location on the positive (forward) strand.
|
418
480
|
# (http://www.biointerchange.org/gvf1o#GVF1_0017)
|
419
481
|
def self.Positive
|
@@ -438,6 +500,24 @@ class GVF1O
|
|
438
500
|
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0020')
|
439
501
|
end
|
440
502
|
|
503
|
+
# Denotes heterozygous alleles.
|
504
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0085)
|
505
|
+
def self.Heterozygous
|
506
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0085')
|
507
|
+
end
|
508
|
+
|
509
|
+
# Denotes homozygous alleles.
|
510
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0086)
|
511
|
+
def self.Homozygous
|
512
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0086')
|
513
|
+
end
|
514
|
+
|
515
|
+
# Denotes hemizygous alleles.
|
516
|
+
# (http://www.biointerchange.org/gvf1o#GVF1_0087)
|
517
|
+
def self.Hemizygous
|
518
|
+
return RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0087')
|
519
|
+
end
|
520
|
+
|
441
521
|
# Determines whether the given URI is an object property.
|
442
522
|
#
|
443
523
|
# +uri+:: URI that is tested for being an object property
|
@@ -466,6 +546,9 @@ class GVF1O
|
|
466
546
|
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0036') then
|
467
547
|
return true
|
468
548
|
end
|
549
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0038') then
|
550
|
+
return true
|
551
|
+
end
|
469
552
|
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0041') then
|
470
553
|
return true
|
471
554
|
end
|
@@ -514,6 +597,21 @@ class GVF1O
|
|
514
597
|
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0079') then
|
515
598
|
return true
|
516
599
|
end
|
600
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0080') then
|
601
|
+
return true
|
602
|
+
end
|
603
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0083') then
|
604
|
+
return true
|
605
|
+
end
|
606
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0089') then
|
607
|
+
return true
|
608
|
+
end
|
609
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0090') then
|
610
|
+
return true
|
611
|
+
end
|
612
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0091') then
|
613
|
+
return true
|
614
|
+
end
|
517
615
|
return false
|
518
616
|
end
|
519
617
|
|
@@ -572,9 +670,6 @@ class GVF1O
|
|
572
670
|
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0037') then
|
573
671
|
return true
|
574
672
|
end
|
575
|
-
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0038') then
|
576
|
-
return true
|
577
|
-
end
|
578
673
|
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0039') then
|
579
674
|
return true
|
580
675
|
end
|
@@ -638,6 +733,24 @@ class GVF1O
|
|
638
733
|
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0077') then
|
639
734
|
return true
|
640
735
|
end
|
736
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0081') then
|
737
|
+
return true
|
738
|
+
end
|
739
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0082') then
|
740
|
+
return true
|
741
|
+
end
|
742
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0092') then
|
743
|
+
return true
|
744
|
+
end
|
745
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0093') then
|
746
|
+
return true
|
747
|
+
end
|
748
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0094') then
|
749
|
+
return true
|
750
|
+
end
|
751
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0095') then
|
752
|
+
return true
|
753
|
+
end
|
641
754
|
return false
|
642
755
|
end
|
643
756
|
|
@@ -678,6 +791,12 @@ class GVF1O
|
|
678
791
|
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0058') then
|
679
792
|
return true
|
680
793
|
end
|
794
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0084') then
|
795
|
+
return true
|
796
|
+
end
|
797
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0088') then
|
798
|
+
return true
|
799
|
+
end
|
681
800
|
return false
|
682
801
|
end
|
683
802
|
|
@@ -697,6 +816,15 @@ class GVF1O
|
|
697
816
|
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0020') then
|
698
817
|
return true
|
699
818
|
end
|
819
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0085') then
|
820
|
+
return true
|
821
|
+
end
|
822
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0086') then
|
823
|
+
return true
|
824
|
+
end
|
825
|
+
if uri == RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0087') then
|
826
|
+
return true
|
827
|
+
end
|
700
828
|
return false
|
701
829
|
end
|
702
830
|
|
@@ -723,7 +851,7 @@ class GVF1O
|
|
723
851
|
end
|
724
852
|
|
725
853
|
private
|
726
|
-
@@parent_properties = { RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0010') => RDF::URI.new('http://www.biointerchange.org/gvf1o#
|
854
|
+
@@parent_properties = { RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0010') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0066') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0012') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0066') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0014') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0066') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0015') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0068') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0021') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0066') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0023') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0068') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0034') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0066') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0036') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0066') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0038') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0069') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0041') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0069') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0042') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0070') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0043') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0070') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0044') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0070') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0046') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0070') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0047') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0070') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0051') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0067') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0053') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0069') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0078') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0066') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0079') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0075') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0080') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0066') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0083') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0075') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0090') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0089') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0091') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0089') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0004') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0005') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0006') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0007') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0008') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0009') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0013') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0064') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0022') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0063') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0024') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0063') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0025') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0060') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0026') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0027') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0029') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0062') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0030') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0062') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0031') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0032') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0060') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0037') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0065') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0039') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0060') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0048') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0061') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0049') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0061') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0050') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0060') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0054') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0060') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0055') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0056') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0060') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0057') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0072') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0071') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0073') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0071') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0074') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0071') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0076') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0077') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0059') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0081') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0063') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0082') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0063') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0093') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0092') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0094') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0092') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0095') => RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0092') , RDF::URI.new('http://www.biointerchange.org/gvf1o#GVF1_0088') => RDF::URI.new('http://www.w3.org/2002/07/owl#Thing') }
|
727
855
|
|
728
856
|
end
|
729
857
|
|
@@ -0,0 +1,74 @@
|
|
1
|
+
module BioInterchange::TextMining
|
2
|
+
|
3
|
+
class ContentConnection
|
4
|
+
|
5
|
+
# Constants that describe content connection type.
|
6
|
+
UNSPECIFIED = 0
|
7
|
+
EQUIVALENCE = 1
|
8
|
+
SUBCLASS = 2
|
9
|
+
THEME = 3
|
10
|
+
SPECULATION = 4
|
11
|
+
NEGATION = 5
|
12
|
+
|
13
|
+
# Creates a new document content connection representation between specific document content.
|
14
|
+
#
|
15
|
+
# +content1+:: document content 1
|
16
|
+
# +content2+:: document content 2
|
17
|
+
# +type+:: classifaction of the connection between the two document content objects
|
18
|
+
def initialize(content1, content2, type = UNSPECIFIED, process = nil)
|
19
|
+
if content1.nil? and content2.nil?
|
20
|
+
raise BioInterchange::Exceptions::ImplementationModelError, 'Content1 and Content2 can not both be nil'
|
21
|
+
elsif ( (! content1.kind_of?(BioInterchange::TextMining::Content)) && (! content1.kind_of?(BioInterchange::TextMining::ContentConnection)) && (! content1.nil?) )
|
22
|
+
raise BioInterchange::Exceptions::ImplementationModelError, 'Content1 has to be of kind BioInterchange::TextMining::Content or kind BioInterchange::TextMining::ContentConnection'
|
23
|
+
elsif ( (! content2.kind_of?(BioInterchange::TextMining::Content)) && (! content2.kind_of?(BioInterchange::TextMining::ContentConnection)) && (! content2.nil?) )
|
24
|
+
raise BioInterchange::Exceptions::ImplementationModelError, 'Content2 has to be of kind BioInterchange::TextMining::Content or kind BioInterchange::TextMining::ContentConnection'
|
25
|
+
end
|
26
|
+
@content1 = content1
|
27
|
+
@content2 = content2
|
28
|
+
@type = type
|
29
|
+
@process = process
|
30
|
+
end
|
31
|
+
|
32
|
+
# Sets the context of this content.
|
33
|
+
#
|
34
|
+
# +context+:: a +BioInterchange::TextMining::Document+ or +BioInterchange::TextMining::Content+ instance in which this content is enclosed in
|
35
|
+
def setContext(context)
|
36
|
+
@context = context
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns the offset of the content as absolute position within the document.
|
40
|
+
def content1
|
41
|
+
@content1
|
42
|
+
end
|
43
|
+
|
44
|
+
# Returns the length of the content, which is measured in characters.
|
45
|
+
def content2
|
46
|
+
@content2
|
47
|
+
end
|
48
|
+
|
49
|
+
# Returns the type of the content, if known, or +BioInterchange::TextMining::Content::UNSPECIFIED otherwise.
|
50
|
+
def type
|
51
|
+
@type
|
52
|
+
end
|
53
|
+
|
54
|
+
# Returns the process associated with this content, if previously provided, or nil otherwise.
|
55
|
+
def process
|
56
|
+
@process
|
57
|
+
end
|
58
|
+
|
59
|
+
# Returns a URI that identifies this content.
|
60
|
+
def uri
|
61
|
+
raise BioInterchange::Exceptions::ImplementationModelError, 'An URI can only be returned for content with a context (i.e., use setContext(context) first).' unless @context
|
62
|
+
process = '-'
|
63
|
+
c1 = '-'
|
64
|
+
c2 = '-'
|
65
|
+
process = "(#{@process.uri.sub(/^.*?:\/\//, '')})" if @process
|
66
|
+
c1 = "#{@content1.uri.sub(/^.*?:\/\//, '')}" if @content1
|
67
|
+
c2 = "#{@content2.uri.sub(/^.*?:\/\//, '')}" if @content2
|
68
|
+
"biointerchange://textmining/content_connection/#{@context.uri.sub(/^.*?:\/\//, '')}/#{c1},#{c2},#{@type},#{process}"
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|