bel_parser 1.0.0.alpha.31-java → 1.0.0.alpha.32-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: 51de3b1d211717716339a58423cbcb80506f2ecc
|
4
|
+
data.tar.gz: bca993ddd718dad0fbfe000405f1e039680f1571
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 879656e3829aecf18065e91dc86e33bc773ca103347af4c6208fc50e090586cb4ec0c15475e6b637df2e373838ca9fbec081e5bd30810c63b884dc6f9ac3fc7d
|
7
|
+
data.tar.gz: 3bb0dd918a31e3de3e34d0adc4c75e45649ae61f32856a6258bb95094b7d024685d4d509956b6bdf80d30fd9eb22e374eb0168e0f3d31ade2a9d926edc37e6ba
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.alpha.
|
1
|
+
1.0.0.alpha.32
|
@@ -21,17 +21,11 @@ module BELParser
|
|
21
21
|
@url = url
|
22
22
|
|
23
23
|
# configure reader for URIs (RDF).
|
24
|
-
@uri_reader =
|
25
|
-
options.fetch(:uri_reader) {
|
26
|
-
BELParser::Resource.default_uri_reader
|
27
|
-
}
|
24
|
+
@uri_reader = options.fetch(:uri_reader, nil)
|
28
25
|
BELParser::Resource::Reader.assert_reader(@uri_reader, 'uri_reader')
|
29
26
|
|
30
27
|
# configure reader for URLs (Resource files).
|
31
|
-
@url_reader =
|
32
|
-
options.fetch(:url_reader) {
|
33
|
-
BELParser::Resource.default_url_reader
|
34
|
-
}
|
28
|
+
@url_reader = options.fetch(:url_reader, nil)
|
35
29
|
BELParser::Resource::Reader.assert_reader(@url_reader, 'url_reader')
|
36
30
|
end
|
37
31
|
|
@@ -44,9 +38,9 @@ module BELParser
|
|
44
38
|
end
|
45
39
|
|
46
40
|
def [](value)
|
47
|
-
if uri?
|
41
|
+
if uri? && @uri_reader
|
48
42
|
@uri_reader.retrieve_value_from_resource(@uri, value)
|
49
|
-
elsif url?
|
43
|
+
elsif url? && @url_reader
|
50
44
|
@url_reader.retrieve_value_from_resource(@url, value)
|
51
45
|
else
|
52
46
|
nil
|
@@ -87,8 +87,7 @@ module BELParser
|
|
87
87
|
prefix, value = ast.children
|
88
88
|
namespace =
|
89
89
|
if prefix.identifier
|
90
|
-
|
91
|
-
Namespace.new(keyword, namespace_hash[keyword])
|
90
|
+
namespace_hash[prefix.identifier.string_literal]
|
92
91
|
else
|
93
92
|
nil
|
94
93
|
end
|
@@ -11,7 +11,7 @@ module BELParser
|
|
11
11
|
|
12
12
|
def self.parse(
|
13
13
|
input,
|
14
|
-
spec
|
14
|
+
spec = BELParser::Language.latest_supported_specification,
|
15
15
|
namespaces = {})
|
16
16
|
|
17
17
|
parser = Parser.new(input, Expression.filter, spec, namespaces)
|
@@ -20,7 +20,7 @@ module BELParser
|
|
20
20
|
|
21
21
|
def self.parse_parameters(
|
22
22
|
input,
|
23
|
-
spec
|
23
|
+
spec = BELParser::Language.latest_supported_specification,
|
24
24
|
namespaces = {})
|
25
25
|
|
26
26
|
parser = Parser.new(input, Expression.parameter_filter, spec, namespaces)
|
@@ -29,7 +29,7 @@ module BELParser
|
|
29
29
|
|
30
30
|
def self.parse_terms(
|
31
31
|
input,
|
32
|
-
spec
|
32
|
+
spec = BELParser::Language.latest_supported_specification,
|
33
33
|
namespaces = {})
|
34
34
|
|
35
35
|
parser = Parser.new(input, Expression.term_filter, spec, namespaces)
|
@@ -38,7 +38,7 @@ module BELParser
|
|
38
38
|
|
39
39
|
def self.parse_statements(
|
40
40
|
input,
|
41
|
-
spec
|
41
|
+
spec = BELParser::Language.latest_supported_specification,
|
42
42
|
namespaces = {})
|
43
43
|
|
44
44
|
parser = Parser.new(input, Expression.statement_filter, spec, namespaces)
|
@@ -3,7 +3,7 @@ module BELParser
|
|
3
3
|
# Reader represents the API for a reader of resource data.
|
4
4
|
module Reader
|
5
5
|
def self.assert_reader(reader, var_name)
|
6
|
-
|
6
|
+
return unless reader
|
7
7
|
not_impl_methods =
|
8
8
|
Reader.instance_methods.reject do |method|
|
9
9
|
reader.respond_to?(method)
|