bel_parser 1.0.0.alpha.51-java → 1.0.0.alpha.52-java
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b78b639cb7c7eec3a5faacdfe2ff843b78a1fe7
|
4
|
+
data.tar.gz: 4a618714c2b20209ff175460bbf5bf1187b0b7e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1bb96198f5a6a85124fbdc582553736b3e86bcdead32f596694a62a69c5042803a2efbe2988aa7589ba8864420dc07ede98c64b2a0fba7d76333fa0ebb18ff1
|
7
|
+
data.tar.gz: 81522df31b1d3c28b99e9001d0d1e8bab96b33abfc1482f80f4929a1c3074848850baec687bbb86bbc49d42982ba418bf3829e05cc277cd0d222cb977f79f7e7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.alpha.
|
1
|
+
1.0.0.alpha.52
|
data/bin/bel_script_reader
CHANGED
@@ -79,9 +79,8 @@ url_reader = options[:url_reader]
|
|
79
79
|
|
80
80
|
namespaces = Hash[
|
81
81
|
ARGV.map do |ns|
|
82
|
-
|
83
|
-
|
84
|
-
dataset ? [prefix, dataset] : nil
|
82
|
+
keyword, identifier = ns.split('=')
|
83
|
+
[keyword, BELParser::Expression::Model::Namespace.new(keyword, identifier, nil)]
|
85
84
|
end.compact
|
86
85
|
]
|
87
86
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'bel_parser/language'
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require 'concurrent/hash'
|
3
|
+
require 'bel_parser/parsers/ast/node'
|
4
|
+
require 'bel_parser/expression/model/namespace'
|
4
5
|
require_relative '../state_function'
|
5
6
|
require_relative '../apply_resource_uri'
|
6
7
|
|
@@ -18,25 +19,37 @@ module BELParser
|
|
18
19
|
url_reader = script_context[:url_reader]
|
19
20
|
|
20
21
|
keyword, domain = ast_node.children
|
21
|
-
|
22
|
+
keyword_s = keyword.identifier.string_literal
|
22
23
|
|
23
24
|
case
|
24
25
|
when domain.uri?
|
25
26
|
uri = domain.child.string.string_literal
|
26
27
|
dataset = uri_reader.retrieve_resource(uri)
|
27
28
|
script_context[:namespace_definitions] ||= Concurrent::Hash.new
|
28
|
-
script_context[:namespace_definitions][
|
29
|
+
script_context[:namespace_definitions][keyword_s] =
|
30
|
+
BELParser::Expression::Model::Namespace.new(
|
31
|
+
keyword_s,
|
32
|
+
uri,
|
33
|
+
nil)
|
29
34
|
when domain.url?
|
30
35
|
ApplyResourceURI.new.process(ast_node)
|
31
36
|
if ast_node.uri
|
32
37
|
dataset = uri_reader.retrieve_resource(ast_node.uri)
|
33
38
|
script_context[:namespace_definitions] ||= Concurrent::Hash.new
|
34
|
-
script_context[:namespace_definitions][
|
39
|
+
script_context[:namespace_definitions][keyword_s] =
|
40
|
+
BELParser::Expression::Model::Namespace.new(
|
41
|
+
keyword_s,
|
42
|
+
ast_node.uri,
|
43
|
+
domain.child.string.string_literal)
|
35
44
|
else
|
36
45
|
url = domain.child.string.string_literal
|
37
46
|
dataset = url_reader.retrieve_resource(url)
|
38
47
|
script_context[:namespace_definitions] ||= Concurrent::Hash.new
|
39
|
-
script_context[:namespace_definitions][
|
48
|
+
script_context[:namespace_definitions][keyword_s] =
|
49
|
+
BELParser::Expression::Model::Namespace.new(
|
50
|
+
keyword_s,
|
51
|
+
nil,
|
52
|
+
url)
|
40
53
|
end
|
41
54
|
end
|
42
55
|
end
|
@@ -23,7 +23,7 @@ module BELParser
|
|
23
23
|
return nil unless script_context.key?(:specification)
|
24
24
|
|
25
25
|
validator = expression_validator(script_context)
|
26
|
-
validator.validate(ast_node)
|
26
|
+
validator.validate(ast_node)
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.expression_validator(script_context)
|