rbbt-util 5.5.12 → 5.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/rbbt/association/index.rb +2 -1
- data/lib/rbbt/association/item.rb +1 -1
- data/lib/rbbt/knowledge_base.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWZjMjY1ZjljYmM0MzZmNTBiN2E0OTU1Zjk4NGU0NDFmM2M3YjFkNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDM1YmM4NTVlMTE5YWE2NDY2NzU0MTI4YjEwM2FkN2I4MTJjNDc5Mg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWMwMjg5M2EwZTUxZDBiNDI2MTZhNGNlZDU2NTYxNzAzMDJlYWYzZTIwYzU3
|
10
|
+
MDcyMWYyZmMwNmE2ZTQwZTdjMDcxNjU1NzkwYjZmZDFkNGQ3NTBmYzFkZjVl
|
11
|
+
YTBmZmVmODJiMGU5YjNhNTNmZmY0ZGM2NjQ3NGQ5ZWViMjBiNDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGQ4Nzk0ZGViYmU2MTViMDY4NGEyZDgxODk4YzlmNzhkOWNmODNhZWVkMTE2
|
14
|
+
ZWFhNTcwNTlmNzYwNzliMjkzYjE5NmY3NmM0NGMwNWUwMzRkNWZkY2M4MWNl
|
15
|
+
YmQ4MTkxNWZjMGE1ZDUzYjI5Y2Y2YmYzYWY4ZGIxNjk4ZGZkMTM=
|
@@ -20,6 +20,7 @@ module Association
|
|
20
20
|
if File.exists?(reverse_filename)
|
21
21
|
new = Persist.open_tokyocabinet(reverse_filename, false, serializer, TokyoCabinet::BDB)
|
22
22
|
else
|
23
|
+
FileUtils.mkdir_p File.basename(reverse_filename) unless File.exists?(File.basename(reverse_filename))
|
23
24
|
new = Persist.open_tokyocabinet(reverse_filename, true, serializer, TokyoCabinet::BDB)
|
24
25
|
new.write
|
25
26
|
through do |key, value|
|
@@ -28,7 +29,7 @@ module Association
|
|
28
29
|
end
|
29
30
|
annotate(new)
|
30
31
|
new.key_field = key_field.split("~").values_at(1,0,2).compact * "~"
|
31
|
-
new.
|
32
|
+
new.read
|
32
33
|
end
|
33
34
|
|
34
35
|
new.unnamed = true
|
@@ -21,7 +21,7 @@ module AssociationItem
|
|
21
21
|
|
22
22
|
property :target_entity => :array2single do
|
23
23
|
type = reverse ? knowledge_base.source(database) : knowledge_base.target(database)
|
24
|
-
knowledge_base.annotate self.target, type if self.target.any?
|
24
|
+
knowledge_base.annotate self.target, type, database if self.target.any?
|
25
25
|
end
|
26
26
|
|
27
27
|
property :source_entity => :array2single do
|
data/lib/rbbt/knowledge_base.rb
CHANGED
@@ -17,7 +17,7 @@ class KnowledgeBase
|
|
17
17
|
|
18
18
|
attr_accessor :namespace, :dir, :indices, :registry, :format, :databases, :entity_options
|
19
19
|
def initialize(dir, namespace = nil)
|
20
|
-
@dir = Path.setup
|
20
|
+
@dir = Path.setup(dir).find
|
21
21
|
|
22
22
|
@namespace = namespace
|
23
23
|
@format = IndiferentHash.setup({})
|
@@ -179,15 +179,18 @@ class KnowledgeBase
|
|
179
179
|
|
180
180
|
#{{{ Annotate
|
181
181
|
|
182
|
-
def entity_options_for(type)
|
182
|
+
def entity_options_for(type, database_name = nil)
|
183
183
|
options = entity_options[Entity.formats[type]] || {}
|
184
184
|
options[:format] = @format[type] if @format.include? :type
|
185
185
|
options = {:organism => namespace}.merge(options)
|
186
|
+
if database_name and (database = get_database(database_name)).entity_options
|
187
|
+
options = options.merge database.entity_options
|
188
|
+
end
|
186
189
|
options
|
187
190
|
end
|
188
191
|
|
189
|
-
def annotate(entities, type)
|
190
|
-
Misc.prepare_entity(entities, type, entity_options_for(type))
|
192
|
+
def annotate(entities, type, database = nil)
|
193
|
+
Misc.prepare_entity(entities, type, entity_options_for(type, database))
|
191
194
|
end
|
192
195
|
|
193
196
|
#{{{ Identify
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.5.
|
4
|
+
version: 5.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|