bel 0.4.0.beta.2 → 0.4.0.beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 068dbd416046633700df1624c0078e11a0dc84f4
4
- data.tar.gz: 4c82f900aa4d19f2c484ea7c16fed41b4e4ff30e
3
+ metadata.gz: 3368c94b528ce9bc8cf2fb49aebc2ff53aade5e4
4
+ data.tar.gz: 32201cc5149a0e053fb8b564e93bb7f77550793b
5
5
  SHA512:
6
- metadata.gz: dc79042a9629fb4237a8ecd8981c89bac9a8e60718fd9a234bbd1f6d0aa0f24ffec5fcd7bd8160ee732ba4e326f6e46baf61228502b5cb8c4ea38147da0b7e3a
7
- data.tar.gz: bb47d1e8b8b78e31430adeedf362145000ae8de5321680f24983ac11883853807175dc203bb6cc0b2b46eb1c1784cca03e23bc0ae3f8ab137a11f60f7c3e9ea2
6
+ metadata.gz: 65f309cc4f85677011c7f9e05e7138f10225fbc2c5962b2e5c8fb2d647e1c12488d954e8360b96775121cbf1183b9578f23d71409346f9cfcd349e6be4f0cc6a
7
+ data.tar.gz: 594dba92a90d0a5b555705f99b5f39d3ee71cc91fa8107ed368f5474c5651354b77b739d475e19c3636465a8dc84662e934c88670db4498def0fd6e5c8e54258
@@ -1,4 +1,4 @@
1
- require_relative '../resource'
1
+ require_relative 'namespaces'
2
2
 
3
3
  module BEL
4
4
  module Resource
@@ -25,20 +25,54 @@ module BEL
25
25
  each.map(&:predicate).uniq
26
26
  end
27
27
 
28
- def equivalents
29
- return to_enum(:equivalents) unless block_given?
30
- @rdf_repository.
31
- query(@eq_query) { |solution|
32
- yield NamespaceValue.new(@rdf_repository, solution.object)
33
- }
28
+ def equivalents(target_namespaces = :all)
29
+ return to_enum(:equivalents, target_namespaces) unless block_given?
30
+ if target_namespaces == :all
31
+ @rdf_repository.
32
+ query(@eq_query) { |solution|
33
+ yield NamespaceValue.new(@rdf_repository, solution.object)
34
+ }
35
+ else
36
+ target_namespaces = Namespaces.new(@rdf_repository).
37
+ find([target_namespaces].flatten).to_a
38
+ target_namespaces.compact!
39
+ target_namespaces.map! { |ns| ns.uri }
40
+
41
+ @rdf_repository.
42
+ query(@eq_query).map { |solution|
43
+ NamespaceValue.new(@rdf_repository, solution.object)
44
+ }.select { |value|
45
+ scheme_uri = value.inScheme
46
+ target_namespaces.include?(scheme_uri)
47
+ }.each { |value|
48
+ yield value
49
+ }
50
+ end
34
51
  end
35
52
 
36
- def orthologs
37
- return to_enum(:orthologs) unless block_given?
38
- @rdf_repository.
39
- query(@ortho_query) { |solution|
40
- yield NamespaceValue.new(@rdf_repository, solution.object)
41
- }
53
+ def orthologs(target_namespaces = :all)
54
+ return to_enum(:orthologs, target_namespaces) unless block_given?
55
+ if target_namespaces == :all
56
+ @rdf_repository.
57
+ query(@ortho_query) { |solution|
58
+ yield NamespaceValue.new(@rdf_repository, solution.object)
59
+ }
60
+ else
61
+ target_namespaces = Namespaces.new(@rdf_repository).
62
+ find([target_namespaces].flatten).to_a
63
+ target_namespaces.compact!
64
+ target_namespaces.map! { |ns| ns.uri }
65
+
66
+ @rdf_repository.
67
+ query(@ortho_query).map { |solution|
68
+ NamespaceValue.new(@rdf_repository, solution.object)
69
+ }.select { |value|
70
+ scheme_uri = value.inScheme
71
+ target_namespaces.include?(scheme_uri)
72
+ }.each { |value|
73
+ yield value
74
+ }
75
+ end
42
76
  end
43
77
 
44
78
  def hash
@@ -1,4 +1,3 @@
1
- require_relative '../resource'
2
1
  require_relative 'namespace'
3
2
 
4
3
  module BEL
data/lib/bel/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BEL
2
- VERSION = '0.4.0.beta.2'
2
+ VERSION = '0.4.0.beta.3'
3
3
  end
metadata CHANGED
@@ -1,34 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.beta.2
4
+ version: 0.4.0.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Bargnesi
8
8
  - Natalie Catlett
9
9
  - Nick Bargnesi
10
10
  - William Hayes
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
  date: 2015-12-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: ffi
18
17
  requirement: !ruby/object:Gem::Requirement
19
18
  requirements:
20
19
  - - '='
21
20
  - !ruby/object:Gem::Version
22
21
  version: 1.9.8
23
- type: :runtime
22
+ name: ffi
24
23
  prerelease: false
24
+ type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.9.8
30
- description: " The BEL gem allows the reading, writing, and processing of BEL (Biological
31
- Expression Language) with a natural DSL. "
30
+ description: " The BEL gem allows the reading, writing, and processing of BEL (Biological\
31
+ \ Expression Language) with a natural DSL. "
32
32
  email:
33
33
  - abargnesi@selventa.com
34
34
  - ncatlett@selventa.com
@@ -163,7 +163,7 @@ homepage: https://github.com/OpenBEL/bel.rb
163
163
  licenses:
164
164
  - Apache-2.0
165
165
  metadata: {}
166
- post_install_message:
166
+ post_install_message:
167
167
  rdoc_options:
168
168
  - "--title"
169
169
  - BEL Ruby Documentation
@@ -197,10 +197,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  - !ruby/object:Gem::Version
198
198
  version: 1.3.1
199
199
  requirements: []
200
- rubyforge_project:
201
- rubygems_version: 2.4.5.1
202
- signing_key:
200
+ rubyforge_project:
201
+ rubygems_version: 2.4.8
202
+ signing_key:
203
203
  specification_version: 4
204
204
  summary: Process BEL with ruby.
205
205
  test_files: []
206
- has_rdoc: