bel_parser 1.0.0.alpha.34-java → 1.0.0.alpha.35-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: 996f6947dea38645e71e33efaebcead06ee5bab2
4
- data.tar.gz: 09735f4b89e359c1a9c1a1b6e3d8b064ac451e33
3
+ metadata.gz: 1bee9bb5548e37c4791fb17862924577964a6aba
4
+ data.tar.gz: a101322192c6e9d5a9d540282a48809b2797c058
5
5
  SHA512:
6
- metadata.gz: 41199f5fed91e227ad6d61d7b1b1d5d45cba45ee1b7424766e69f720510a1af09162898e96ed5be1d38f53c3befc0ba738491adcc4b9002d7319b0709e3b08ce
7
- data.tar.gz: ef610f25771dcc034027b84099f40e0470b7529d858d068db7347864a93b58bc14aaca118e873a998c5b9eba83c8bff86fa175689b0476d24519bdf81cfd9716
6
+ metadata.gz: 85bae47ad26722aa889ea30cc4cdced771a8a875e49df767bd7109bd79f909b72e7ee003539fe01a63ed8040fc4b85c66b717f3935419b5dd7f6fcff8752c68f
7
+ data.tar.gz: e24ffb234ed915b63b8d02c20ea417da6fc8a250ab602b52817bc37c793073ba307dac61880737125c50075f5f9e888ff084875e504f86e6794b9b3e737abfb5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0.alpha.34
1
+ 1.0.0.alpha.35
@@ -24,9 +24,7 @@ module BEL::Translator::Plugins
24
24
  Validator.new(
25
25
  StateAggregator.new(
26
26
  FirstNode.new(Filter.new(BELParser::ASTGenerator.new(@io))),
27
- @state)),
28
- true,
29
- false
27
+ @state))
30
28
  ).each do |(num, line, ast_node, nanopub_hash)|
31
29
  yield ::BEL::Nanopub::Nanopub.create(nanopub_hash)
32
30
  end
@@ -6,36 +6,33 @@ module BELParser
6
6
  include Enumerable
7
7
 
8
8
  attr_reader :keyword
9
- attr_reader :uri
10
- attr_reader :url
9
+ attr_reader :type
10
+ attr_reader :domain
11
11
 
12
- def initialize(keyword, uri = nil, url = nil, options = {})
12
+ def initialize(keyword, type, domain, options = {})
13
13
  raise(ArgumentError, 'keyword is nil') unless keyword
14
+ raise(ArgumentError, 'type is nil') unless type
15
+ raise(ArgumentError, 'domain is nil') unless domain
16
+
14
17
  @keyword = keyword
15
- @uri = uri
16
- @url = url
18
+ @type = type.to_sym
19
+ @domain = domain
17
20
 
18
21
  # configure reader for URIs (RDF).
19
- @uri_reader =
20
- options.fetch(:uri_reader) {
21
- BELParser::Resource.default_uri_reader
22
- }
22
+ @uri_reader = options.fetch(:uri_reader, nil)
23
23
  BELParser::Resource::Reader.assert_reader(@uri_reader, 'uri_reader')
24
24
 
25
25
  # configure reader for URLs (Resource files).
26
- @url_reader =
27
- options.fetch(:url_reader) {
28
- BELParser::Resource.default_url_reader
29
- }
26
+ @url_reader = options.fetch(:url_reader, nil)
30
27
  BELParser::Resource::Reader.assert_reader(@url_reader, 'url_reader')
31
28
  end
32
29
 
33
30
  def uri?
34
- !@uri.nil?
31
+ @type == :uri
35
32
  end
36
33
 
37
34
  def url?
38
- !@url.nil?
35
+ @type == :url
39
36
  end
40
37
 
41
38
  def [](value)
@@ -127,7 +127,7 @@ module BELParser
127
127
 
128
128
  def domain_value(type, domain)
129
129
  case type
130
- when :uri
130
+ when :url, :uri
131
131
  domain.identifier
132
132
  when :list
133
133
  domain
@@ -53,7 +53,7 @@ module BELParser
53
53
  url = unquote(url_node.string.string_literal)
54
54
  dataset = script_context[:resource_reader].retrieve_resource(url)
55
55
  script_context[:annotation_definitions] ||= Concurrent::Hash.new
56
- script_context[:annotation_definitions][prefix] = [:uri, dataset]
56
+ script_context[:annotation_definitions][prefix] = [:url, dataset]
57
57
  end
58
58
  private_class_method :handle_url
59
59
  end
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.34
4
+ version: 1.0.0.alpha.35
5
5
  platform: java
6
6
  authors:
7
7
  - Anthony Bargnesi