rbbt-util 5.21.69 → 5.21.70
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/association/index.rb +4 -0
- data/lib/rbbt/association/item.rb +13 -5
- data/lib/rbbt/entity/identifiers.rb +1 -1
- data/lib/rbbt/util/misc/format.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f18a8bff029729b54d079392ab9063a03312bb1d
|
4
|
+
data.tar.gz: 838cfd2bf2a85c5f5f287b370291b659d67be601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24e5cfe8cd0adc01dd3ad4cce33a86a36d0767bd36b35544d0da2b960ee09f3373516214c0827496700ab38ab93f8d44ea2f14f465292c11b8b9b9130d339ea3
|
7
|
+
data.tar.gz: 75ff7b5627b32940769a1b3146ad113bc638f372c0cc04ef0c253b541cad2b5bc20416f30ab9199eb4b1365e380ecd8ff14ea71d03c94ea851492d2c16781eb3
|
@@ -51,6 +51,10 @@ module Association
|
|
51
51
|
next if source.nil? or source.empty?
|
52
52
|
next if values.empty?
|
53
53
|
|
54
|
+
#targets, *rest = Misc.zip_fields(Misc.zip_fields(values).uniq)
|
55
|
+
|
56
|
+
next if values.first.empty?
|
57
|
+
values = Misc.zip_fields(Misc.zip_fields(values).uniq)
|
54
58
|
targets, *rest = values
|
55
59
|
|
56
60
|
size = targets ? targets.length : 0
|
@@ -57,11 +57,19 @@ module AssociationItem
|
|
57
57
|
end
|
58
58
|
|
59
59
|
property :target_type => :both do
|
60
|
-
|
60
|
+
if reverse
|
61
|
+
knowledge_base.source(database)
|
62
|
+
else
|
63
|
+
knowledge_base.target(database)
|
64
|
+
end
|
61
65
|
end
|
62
66
|
|
63
67
|
property :source_type => :both do
|
64
|
-
|
68
|
+
if reverse
|
69
|
+
knowledge_base.target(database)
|
70
|
+
else
|
71
|
+
knowledge_base.source(database)
|
72
|
+
end
|
65
73
|
end
|
66
74
|
|
67
75
|
property :undirected => :both do
|
@@ -69,12 +77,12 @@ module AssociationItem
|
|
69
77
|
end
|
70
78
|
|
71
79
|
property :target_entity => :array2single do
|
72
|
-
type =
|
80
|
+
type = target_type
|
73
81
|
knowledge_base.annotate self.target, type, database #if self.target.any?
|
74
82
|
end
|
75
83
|
|
76
84
|
property :source_entity => :array2single do
|
77
|
-
type =
|
85
|
+
type = source_type
|
78
86
|
knowledge_base.annotate self.source, type, database #if self.source.any?
|
79
87
|
end
|
80
88
|
|
@@ -83,7 +91,7 @@ module AssociationItem
|
|
83
91
|
end
|
84
92
|
property :value => :array2single do
|
85
93
|
index = index(database)
|
86
|
-
value = index.chunked_values_at self
|
94
|
+
value = self.reverse ? index.chunked_values_at(self.invert) : index.chunked_values_at(self)
|
87
95
|
value.collect{|v| NamedArray.setup(v, index.fields)}
|
88
96
|
end
|
89
97
|
|
@@ -31,7 +31,7 @@ module Entity
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def identifier_index(format = nil, source = nil)
|
34
|
-
Persist.memory("Entity index #{identity_type}: #{format} (from #{source || "All"})", :
|
34
|
+
Persist.memory("Entity index #{identity_type}: #{format} (from #{source || "All"})", :persist => true, :format => format, :source => source) do
|
35
35
|
source ||= self.respond_to?(:format)? self.format : nil
|
36
36
|
|
37
37
|
begin
|
@@ -174,7 +174,11 @@ module Misc
|
|
174
174
|
end
|
175
175
|
|
176
176
|
def self.humanize_list(list)
|
177
|
-
list
|
177
|
+
if list.length == 1
|
178
|
+
list.first
|
179
|
+
else
|
180
|
+
list[0..-2].collect{|e| e.to_s} * ", " << " and " << list[-1].to_s
|
181
|
+
end
|
178
182
|
end
|
179
183
|
|
180
184
|
end
|
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.21.
|
4
|
+
version: 5.21.70
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|