bel_parser 1.0.0.alpha.47-java → 1.0.0.alpha.48-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/bel_parser/expression/model/namespace.rb +60 -20
- data/lib/bel_parser/expression/model/parameter.rb +30 -36
- data/lib/bel_parser/expression/model/statement.rb +28 -3
- data/lib/bel_parser/expression/model/term.rb +46 -7
- data/lib/bel_parser/expression/parser.rb +15 -3
- data/lib/bel_parser/expression/validator.rb +13 -15
- data/lib/bel_parser/language/apply_namespace_encoding.rb +14 -18
- data/lib/bel_parser/language/expression_validator.rb +398 -23
- data/lib/bel_parser/language/semantics_ast_warnings.rb +1 -1
- data/lib/bel_parser/language/specification.rb +4 -0
- data/lib/bel_parser/language/syntax/undefined_namespace.rb +1 -1
- data/lib/bel_parser/language/syntax/undefined_namespace_value.rb +2 -1
- data/lib/bel_parser/language/version2_0/functions/activity.rb +2 -2
- data/lib/bel_parser/language/version2_0/functions/biological_process.rb +1 -2
- data/lib/bel_parser/language/version2_0/functions/cell_secretion.rb +2 -2
- data/lib/bel_parser/language/version2_0/functions/cell_surface_expression.rb +2 -2
- data/lib/bel_parser/language/version2_0/functions/complex_abundance.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/composite_abundance.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/degradation.rb +2 -2
- data/lib/bel_parser/language/version2_0/functions/fragment.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/from_location.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/fusion.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/micro_rna_abundance.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/molecular_activity.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/protein_modification.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/reaction.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/to_location.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/translocation.rb +1 -1
- data/lib/bel_parser/language/version2_0/functions/variant.rb +1 -1
- data/lib/bel_parser/resource.rb +8 -6
- data/lib/bel_parser/resource/concept_scheme.rb +8 -0
- data/lib/bel_parser/resource/dataset.rb +24 -0
- data/lib/bel_parser/resource/file_resource.rb +8 -0
- data/lib/bel_parser/resource/file_resource_value.rb +1 -0
- data/lib/bel_parser/resource/sparql_reader.rb +3 -1
- data/lib/bel_parser/resource/value.rb +20 -0
- metadata +1 -1
@@ -14,7 +14,8 @@ module BELParser
|
|
14
14
|
return nil unless value_node.is_a?(BELParser::Parsers::AST::Value)
|
15
15
|
return nil unless value_node.namespace
|
16
16
|
|
17
|
-
|
17
|
+
nsv = value_node.namespace_value
|
18
|
+
if nsv.nil? || nsv.encoding.nil?
|
18
19
|
value = value_node.children[0].string_literal
|
19
20
|
UndefinedNamespaceValueWarning.new(value_node, spec, value)
|
20
21
|
end
|
@@ -16,8 +16,8 @@ module BELParser
|
|
16
16
|
LONG = :activity
|
17
17
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::Activity
|
18
18
|
DESCRIPTION = 'Denotes the frequency or abundance of events
|
19
|
-
|
20
|
-
|
19
|
+
in which a member acts as a causal agent at the
|
20
|
+
molecular scale.'.freeze
|
21
21
|
|
22
22
|
def self.short
|
23
23
|
SHORT
|
@@ -15,8 +15,7 @@ module BELParser
|
|
15
15
|
LONG = :biologicalProcess
|
16
16
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::BiologicalProcess
|
17
17
|
B_ENC = Version2_0::ValueEncodings::BiologicalProcess
|
18
|
-
DESCRIPTION = 'Denotes a process or population of
|
19
|
-
vents.'.freeze
|
18
|
+
DESCRIPTION = 'Denotes a process or population of events.'.freeze
|
20
19
|
|
21
20
|
def self.short
|
22
21
|
SHORT
|
@@ -17,8 +17,8 @@ module BELParser
|
|
17
17
|
LONG = :cellSecretion
|
18
18
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::Abundance
|
19
19
|
DESCRIPTION = 'Denotes the frequency or abundance of events
|
20
|
-
|
21
|
-
|
20
|
+
in which members of an abundance move from cells
|
21
|
+
to regions outside of the cells.'.freeze
|
22
22
|
|
23
23
|
def self.short
|
24
24
|
SHORT
|
@@ -17,8 +17,8 @@ module BELParser
|
|
17
17
|
LONG = :cellSurfaceExpression
|
18
18
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::Abundance
|
19
19
|
DESCRIPTION = 'Denotes the frequency or abundance of events in
|
20
|
-
|
21
|
-
|
20
|
+
which members of an abundance move to the surface
|
21
|
+
of cells.'.freeze
|
22
22
|
|
23
23
|
def self.short
|
24
24
|
SHORT
|
@@ -16,7 +16,7 @@ module BELParser
|
|
16
16
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::ComplexAbundance
|
17
17
|
C_ENC = Version2_0::ValueEncodings::ComplexAbundance
|
18
18
|
DESCRIPTION = 'Denotes the abundance of a molecular
|
19
|
-
|
19
|
+
complex.'.freeze
|
20
20
|
|
21
21
|
def self.short
|
22
22
|
SHORT
|
@@ -16,7 +16,7 @@ module BELParser
|
|
16
16
|
LONG = :compositeAbundance
|
17
17
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::Abundance
|
18
18
|
DESCRIPTION = 'Denotes the frequency or abundance of events
|
19
|
-
|
19
|
+
in which members are present.'.freeze
|
20
20
|
|
21
21
|
def self.short
|
22
22
|
SHORT
|
@@ -17,8 +17,8 @@ module BELParser
|
|
17
17
|
LONG = :degradation
|
18
18
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::Abundance
|
19
19
|
DESCRIPTION = 'Denotes the frequency or abundance of events
|
20
|
-
|
21
|
-
|
20
|
+
in which a member is degraded in some way such
|
21
|
+
that it is no longer a member.'.freeze
|
22
22
|
|
23
23
|
def self.short
|
24
24
|
SHORT
|
@@ -16,7 +16,7 @@ module BELParser
|
|
16
16
|
LONG = :fragment
|
17
17
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::Fragment
|
18
18
|
DESCRIPTION = 'Denotes a protein fragment, e.g., a product of
|
19
|
-
|
19
|
+
proteolytic cleavage.'.freeze
|
20
20
|
|
21
21
|
def self.short
|
22
22
|
SHORT
|
@@ -17,7 +17,7 @@ module BELParser
|
|
17
17
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::FromLocation
|
18
18
|
L_ENC = Version2_0::ValueEncodings::Location
|
19
19
|
DESCRIPTION = 'Denotes the from cellular location of the
|
20
|
-
|
20
|
+
abundance.'.freeze
|
21
21
|
|
22
22
|
def self.short
|
23
23
|
SHORT
|
@@ -19,7 +19,7 @@ module BELParser
|
|
19
19
|
P_ENC = Version2_0::ValueEncodings::ProteinAbundance
|
20
20
|
R_ENC = Version2_0::ValueEncodings::RNAAbundance
|
21
21
|
DESCRIPTION = 'Specifies the abundance of a protein translated
|
22
|
-
|
22
|
+
from the fusion of a gene.'.freeze
|
23
23
|
|
24
24
|
def self.short
|
25
25
|
SHORT
|
@@ -17,7 +17,7 @@ module BELParser
|
|
17
17
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::MicroRNAAbundance
|
18
18
|
M_ENC = Version2_0::ValueEncodings::MicroRNAAbundance
|
19
19
|
DESCRIPTION = 'Denotes the abundance of a processed, functional
|
20
|
-
|
20
|
+
microRNA'.freeze
|
21
21
|
|
22
22
|
def self.short
|
23
23
|
SHORT
|
@@ -18,7 +18,7 @@ module BELParser
|
|
18
18
|
T_ENC = Version2_0::ValueEncodings::Activity
|
19
19
|
DESCRIPTION = 'Denotes the frequency or abundance of events
|
20
20
|
n which a member acts as a causal agent at the
|
21
|
-
|
21
|
+
molecular scale'.freeze
|
22
22
|
|
23
23
|
def self.short
|
24
24
|
SHORT
|
@@ -18,7 +18,7 @@ module BELParser
|
|
18
18
|
RETURN_TYPE = Version2_0::ReturnTypes::ProteinModification
|
19
19
|
E_ENC = Version2_0::ValueEncodings::ProteinModification
|
20
20
|
DESCRIPTION = 'Denotes a covalently modified protein
|
21
|
-
|
21
|
+
abundance'.freeze
|
22
22
|
|
23
23
|
def self.short
|
24
24
|
SHORT
|
@@ -16,7 +16,7 @@ module BELParser
|
|
16
16
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::ToLocation
|
17
17
|
L_ENC = Version2_0::ValueEncodings::Location
|
18
18
|
DESCRIPTION = 'Denotes the to cellular location of the
|
19
|
-
|
19
|
+
abundance.'.freeze
|
20
20
|
|
21
21
|
def self.short
|
22
22
|
SHORT
|
@@ -16,7 +16,7 @@ module BELParser
|
|
16
16
|
LONG = :translocation
|
17
17
|
RETURN_TYPE = BELParser::Language::Version2_0::ReturnTypes::Abundance
|
18
18
|
DESCRIPTION = 'Denotes the frequency or abundance of events
|
19
|
-
|
19
|
+
in which members move between locations'.freeze
|
20
20
|
|
21
21
|
def self.short
|
22
22
|
SHORT
|
data/lib/bel_parser/resource.rb
CHANGED
@@ -5,8 +5,7 @@ require_relative 'resource/resource_url_reader'
|
|
5
5
|
module BELParser
|
6
6
|
module Resource
|
7
7
|
|
8
|
-
DEFAULT_SPARQL_ENDPOINT = 'http://
|
9
|
-
#DEFAULT_SPARQL_ENDPOINT = 'http://localhost:3030/identifiers/sparql'
|
8
|
+
DEFAULT_SPARQL_ENDPOINT = 'http://resources.openbel.org/sparql'
|
10
9
|
|
11
10
|
READER_LOCK = Mutex.new
|
12
11
|
private_constant :READER_LOCK
|
@@ -15,27 +14,30 @@ module BELParser
|
|
15
14
|
URISTRING_PATTERN = /^URIString *= *(.*)$/
|
16
15
|
private_constant :URISTRING_PATTERN
|
17
16
|
|
17
|
+
@default_uri_reader = SPARQLReader.new(DEFAULT_SPARQL_ENDPOINT, false)
|
18
|
+
@default_url_reader = ResourceURLReader.new
|
19
|
+
|
18
20
|
def self.default_uri_reader
|
19
21
|
READER_LOCK.synchronize do
|
20
|
-
@default_uri_reader
|
22
|
+
@default_uri_reader
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
26
|
def self.default_uri_reader=(uri_reader)
|
25
27
|
READER_LOCK.synchronize do
|
26
|
-
@default_uri_reader
|
28
|
+
@default_uri_reader = uri_reader
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
30
32
|
def self.default_url_reader
|
31
33
|
READER_LOCK.synchronize do
|
32
|
-
@default_url_reader
|
34
|
+
@default_url_reader
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
36
38
|
def self.default_url_reader=(url_reader)
|
37
39
|
READER_LOCK.synchronize do
|
38
|
-
@default_url_reader
|
40
|
+
@default_url_reader = url_reader
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
@@ -29,6 +29,30 @@ module BELParser
|
|
29
29
|
def types
|
30
30
|
raise NotImplementedError, "#{__method__} is not implemented."
|
31
31
|
end
|
32
|
+
|
33
|
+
def uri?
|
34
|
+
raise NotImplementedError, "#{__method__} is not implemented."
|
35
|
+
end
|
36
|
+
|
37
|
+
def url?
|
38
|
+
raise NotImplementedError, "#{__method__} is not implemented."
|
39
|
+
end
|
40
|
+
|
41
|
+
def <=>(another_dataset)
|
42
|
+
keyword <=> another_dataset.keyword
|
43
|
+
end
|
44
|
+
|
45
|
+
def hash
|
46
|
+
[types, identifier, keyword].hash
|
47
|
+
end
|
48
|
+
|
49
|
+
def ==(another_dataset)
|
50
|
+
return false if another_dataset == nil
|
51
|
+
types == another_dataset.types &&
|
52
|
+
identifier == another_dataset.identifier &&
|
53
|
+
keyword == another_dataset.keyword
|
54
|
+
end
|
55
|
+
alias :eql? :'=='
|
32
56
|
end
|
33
57
|
end
|
34
58
|
end
|
@@ -122,9 +122,11 @@ module BELParser
|
|
122
122
|
where {
|
123
123
|
<<%= uri %>> rdf:type skos:ConceptScheme .
|
124
124
|
<<%= uri %>> rdf:type ?type .
|
125
|
-
<<%= uri %>> belv:domain ?domain .
|
126
125
|
<<%= uri %>> belv:prefix ?prefix .
|
127
126
|
<<%= uri %>> skos:prefLabel ?prefLabel .
|
127
|
+
optional {
|
128
|
+
<<%= uri %>> belv:domain ?domain .
|
129
|
+
}
|
128
130
|
}
|
129
131
|
group by ?domain ?prefix ?prefLabel
|
130
132
|
SPARQL
|
@@ -26,6 +26,26 @@ module BELParser
|
|
26
26
|
def encodings
|
27
27
|
raise NotImplementedError, "#{__method__} is not implemented."
|
28
28
|
end
|
29
|
+
|
30
|
+
def <=>(another_value)
|
31
|
+
name <=> another_value.name
|
32
|
+
end
|
33
|
+
|
34
|
+
def hash
|
35
|
+
[dataset, name, encodings].hash
|
36
|
+
end
|
37
|
+
|
38
|
+
def ==(another_value)
|
39
|
+
return false if another_value == nil
|
40
|
+
dataset == another_value.dataset &&
|
41
|
+
name == another_value.name &&
|
42
|
+
encodings == another_value.encodings
|
43
|
+
end
|
44
|
+
alias :eql? :'=='
|
45
|
+
|
46
|
+
def to_s
|
47
|
+
name
|
48
|
+
end
|
29
49
|
end
|
30
50
|
end
|
31
51
|
end
|