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: ac73988228b7a8ad17fc167a1538beea9fdd6267
4
- data.tar.gz: f9f27782b9791b99d315465363f3608a0c6016d1
3
+ metadata.gz: 0b78b639cb7c7eec3a5faacdfe2ff843b78a1fe7
4
+ data.tar.gz: 4a618714c2b20209ff175460bbf5bf1187b0b7e2
5
5
  SHA512:
6
- metadata.gz: d28a74c92a301cddd0910bd7ae8b2348ccb74a1066c78ec1c5b0f5744ceb3f090e9230ecb9ba271e2db45b6a3bf9db9155a24fb08264a46e626d6b7a9ebfc4bf
7
- data.tar.gz: 59f3d31887b6a7b36e5e5016db68596917933bcc79055777c48d8fb680873f08c658cc1d2c33196316b02b7ec4c7e15b4b83f3e568840bfcc934a0d7ef69ed53
6
+ metadata.gz: a1bb96198f5a6a85124fbdc582553736b3e86bcdead32f596694a62a69c5042803a2efbe2988aa7589ba8864420dc07ede98c64b2a0fba7d76333fa0ebb18ff1
7
+ data.tar.gz: 81522df31b1d3c28b99e9001d0d1e8bab96b33abfc1482f80f4929a1c3074848850baec687bbb86bbc49d42982ba418bf3829e05cc277cd0d222cb977f79f7e7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0.alpha.51
1
+ 1.0.0.alpha.52
@@ -79,9 +79,8 @@ url_reader = options[:url_reader]
79
79
 
80
80
  namespaces = Hash[
81
81
  ARGV.map do |ns|
82
- prefix, identifier = ns.split('=')
83
- dataset = uri_reader.retrieve_resource(identifier)
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
 
@@ -12,7 +12,7 @@ module BELParser
12
12
  extend Keyword
13
13
 
14
14
  TARGET_NODE = BELParser::Parsers::AST::DocumentProperty
15
- DEFAULT_BEL_VERSION = '2.0'
15
+ DEFAULT_BEL_VERSION = '1.0'
16
16
 
17
17
  def self.consume(ast_node, script_context)
18
18
  return unless ast_node.is_a?(TARGET_NODE)
@@ -1,6 +1,7 @@
1
1
  require 'bel_parser/language'
2
- require 'bel_parser/parsers/ast/node'
3
- require 'concurrent/hash'
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
- prefix = keyword.identifier.string_literal
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][prefix] = [:uri, dataset]
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][prefix] = [:uri, dataset]
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][prefix] = [:url, dataset]
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).select(&:failure?)
26
+ validator.validate(ast_node)
27
27
  end
28
28
 
29
29
  def self.expression_validator(script_context)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bel_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.51
4
+ version: 1.0.0.alpha.52
5
5
  platform: java
6
6
  authors:
7
7
  - Anthony Bargnesi