rbbt-util 5.5.9 → 5.5.10
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.rb +1 -2
- data/lib/rbbt/entity.rb +4 -0
- data/lib/rbbt/knowledge_base.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzRhMzNhNDZhYTY2ZDIzNGU4MGNhMzQ4YjBlZmEyMjI2ZjU3OGI3Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWYyN2IwZGMzMmQ5MWZlZjc2M2MxOGFiMGIwOGI2MTUwZTAwYzIxNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2ZmOGRmMTdmNzBlZDgxNmZmNmExMDk2ZjU3YWZhMDgzYTNlY2Y0Mjc1OWYx
|
10
|
+
NjRjYWI1NjE4MTM1Y2U1ZjMzOTZhMzFjODc1OTEyYmMyN2I5NmI4YTRmNzFm
|
11
|
+
NDMyZjQwZDNmMTFhMzNiYzkzZmU3OWNlNDU3NmEzMWFkYjQ5ZGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTcwOTZkOWU1NDlhM2U0YjY2ZGIxNGY2MjJiOWZlN2Y5ZmMyZjRiMjU0MjE3
|
14
|
+
NTMwN2FlNjVlODgxMTFkNjJhZDNkNzcyN2Y3MDQ3ZDNkNGIwOTc5ZGZhMDQz
|
15
|
+
ZTNmNDI1OGQwMzFiMmZmMjUzZWU5MzUwMGU1ZGMzMzI4YTgyYzM=
|
data/lib/rbbt/association.rb
CHANGED
@@ -118,8 +118,7 @@ module Association
|
|
118
118
|
|
119
119
|
if source_final_format and source_field != source_final_format and
|
120
120
|
Entity.formats[source_field] and
|
121
|
-
Entity.formats[
|
122
|
-
|
121
|
+
Entity.formats[source_final_format].all_formats.include? source_field
|
123
122
|
Log.debug("Changing source format from #{tsv.key_field} to #{source_final_format}")
|
124
123
|
|
125
124
|
tsv.with_unnamed do
|
data/lib/rbbt/entity.rb
CHANGED
@@ -6,12 +6,14 @@ module Entity
|
|
6
6
|
attr_accessor :formats, :entity_property_cache
|
7
7
|
end
|
8
8
|
|
9
|
+
|
9
10
|
self.entity_property_cache = "var/entity_property"
|
10
11
|
self.formats = {}
|
11
12
|
|
12
13
|
UNPERSISTED_PREFIX = "entity_unpersisted_property_"
|
13
14
|
|
14
15
|
|
16
|
+
attr_accessor :all_formats
|
15
17
|
def self.extended(base)
|
16
18
|
base.extend Annotation
|
17
19
|
Entity.formats[base.to_s] = base
|
@@ -27,6 +29,8 @@ module Entity
|
|
27
29
|
|
28
30
|
def self.format=(formats)
|
29
31
|
formats = [formats] unless Array === formats
|
32
|
+
self.all_formats ||= []
|
33
|
+
self.all_formats = self.all_formats.concat(formats).uniq
|
30
34
|
formats.each do |format|
|
31
35
|
Entity.formats[format] = self
|
32
36
|
end
|
data/lib/rbbt/knowledge_base.rb
CHANGED
@@ -57,14 +57,17 @@ class KnowledgeBase
|
|
57
57
|
def syndicate(kb, name)
|
58
58
|
kb.all_databases.each do |database|
|
59
59
|
db_name = [database, name] * "@"
|
60
|
-
|
60
|
+
file, kb_options = kb.registry[database]
|
61
|
+
options = {}
|
62
|
+
options[:undirected] = true if kb_options and kb_options[:undirected]
|
63
|
+
register(db_name, nil, options) do
|
61
64
|
kb.get_database(database)
|
62
65
|
end
|
63
66
|
end
|
64
67
|
end
|
65
68
|
|
66
69
|
def all_databases
|
67
|
-
|
70
|
+
@registry.keys
|
68
71
|
end
|
69
72
|
|
70
73
|
|
@@ -135,7 +138,8 @@ class KnowledgeBase
|
|
135
138
|
options = open_options.merge(registered_options || {}).merge(options)
|
136
139
|
raise "Repo #{ name } not found and not registered" if file.nil?
|
137
140
|
|
138
|
-
|
141
|
+
code = [name, Misc.hash2md5(options)] * "_"
|
142
|
+
@indices[code] ||= begin
|
139
143
|
Log.low "Opening index #{ name } from #{ Misc.fingerprint file }. #{options}"
|
140
144
|
Association.index(file, options, persist_options).
|
141
145
|
tap{|tsv| tsv.namespace = self.namespace}
|