rbbt-util 5.5.9 → 5.5.10

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzZjOWMzZjRhNWIyMmRhMjc1MjM1NGU3NGNhNWJiMWU3MmE4ZDExYw==
4
+ NzRhMzNhNDZhYTY2ZDIzNGU4MGNhMzQ4YjBlZmEyMjI2ZjU3OGI3Yw==
5
5
  data.tar.gz: !binary |-
6
- MzhlY2RmNWYxNDk4ZTNmMTk2ZTU3NTYyN2JhNmY4YmJiMzUxYzQ3MA==
6
+ MWYyN2IwZGMzMmQ5MWZlZjc2M2MxOGFiMGIwOGI2MTUwZTAwYzIxNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDBmM2RhZWI3MTc3Nzc5OGQ5NGIxN2I0ZTg4ZDkyNmRlMmY5MzhjODU1YzU3
10
- NWM4MjlmZmM5NGZiMjEzNjUyZWE0NjJkMDQ1NTEzNjJjNjVmMTcxOThiMTY5
11
- YTQ0ZDNmYzJhOTQ3MzJmYWRkNDIwMDYxMmE4ZDZlN2ZlMTYyMzI=
9
+ N2ZmOGRmMTdmNzBlZDgxNmZmNmExMDk2ZjU3YWZhMDgzYTNlY2Y0Mjc1OWYx
10
+ NjRjYWI1NjE4MTM1Y2U1ZjMzOTZhMzFjODc1OTEyYmMyN2I5NmI4YTRmNzFm
11
+ NDMyZjQwZDNmMTFhMzNiYzkzZmU3OWNlNDU3NmEzMWFkYjQ5ZGU=
12
12
  data.tar.gz: !binary |-
13
- N2QzYWEyNDAxYWRmOGIyMDM5YmU1YTAxZDQ3ZDA5Mzg5Njk4OTY1Zjc4Y2U4
14
- ZDAwZjFiOWVlYzg1NzNkNDk2NzEzNzdkMjVjN2U2ZTk4MjQzMzY0MzRjMmY0
15
- YzhkYmJiZDE3OGE0NmI0NTU4NjVmYzNhN2YwYzZmZDhkZDc4Y2E=
13
+ OTcwOTZkOWU1NDlhM2U0YjY2ZGIxNGY2MjJiOWZlN2Y5ZmMyZjRiMjU0MjE3
14
+ NTMwN2FlNjVlODgxMTFkNjJhZDNkNzcyN2Y3MDQ3ZDNkNGIwOTc5ZGZhMDQz
15
+ ZTNmNDI1OGQwMzFiMmZmMjUzZWU5MzUwMGU1ZGMzMzI4YTgyYzM=
@@ -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[source_field] == Entity.formats[source_final_format]
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
@@ -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
- register(db_name) do
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
- (@indices.keys + @registry.keys).uniq
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
- @indices[name] ||= begin
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}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.9
4
+ version: 5.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez