bel_parser 1.0.0.alpha.12 → 1.0.0.alpha.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.gemspec +1 -1
  3. data/VERSION +1 -1
  4. data/bin/bel2_validator +35 -8
  5. data/lib/bel_parser/expression/validator.rb +3 -2
  6. data/lib/bel_parser/language/apply_namespace_encoding.rb +96 -0
  7. data/lib/bel_parser/language/base_specification.rb +82 -0
  8. data/lib/bel_parser/language/expression_validator.rb +6 -2
  9. data/lib/bel_parser/language/relationship.rb +1 -1
  10. data/lib/bel_parser/language/semantics/signature_mapping.rb +26 -32
  11. data/lib/bel_parser/language/semantics_ast.rb +285 -149
  12. data/lib/bel_parser/language/semantics_ast_warnings.rb +180 -0
  13. data/lib/bel_parser/language/semantics_result.rb +11 -2
  14. data/lib/bel_parser/language/semantics_type_warning.rb +22 -0
  15. data/lib/bel_parser/language/semantics_warning.rb +8 -0
  16. data/lib/bel_parser/language/specification.rb +38 -55
  17. data/lib/bel_parser/language/syntax/undefined_namespace_value.rb +43 -0
  18. data/lib/bel_parser/language/syntax_error.rb +8 -0
  19. data/lib/bel_parser/language/syntax_result.rb +8 -0
  20. data/lib/bel_parser/language/syntax_warning.rb +9 -4
  21. data/lib/bel_parser/language/version1_0/functions/abundance.rb +5 -6
  22. data/lib/bel_parser/language/version1_0/functions/biological_process.rb +5 -6
  23. data/lib/bel_parser/language/version1_0/functions/complex_abundance.rb +6 -7
  24. data/lib/bel_parser/language/version1_0/functions/fusion.rb +39 -60
  25. data/lib/bel_parser/language/version1_0/functions/gene_abundance.rb +9 -12
  26. data/lib/bel_parser/language/version1_0/functions/list.rb +5 -6
  27. data/lib/bel_parser/language/version1_0/functions/micro_rna_abundance.rb +5 -6
  28. data/lib/bel_parser/language/version1_0/functions/pathology.rb +5 -6
  29. data/lib/bel_parser/language/version1_0/functions/protein_abundance.rb +16 -30
  30. data/lib/bel_parser/language/version1_0/functions/protein_modification.rb +15 -27
  31. data/lib/bel_parser/language/version1_0/functions/rna_abundance.rb +8 -11
  32. data/lib/bel_parser/language/version1_0/functions/substitution.rb +6 -12
  33. data/lib/bel_parser/language/version1_0/functions/translocation.rb +9 -12
  34. data/lib/bel_parser/language/version1_0/functions/truncation.rb +2 -4
  35. data/lib/bel_parser/language/version1_0/value_encodings/abundance.rb +21 -0
  36. data/lib/bel_parser/language/version1_0/value_encodings/any.rb +74 -0
  37. data/lib/bel_parser/language/version1_0/value_encodings/biological_process.rb +21 -0
  38. data/lib/bel_parser/language/version1_0/value_encodings/complex_abundance.rb +21 -0
  39. data/lib/bel_parser/language/version1_0/value_encodings/gene_abundance.rb +21 -0
  40. data/lib/bel_parser/language/version1_0/value_encodings/micro_rna_abundance.rb +21 -0
  41. data/lib/bel_parser/language/version1_0/value_encodings/pathology.rb +21 -0
  42. data/lib/bel_parser/language/version1_0/value_encodings/protein_abundance.rb +21 -0
  43. data/lib/bel_parser/language/version1_0/value_encodings/rna_abundance.rb +21 -0
  44. data/lib/bel_parser/language/version1_0.rb +6 -87
  45. data/lib/bel_parser/language/version2_0/functions/abundance.rb +13 -18
  46. data/lib/bel_parser/language/version2_0/functions/biological_process.rb +5 -6
  47. data/lib/bel_parser/language/version2_0/functions/complex_abundance.rb +9 -12
  48. data/lib/bel_parser/language/version2_0/functions/fragment.rb +4 -9
  49. data/lib/bel_parser/language/version2_0/functions/from_location.rb +5 -6
  50. data/lib/bel_parser/language/version2_0/functions/fusion.rb +39 -66
  51. data/lib/bel_parser/language/version2_0/functions/gene_abundance.rb +13 -18
  52. data/lib/bel_parser/language/version2_0/functions/list.rb +5 -6
  53. data/lib/bel_parser/language/version2_0/functions/location.rb +5 -6
  54. data/lib/bel_parser/language/version2_0/functions/micro_rna_abundance.rb +13 -18
  55. data/lib/bel_parser/language/version2_0/functions/molecular_activity.rb +6 -5
  56. data/lib/bel_parser/language/version2_0/functions/pathology.rb +5 -6
  57. data/lib/bel_parser/language/version2_0/functions/protein_abundance.rb +21 -30
  58. data/lib/bel_parser/language/version2_0/functions/protein_modification.rb +11 -17
  59. data/lib/bel_parser/language/version2_0/functions/rna_abundance.rb +13 -18
  60. data/lib/bel_parser/language/version2_0/functions/to_location.rb +5 -6
  61. data/lib/bel_parser/language/version2_0/functions/variant.rb +1 -4
  62. data/lib/bel_parser/language/version2_0/value_encodings/abundance.rb +21 -0
  63. data/lib/bel_parser/language/version2_0/value_encodings/activity.rb +21 -0
  64. data/lib/bel_parser/language/version2_0/value_encodings/any.rb +74 -0
  65. data/lib/bel_parser/language/version2_0/value_encodings/biological_process.rb +21 -0
  66. data/lib/bel_parser/language/version2_0/value_encodings/complex_abundance.rb +21 -0
  67. data/lib/bel_parser/language/version2_0/value_encodings/gene_abundance.rb +21 -0
  68. data/lib/bel_parser/language/version2_0/value_encodings/location.rb +21 -0
  69. data/lib/bel_parser/language/version2_0/value_encodings/micro_rna_abundance.rb +21 -0
  70. data/lib/bel_parser/language/version2_0/value_encodings/pathology.rb +21 -0
  71. data/lib/bel_parser/language/version2_0/value_encodings/protein_abundance.rb +21 -0
  72. data/lib/bel_parser/language/version2_0/value_encodings/protein_modification.rb +21 -0
  73. data/lib/bel_parser/language/version2_0/value_encodings/rna_abundance.rb +21 -0
  74. data/lib/bel_parser/language/version2_0.rb +6 -60
  75. data/lib/bel_parser/language.rb +3 -4
  76. data/lib/bel_parser/parsers/ast/node.rb +14 -2
  77. data/lib/bel_parser/{language/quoting.rb → quoting.rb} +0 -56
  78. data/lib/bel_parser/resource/concept.rb +56 -0
  79. data/lib/bel_parser/resource/concept_scheme.rb +35 -0
  80. data/lib/bel_parser/resource/dataset.rb +34 -0
  81. data/lib/bel_parser/resource/eager_reader.rb +75 -0
  82. data/lib/bel_parser/resource/eager_sparql_reader.rb +51 -0
  83. data/lib/bel_parser/resource/http_cache.rb +71 -0
  84. data/lib/bel_parser/resource/jena_tdb_reader.rb +246 -0
  85. data/lib/bel_parser/resource/lru_cache.rb +111 -0
  86. data/lib/bel_parser/resource/lru_reader.rb +38 -0
  87. data/lib/bel_parser/resource/reader.rb +18 -0
  88. data/lib/bel_parser/resource/resource_file_reader.rb +134 -0
  89. data/lib/bel_parser/resource/sparql_reader.rb +178 -0
  90. data/lib/bel_parser/resource/value.rb +31 -0
  91. metadata +42 -4
  92. data/lib/bel_parser/language/version1_0/syntax/function.rb +0 -28
@@ -15,6 +15,9 @@ module BELParser
15
15
  SHORT = :fus
16
16
  LONG = :fusion
17
17
  RETURN_TYPE = BELParser::Language::Version1_0::ReturnTypes::Fusion
18
+ G_ENC = Version1_0::ValueEncodings::GeneAbundance
19
+ P_ENC = Version1_0::ValueEncodings::ProteinAbundance
20
+ R_ENC = Version1_0::ValueEncodings::RNAAbundance
18
21
  DESCRIPTION = 'Specifies the abundance of a protein translated
19
22
  rom the fusion of a gene'.freeze
20
23
 
@@ -53,27 +56,21 @@ module BELParser
53
56
  argument(
54
57
  parameter(
55
58
  prefix(
56
- identifier(
57
- has_namespace,
58
- namespace_of(:*))),
59
+ has_namespace,
60
+ namespace_of(:*)),
59
61
  value(
60
- value_type(
61
- has_encoding,
62
- encoding_of(:GeneAbundance))))),
62
+ has_encoding,
63
+ encoding_of(G_ENC)))),
63
64
  argument(
64
65
  parameter(
65
- prefix(
66
- any),
66
+ prefix(any),
67
67
  value(
68
- value_type(
69
- is_sequence_position)))),
68
+ is_sequence_position))),
70
69
  argument(
71
70
  parameter(
72
- prefix(
73
- any),
71
+ prefix(any),
74
72
  value(
75
- value_type(
76
- is_sequence_position)))))
73
+ is_sequence_position))))
77
74
  end
78
75
  private_constant :AST
79
76
 
@@ -103,13 +100,11 @@ module BELParser
103
100
  argument(
104
101
  parameter(
105
102
  prefix(
106
- identifier(
107
- has_namespace,
108
- namespace_of(:*))),
103
+ has_namespace,
104
+ namespace_of(:*)),
109
105
  value(
110
- value_type(
111
- has_encoding,
112
- encoding_of(:GeneAbundance))))))
106
+ has_encoding,
107
+ encoding_of(G_ENC)))))
113
108
  end
114
109
  private_constant :AST
115
110
 
@@ -139,27 +134,21 @@ module BELParser
139
134
  argument(
140
135
  parameter(
141
136
  prefix(
142
- identifier(
143
- has_namespace,
144
- namespace_of(:*))),
137
+ has_namespace,
138
+ namespace_of(:*)),
145
139
  value(
146
- value_type(
147
- has_encoding,
148
- encoding_of(:ProteinAbundance))))),
140
+ has_encoding,
141
+ encoding_of(P_ENC)))),
149
142
  argument(
150
143
  parameter(
151
- prefix(
152
- any),
144
+ prefix(any),
153
145
  value(
154
- value_type(
155
- is_sequence_position)))),
146
+ is_sequence_position))),
156
147
  argument(
157
148
  parameter(
158
- prefix(
159
- any),
149
+ prefix(any),
160
150
  value(
161
- value_type(
162
- is_sequence_position)))))
151
+ is_sequence_position))))
163
152
  end
164
153
  private_constant :AST
165
154
 
@@ -189,13 +178,11 @@ module BELParser
189
178
  argument(
190
179
  parameter(
191
180
  prefix(
192
- identifier(
193
- has_namespace,
194
- namespace_of(:*))),
181
+ has_namespace,
182
+ namespace_of(:*)),
195
183
  value(
196
- value_type(
197
- has_encoding,
198
- encoding_of(:ProteinAbundance))))))
184
+ has_encoding,
185
+ encoding_of(P_ENC)))))
199
186
  end
200
187
  private_constant :AST
201
188
 
@@ -225,27 +212,21 @@ module BELParser
225
212
  argument(
226
213
  parameter(
227
214
  prefix(
228
- identifier(
229
- has_namespace,
230
- namespace_of(:*))),
215
+ has_namespace,
216
+ namespace_of(:*)),
231
217
  value(
232
- value_type(
233
- has_encoding,
234
- encoding_of(:RnaAbundance))))),
218
+ has_encoding,
219
+ encoding_of(R_ENC)))),
235
220
  argument(
236
221
  parameter(
237
- prefix(
238
- any),
222
+ prefix(any),
239
223
  value(
240
- value_type(
241
- is_sequence_position)))),
224
+ is_sequence_position))),
242
225
  argument(
243
226
  parameter(
244
- prefix(
245
- any),
227
+ prefix(any),
246
228
  value(
247
- value_type(
248
- is_sequence_position)))))
229
+ is_sequence_position))))
249
230
  end
250
231
  private_constant :AST
251
232
 
@@ -275,13 +256,11 @@ module BELParser
275
256
  argument(
276
257
  parameter(
277
258
  prefix(
278
- identifier(
279
- has_namespace,
280
- namespace_of(:*))),
259
+ has_namespace,
260
+ namespace_of(:*)),
281
261
  value(
282
- value_type(
283
- has_encoding,
284
- encoding_of(:RnaAbundance))))))
262
+ has_encoding,
263
+ encoding_of(R_ENC)))))
285
264
  end
286
265
  private_constant :AST
287
266
 
@@ -14,6 +14,7 @@ module BELParser
14
14
  SHORT = :g
15
15
  LONG = :geneAbundance
16
16
  RETURN_TYPE = BELParser::Language::Version1_0::ReturnTypes::GeneAbundance
17
+ G_ENC = Version1_0::ValueEncodings::GeneAbundance
17
18
  DESCRIPTION = 'Denotes the abundance of a gene'.freeze
18
19
 
19
20
  def self.short
@@ -51,13 +52,11 @@ module BELParser
51
52
  argument(
52
53
  parameter(
53
54
  prefix(
54
- identifier(
55
- has_namespace,
56
- namespace_of(:*))),
55
+ has_namespace,
56
+ namespace_of(:*)),
57
57
  value(
58
- value_type(
59
- has_encoding,
60
- encoding_of(:GeneAbundance))))),
58
+ has_encoding,
59
+ encoding_of(G_ENC)))),
61
60
  argument(
62
61
  term(
63
62
  function(
@@ -92,13 +91,11 @@ module BELParser
92
91
  argument(
93
92
  parameter(
94
93
  prefix(
95
- identifier(
96
- has_namespace,
97
- namespace_of(:*))),
94
+ has_namespace,
95
+ namespace_of(:*)),
98
96
  value(
99
- value_type(
100
- has_encoding,
101
- encoding_of(:GeneAbundance))))))
97
+ has_encoding,
98
+ encoding_of(G_ENC)))))
102
99
  end
103
100
  private_constant :AST
104
101
 
@@ -14,6 +14,7 @@ module BELParser
14
14
  SHORT = :list
15
15
  LONG = :list
16
16
  RETURN_TYPE = BELParser::Language::Version1_0::ReturnTypes::List
17
+ A_ENC = Version1_0::ValueEncodings::Abundance
17
18
  DESCRIPTION = 'Groups a list of terms together'.freeze
18
19
 
19
20
  def self.short
@@ -51,13 +52,11 @@ module BELParser
51
52
  argument(
52
53
  parameter(
53
54
  prefix(
54
- identifier(
55
- has_namespace,
56
- namespace_of(:*))),
55
+ has_namespace,
56
+ namespace_of(:*)),
57
57
  value(
58
- value_type(
59
- has_encoding,
60
- encoding_of(:Abundance))))))
58
+ has_encoding,
59
+ encoding_of(A_ENC)))))
61
60
  end
62
61
  private_constant :AST
63
62
 
@@ -15,6 +15,7 @@ module BELParser
15
15
  SHORT = :m
16
16
  LONG = :microRNAAbundance
17
17
  RETURN_TYPE = BELParser::Language::Version1_0::ReturnTypes::MicroRNAAbundance
18
+ M_ENC = Version1_0::ValueEncodings::MicroRNAAbundance
18
19
  DESCRIPTION = 'Denotes the abundance of a processed, functional
19
20
  icroRNA'.freeze
20
21
 
@@ -53,13 +54,11 @@ module BELParser
53
54
  argument(
54
55
  parameter(
55
56
  prefix(
56
- identifier(
57
- has_namespace,
58
- namespace_of(:*))),
57
+ has_namespace,
58
+ namespace_of(:*)),
59
59
  value(
60
- value_type(
61
- has_encoding,
62
- encoding_of(:MicroRNAAbundance))))))
60
+ has_encoding,
61
+ encoding_of(M_ENC)))))
63
62
  end
64
63
  private_constant :AST
65
64
 
@@ -14,6 +14,7 @@ module BELParser
14
14
  SHORT = :path
15
15
  LONG = :pathology
16
16
  RETURN_TYPE = BELParser::Language::Version1_0::ReturnTypes::Pathology
17
+ O_ENC = Version1_0::ValueEncodings::Pathology
17
18
  DESCRIPTION = 'Denotes a disease or pathology process'.freeze
18
19
 
19
20
  def self.short
@@ -51,13 +52,11 @@ module BELParser
51
52
  argument(
52
53
  parameter(
53
54
  prefix(
54
- identifier(
55
- has_namespace,
56
- namespace_of(:*))),
55
+ has_namespace,
56
+ namespace_of(:*)),
57
57
  value(
58
- value_type(
59
- has_encoding,
60
- encoding_of(:Pathology))))))
58
+ has_encoding,
59
+ encoding_of(O_ENC)))))
61
60
  end
62
61
  private_constant :AST
63
62
 
@@ -14,6 +14,7 @@ module BELParser
14
14
  SHORT = :p
15
15
  LONG = :proteinAbundance
16
16
  RETURN_TYPE = BELParser::Language::Version1_0::ReturnTypes::ProteinAbundance
17
+ PROTEIN_ENC = BELParser::Language::Version1_0::ValueEncodings::ProteinAbundance
17
18
  DESCRIPTION = 'Denotes the abundance of a protein'.freeze
18
19
 
19
20
  def self.short
@@ -51,13 +52,10 @@ module BELParser
51
52
  argument(
52
53
  parameter(
53
54
  prefix(
54
- identifier(
55
- has_namespace,
56
- namespace_of(:*))),
55
+ has_namespace),
57
56
  value(
58
- value_type(
59
- has_encoding,
60
- encoding_of(:ProteinAbundance))))),
57
+ has_encoding,
58
+ encoding_of(PROTEIN_ENC)))),
61
59
  argument(
62
60
  term(
63
61
  function(
@@ -92,13 +90,10 @@ module BELParser
92
90
  argument(
93
91
  parameter(
94
92
  prefix(
95
- identifier(
96
- has_namespace,
97
- namespace_of(:*))),
93
+ has_namespace),
98
94
  value(
99
- value_type(
100
- has_encoding,
101
- encoding_of(:ProteinAbundance))))),
95
+ has_encoding,
96
+ encoding_of(PROTEIN_ENC)))),
102
97
  argument(
103
98
  term(
104
99
  function(
@@ -133,13 +128,10 @@ module BELParser
133
128
  argument(
134
129
  parameter(
135
130
  prefix(
136
- identifier(
137
- has_namespace,
138
- namespace_of(:*))),
131
+ has_namespace),
139
132
  value(
140
- value_type(
141
- has_encoding,
142
- encoding_of(:ProteinAbundance))))),
133
+ has_encoding,
134
+ encoding_of(PROTEIN_ENC)))),
143
135
  argument(
144
136
  term(
145
137
  function(
@@ -174,13 +166,10 @@ module BELParser
174
166
  argument(
175
167
  parameter(
176
168
  prefix(
177
- identifier(
178
- has_namespace,
179
- namespace_of(:*))),
169
+ has_namespace),
180
170
  value(
181
- value_type(
182
- has_encoding,
183
- encoding_of(:ProteinAbundance))))),
171
+ has_encoding,
172
+ encoding_of(PROTEIN_ENC)))),
184
173
  argument(
185
174
  term(
186
175
  function(
@@ -215,13 +204,10 @@ module BELParser
215
204
  argument(
216
205
  parameter(
217
206
  prefix(
218
- identifier(
219
- has_namespace,
220
- namespace_of(:*))),
207
+ has_namespace),
221
208
  value(
222
- value_type(
223
- has_encoding,
224
- encoding_of(:ProteinAbundance))))))
209
+ has_encoding,
210
+ encoding_of(PROTEIN_ENC)))))
225
211
  end
226
212
  private_constant :AST
227
213
 
@@ -55,26 +55,20 @@ module BELParser
55
55
  function_of(ProteinModification))),
56
56
  argument(
57
57
  parameter(
58
- prefix(
59
- any),
58
+ prefix(any),
60
59
  value(
61
- value_type(
62
- covalent_protein_modification_of(
63
- *CovalentProteinModification.values))))),
60
+ covalent_protein_modification_of(
61
+ *CovalentProteinModification.values)))),
64
62
  argument(
65
63
  parameter(
66
- prefix(
67
- any),
64
+ prefix(any),
68
65
  value(
69
- value_type(
70
- amino_acid_of(*AminoAcid.values))))),
66
+ amino_acid_of(*AminoAcid.values)))),
71
67
  argument(
72
68
  parameter(
73
- prefix(
74
- any),
69
+ prefix(any),
75
70
  value(
76
- value_type(
77
- is_sequence_position)))))
71
+ is_sequence_position))))
78
72
  end
79
73
  private_constant :AST
80
74
 
@@ -109,19 +103,15 @@ module BELParser
109
103
  function_of(ProteinModification))),
110
104
  argument(
111
105
  parameter(
112
- prefix(
113
- any),
106
+ prefix(any),
114
107
  value(
115
- value_type(
116
- covalent_protein_modification_of(
117
- *CovalentProteinModification.values))))),
108
+ covalent_protein_modification_of(
109
+ *CovalentProteinModification.values)))),
118
110
  argument(
119
111
  parameter(
120
- prefix(
121
- any),
112
+ prefix(any),
122
113
  value(
123
- value_type(
124
- amino_acid_of(*AminoAcid.values))))))
114
+ amino_acid_of(*AminoAcid.values)))))
125
115
  end
126
116
  private_constant :AST
127
117
 
@@ -155,12 +145,10 @@ module BELParser
155
145
  function_of(ProteinModification))),
156
146
  argument(
157
147
  parameter(
158
- prefix(
159
- any),
148
+ prefix(any),
160
149
  value(
161
- value_type(
162
- covalent_protein_modification_of(
163
- *CovalentProteinModification.values))))))
150
+ covalent_protein_modification_of(
151
+ *CovalentProteinModification.values)))))
164
152
  end
165
153
  private_constant :AST
166
154
 
@@ -14,6 +14,7 @@ module BELParser
14
14
  SHORT = :r
15
15
  LONG = :rnaAbundance
16
16
  RETURN_TYPE = BELParser::Language::Version1_0::ReturnTypes::GeneAbundance
17
+ R_ENC = Version1_0::ReturnTypes::GeneAbundance
17
18
  DESCRIPTION = 'Denotes the abundance of a gene'.freeze
18
19
 
19
20
  def self.short
@@ -51,13 +52,11 @@ module BELParser
51
52
  argument(
52
53
  parameter(
53
54
  prefix(
54
- identifier(
55
- has_namespace,
56
- namespace_of(:*))),
55
+ has_namespace,
56
+ namespace_of(:*)),
57
57
  value(
58
- value_type(
59
58
  has_encoding,
60
- encoding_of(:RnaAbundance))))),
59
+ encoding_of(R_ENC)))),
61
60
  argument(
62
61
  term(
63
62
  function(
@@ -92,13 +91,11 @@ module BELParser
92
91
  argument(
93
92
  parameter(
94
93
  prefix(
95
- identifier(
96
- has_namespace,
97
- namespace_of(:*))),
94
+ has_namespace,
95
+ namespace_of(:*)),
98
96
  value(
99
- value_type(
100
- has_encoding,
101
- encoding_of(:RnaAbundance))))))
97
+ has_encoding,
98
+ encoding_of(R_ENC)))))
102
99
  end
103
100
  private_constant :AST
104
101
 
@@ -52,25 +52,19 @@ module BELParser
52
52
  function_of(Substitution))),
53
53
  argument(
54
54
  parameter(
55
- prefix(
56
- any),
55
+ prefix(any),
57
56
  value(
58
- value_type(
59
- amino_acid_of(*AminoAcid.values))))),
57
+ amino_acid_of(*AminoAcid.values)))),
60
58
  argument(
61
59
  parameter(
62
- prefix(
63
- any),
60
+ prefix(any),
64
61
  value(
65
- value_type(
66
- is_sequence_position)))),
62
+ is_sequence_position))),
67
63
  argument(
68
64
  parameter(
69
- prefix(
70
- any),
65
+ prefix(any),
71
66
  value(
72
- value_type(
73
- amino_acid_of(*AminoAcid.values))))))
67
+ amino_acid_of(*AminoAcid.values)))))
74
68
  end
75
69
  private_constant :AST
76
70
 
@@ -15,6 +15,7 @@ module BELParser
15
15
  SHORT = :tloc
16
16
  LONG = :translocation
17
17
  RETURN_TYPE = BELParser::Language::Version1_0::ReturnTypes::Abundance
18
+ A_ENC = Version1_0::ValueEncodings::Abundance
18
19
  DESCRIPTION = 'Denotes the frequency or abundance of events
19
20
  n which members move between locations'.freeze
20
21
 
@@ -58,23 +59,19 @@ module BELParser
58
59
  argument(
59
60
  parameter(
60
61
  prefix(
61
- identifier(
62
- has_namespace,
63
- namespace_of(:*))),
62
+ has_namespace,
63
+ namespace_of(:*)),
64
64
  value(
65
- value_type(
66
- has_encoding,
67
- encoding_of(:Abundance))))),
65
+ has_encoding,
66
+ encoding_of(A_ENC)))),
68
67
  argument(
69
68
  parameter(
70
69
  prefix(
71
- identifier(
72
- has_namespace,
73
- namespace_of(:*))),
70
+ has_namespace,
71
+ namespace_of(:*)),
74
72
  value(
75
- value_type(
76
- has_encoding,
77
- encoding_of(:Abundance))))))
73
+ has_encoding,
74
+ encoding_of(A_ENC)))))
78
75
  end
79
76
  private_constant :AST
80
77
 
@@ -52,11 +52,9 @@ module BELParser
52
52
  function_of(Truncation))),
53
53
  argument(
54
54
  parameter(
55
- prefix(
56
- any),
55
+ prefix(any),
57
56
  value(
58
- value_type(
59
- is_sequence_position)))))
57
+ is_sequence_position))))
60
58
  end
61
59
  private_constant :AST
62
60
 
@@ -0,0 +1,21 @@
1
+ require_relative '../../version1_0'
2
+ require_relative 'any'
3
+
4
+ module BELParser
5
+ module Language
6
+ module Version1_0
7
+ module ValueEncodings
8
+ # Abundance value encoding.
9
+ class Abundance < Any
10
+ # Return the {Symbol} value.
11
+ #
12
+ # @note This method should be overridden in subclasses.
13
+ def self.to_sym
14
+ raise_not_implemented(__method__) if self != Abundance
15
+ :A
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end