rbbt-util 6.0.4 → 6.0.5
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 +4 -4
- data/bin/rbbt +1 -1
- data/lib/rbbt/hpc/batch.rb +1 -1
- data/lib/rbbt/knowledge_base/enrichment.rb +9 -9
- data/lib/rbbt/knowledge_base/entity.rb +128 -128
- data/lib/rbbt/knowledge_base/query.rb +94 -94
- data/lib/rbbt/knowledge_base/registry.rb +189 -189
- data/lib/rbbt/knowledge_base/syndicate.rb +26 -26
- data/lib/rbbt/knowledge_base/traverse.rb +315 -315
- data/lib/rbbt/knowledge_base.rb +37 -34
- data/lib/rbbt/util/migrate.rb +3 -3
- data/lib/rbbt/workflow/remote_workflow/driver/ssh.rb +11 -11
- data/lib/rbbt/workflow/remote_workflow/remote_step.rb +1 -1
- data/lib/rbbt/workflow/remote_workflow.rb +2 -1
- data/lib/rbbt.rb +1 -1
- data/python/rbbt/'/Users/miki/config/tmp/undodir'/%Users%miki%git%rbbt-util%python%rbbt%__init__.py +0 -0
- data/share/rbbt_commands/hpc/list +1 -1
- data/share/rbbt_commands/lsf/list +1 -1
- data/share/rbbt_commands/pbs/list +1 -1
- data/share/rbbt_commands/resource/find +1 -1
- data/share/rbbt_commands/slurm/list +1 -1
- data/share/rbbt_commands/system/status +2 -2
- data/share/rbbt_commands/workflow/info +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5f392d8b49d9b1f3f0e2fc2a627654d7e0d8c8766277ab525c42f692d97eac4
|
4
|
+
data.tar.gz: 78026648894c3868852a01fb1a74bf9b554c9a28e121f51f77029fc6265019cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43188e6b49995ee547e1c968ba1daca213e3204e20d0695dfd5b0a75b3788e866d04cba23e84ef59d794e58b2eaae8c7e8860ea07e7e7d71fab14df96dd6d583
|
7
|
+
data.tar.gz: 6656b4fb1a54e5c6b9711a3c5bc735a04335de2380bb93fcd18f923b54914b408640e4545167c7c1599122ae2685e8fca3375b4775c2b3c30f2bdc23146344c1
|
data/bin/rbbt
CHANGED
@@ -102,7 +102,7 @@ end
|
|
102
102
|
$scout_command_dir = Scout.bin.scout
|
103
103
|
$scout_command_dir.path_maps[:rbbt_bin] = File.join(File.dirname(__dir__), "{PATH/bin\\/scout/bin\\/rbbt}")
|
104
104
|
$scout_command_dir.path_maps[:rbbt_commands] = File.join(File.dirname(__dir__), "{PATH/bin\\/scout/share\\/rbbt_commands}")
|
105
|
-
$scout_command_dir.path_maps[:scout_commands] = File.join(Scout.root.find(:
|
105
|
+
$scout_command_dir.path_maps[:scout_commands] = File.join(Scout.root.find(:scout_gear_lib), "{PATH/bin\\/scout/scout_commands}")
|
106
106
|
|
107
107
|
SOPT.description =<<EOF
|
108
108
|
This command controls many aspects of the Scout framework, from configuration tasks to running applications.
|
data/lib/rbbt/hpc/batch.rb
CHANGED
@@ -133,7 +133,7 @@ module HPC
|
|
133
133
|
# Save inputs into inputs_dir
|
134
134
|
inputs_dir = IndiferentHash.process_options options, :inputs_dir
|
135
135
|
saved = job.save_inputs(inputs_dir)
|
136
|
-
options[:load_inputs] = inputs_dir if saved && saved.
|
136
|
+
options[:load_inputs] = inputs_dir if saved && !saved.nil? && !saved.empty?
|
137
137
|
|
138
138
|
saved.each do |input|
|
139
139
|
options.delete input
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require 'rbbt/knowledge_base/registry'
|
2
|
-
class KnowledgeBase
|
3
|
-
def enrichment(name, entities, options = {})
|
4
|
-
require 'rbbt/statistics/hypergeometric'
|
5
|
-
database = get_database(name, options)
|
6
|
-
entities = identify_source name, entities
|
7
|
-
database.enrichment entities, database.fields.first, :persist => false
|
8
|
-
end
|
9
|
-
end
|
1
|
+
#require 'rbbt/knowledge_base/registry'
|
2
|
+
#class KnowledgeBase
|
3
|
+
# def enrichment(name, entities, options = {})
|
4
|
+
# require 'rbbt/statistics/hypergeometric'
|
5
|
+
# database = get_database(name, options)
|
6
|
+
# entities = identify_source name, entities
|
7
|
+
# database.enrichment entities, database.fields.first, :persist => false
|
8
|
+
# end
|
9
|
+
#end
|
@@ -1,128 +1,128 @@
|
|
1
|
-
require 'rbbt/entity'
|
2
|
-
require 'rbbt/knowledge_base/registry'
|
3
|
-
|
4
|
-
class KnowledgeBase
|
5
|
-
|
6
|
-
def select_entities(name, entities, options = {})
|
7
|
-
index = get_index(name, options)
|
8
|
-
|
9
|
-
source_field = index.source_field
|
10
|
-
target_field = index.target_field
|
11
|
-
|
12
|
-
source_type = Entity.formats[source_field]
|
13
|
-
target_type = Entity.formats[target_field]
|
14
|
-
|
15
|
-
source_entities = entities[:source] || entities[source_field] || entities[Entity.formats[source_field].to_s] || entities[:both]
|
16
|
-
target_entities = entities[:target] || entities[target_field] || entities[Entity.formats[target_field].to_s] || entities[:both]
|
17
|
-
|
18
|
-
[source_entities, target_entities]
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
def entity_options_for(type, database_name = nil)
|
23
|
-
entity_options = self.entity_options
|
24
|
-
IndiferentHash.setup entity_options if entity_options and not IndiferentHash === entity_options
|
25
|
-
options = entity_options[type.to_s] || entity_options[Entity.formats[type.to_s].to_s] || {}
|
26
|
-
options[:format] = @format[type] if Hash === @format && @format.include?(type)
|
27
|
-
namespace = self.namespace
|
28
|
-
namespace = db_namespace(database_name) if namespace.nil? and database_name
|
29
|
-
options = {:organism => namespace}.merge(options)
|
30
|
-
if database_name
|
31
|
-
database = get_database(database_name)
|
32
|
-
if database.entity_options and (database.entity_options[type] or database.entity_options[Entity.formats[type.to_s].to_s])
|
33
|
-
options = options.merge(database.entity_options[type] || database.entity_options[Entity.formats[type.to_s].to_s])
|
34
|
-
end
|
35
|
-
end
|
36
|
-
options
|
37
|
-
end
|
38
|
-
|
39
|
-
def annotate(entities, type, database = nil)
|
40
|
-
format = @format[type] || type
|
41
|
-
entity_options = entity_options_for(type, database)
|
42
|
-
Entity.prepare_entity(entities, format, entity_options)
|
43
|
-
end
|
44
|
-
|
45
|
-
def translate(entities, type)
|
46
|
-
if format = @format[type] and (entities.respond_to? :format and format != entities.format)
|
47
|
-
entities.to format
|
48
|
-
else
|
49
|
-
entities
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def source_type(name)
|
54
|
-
Entity.formats[source(name)]
|
55
|
-
end
|
56
|
-
|
57
|
-
def target_type(name)
|
58
|
-
Entity.formats[target(name)]
|
59
|
-
end
|
60
|
-
|
61
|
-
def entities
|
62
|
-
all_databases.inject([]){|acc,name| acc << source(name); acc << target(name)}.uniq
|
63
|
-
end
|
64
|
-
|
65
|
-
def entity_types
|
66
|
-
entities.collect{|entity| Entity.formats[entity] }.uniq
|
67
|
-
end
|
68
|
-
|
69
|
-
def identifier_files(name)
|
70
|
-
get_database(name).identifier_files.dup
|
71
|
-
end
|
72
|
-
|
73
|
-
def db_namespace(name)
|
74
|
-
get_database(name).namespace
|
75
|
-
end
|
76
|
-
|
77
|
-
def source_index(name)
|
78
|
-
Persist.memory("Source index #{name}: KB directory #{dir}") do
|
79
|
-
identifier_files = identifier_files(name)
|
80
|
-
identifier_files.concat Entity.identifier_files(source(name)) if defined? Entity
|
81
|
-
identifier_files.uniq!
|
82
|
-
identifier_files.collect!{|f| f.annotate(f.gsub(/\bNAMESPACE\b/, namespace))} if namespace
|
83
|
-
identifier_files.collect!{|f| f.annotate(f.gsub(/\bNAMESPACE\b/, db_namespace(name)))} if not namespace and db_namespace(name)
|
84
|
-
identifier_files.reject!{|f| f.match(/\bNAMESPACE\b/)}
|
85
|
-
TSV.translation_index identifier_files, nil, source(name), :persist => true
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
def target_index(name)
|
90
|
-
Persist.memory("Target index #{name}: KB directory #{dir}") do
|
91
|
-
identifier_files = identifier_files(name)
|
92
|
-
identifier_files.concat Entity.identifier_files(target(name)) if defined? Entity
|
93
|
-
identifier_files.uniq!
|
94
|
-
identifier_files.collect!{|f| f.annotate(f.gsub(/\bNAMESPACE\b/, namespace))} if self.namespace
|
95
|
-
identifier_files.collect!{|f| f.annotate(f.gsub(/\bNAMESPACE\b/, db_namespace(name)))} if namespace.nil? and db_namespace(name)
|
96
|
-
identifier_files.reject!{|f| f.match(/\bNAMESPACE\b/)}
|
97
|
-
TSV.translation_index identifier_files, nil, target(name), :persist => true
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
def identify_source(name, entity)
|
102
|
-
return :all if entity == :all
|
103
|
-
index = source_index(name)
|
104
|
-
return entity if index.nil?
|
105
|
-
if Array === entity
|
106
|
-
entity.collect{|e| index[e] || e }
|
107
|
-
else
|
108
|
-
index[entity] || entity
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
|
113
|
-
def identify_target(name, entity)
|
114
|
-
return :all if entity == :all
|
115
|
-
index = target_index(name)
|
116
|
-
return entity if index.nil?
|
117
|
-
if Array === entity
|
118
|
-
entity.collect{|e| index[e] || e }
|
119
|
-
else
|
120
|
-
index[entity] || entity
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
def identify(name, entity)
|
125
|
-
identify_source(name, entity) || identify_target(name, entity)
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
1
|
+
#require 'rbbt/entity'
|
2
|
+
#require 'rbbt/knowledge_base/registry'
|
3
|
+
#
|
4
|
+
#class KnowledgeBase
|
5
|
+
#
|
6
|
+
# def select_entities(name, entities, options = {})
|
7
|
+
# index = get_index(name, options)
|
8
|
+
#
|
9
|
+
# source_field = index.source_field
|
10
|
+
# target_field = index.target_field
|
11
|
+
#
|
12
|
+
# source_type = Entity.formats[source_field]
|
13
|
+
# target_type = Entity.formats[target_field]
|
14
|
+
#
|
15
|
+
# source_entities = entities[:source] || entities[source_field] || entities[Entity.formats[source_field].to_s] || entities[:both]
|
16
|
+
# target_entities = entities[:target] || entities[target_field] || entities[Entity.formats[target_field].to_s] || entities[:both]
|
17
|
+
#
|
18
|
+
# [source_entities, target_entities]
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
#
|
22
|
+
# def entity_options_for(type, database_name = nil)
|
23
|
+
# entity_options = self.entity_options
|
24
|
+
# IndiferentHash.setup entity_options if entity_options and not IndiferentHash === entity_options
|
25
|
+
# options = entity_options[type.to_s] || entity_options[Entity.formats[type.to_s].to_s] || {}
|
26
|
+
# options[:format] = @format[type] if Hash === @format && @format.include?(type)
|
27
|
+
# namespace = self.namespace
|
28
|
+
# namespace = db_namespace(database_name) if namespace.nil? and database_name
|
29
|
+
# options = {:organism => namespace}.merge(options)
|
30
|
+
# if database_name
|
31
|
+
# database = get_database(database_name)
|
32
|
+
# if database.entity_options and (database.entity_options[type] or database.entity_options[Entity.formats[type.to_s].to_s])
|
33
|
+
# options = options.merge(database.entity_options[type] || database.entity_options[Entity.formats[type.to_s].to_s])
|
34
|
+
# end
|
35
|
+
# end
|
36
|
+
# options
|
37
|
+
# end
|
38
|
+
#
|
39
|
+
# def annotate(entities, type, database = nil)
|
40
|
+
# format = @format[type] || type
|
41
|
+
# entity_options = entity_options_for(type, database)
|
42
|
+
# Entity.prepare_entity(entities, format, entity_options)
|
43
|
+
# end
|
44
|
+
#
|
45
|
+
# def translate(entities, type)
|
46
|
+
# if format = @format[type] and (entities.respond_to? :format and format != entities.format)
|
47
|
+
# entities.to format
|
48
|
+
# else
|
49
|
+
# entities
|
50
|
+
# end
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# def source_type(name)
|
54
|
+
# Entity.formats[source(name)]
|
55
|
+
# end
|
56
|
+
#
|
57
|
+
# def target_type(name)
|
58
|
+
# Entity.formats[target(name)]
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# def entities
|
62
|
+
# all_databases.inject([]){|acc,name| acc << source(name); acc << target(name)}.uniq
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# def entity_types
|
66
|
+
# entities.collect{|entity| Entity.formats[entity] }.uniq
|
67
|
+
# end
|
68
|
+
#
|
69
|
+
# def identifier_files(name)
|
70
|
+
# get_database(name).identifier_files.dup
|
71
|
+
# end
|
72
|
+
#
|
73
|
+
# def db_namespace(name)
|
74
|
+
# get_database(name).namespace
|
75
|
+
# end
|
76
|
+
#
|
77
|
+
# def source_index(name)
|
78
|
+
# Persist.memory("Source index #{name}: KB directory #{dir}") do
|
79
|
+
# identifier_files = identifier_files(name)
|
80
|
+
# identifier_files.concat Entity.identifier_files(source(name)) if defined? Entity
|
81
|
+
# identifier_files.uniq!
|
82
|
+
# identifier_files.collect!{|f| f.annotate(f.gsub(/\bNAMESPACE\b/, namespace))} if namespace
|
83
|
+
# identifier_files.collect!{|f| f.annotate(f.gsub(/\bNAMESPACE\b/, db_namespace(name)))} if not namespace and db_namespace(name)
|
84
|
+
# identifier_files.reject!{|f| f.match(/\bNAMESPACE\b/)}
|
85
|
+
# TSV.translation_index identifier_files, nil, source(name), :persist => true
|
86
|
+
# end
|
87
|
+
# end
|
88
|
+
#
|
89
|
+
# def target_index(name)
|
90
|
+
# Persist.memory("Target index #{name}: KB directory #{dir}") do
|
91
|
+
# identifier_files = identifier_files(name)
|
92
|
+
# identifier_files.concat Entity.identifier_files(target(name)) if defined? Entity
|
93
|
+
# identifier_files.uniq!
|
94
|
+
# identifier_files.collect!{|f| f.annotate(f.gsub(/\bNAMESPACE\b/, namespace))} if self.namespace
|
95
|
+
# identifier_files.collect!{|f| f.annotate(f.gsub(/\bNAMESPACE\b/, db_namespace(name)))} if namespace.nil? and db_namespace(name)
|
96
|
+
# identifier_files.reject!{|f| f.match(/\bNAMESPACE\b/)}
|
97
|
+
# TSV.translation_index identifier_files, nil, target(name), :persist => true
|
98
|
+
# end
|
99
|
+
# end
|
100
|
+
#
|
101
|
+
# def identify_source(name, entity)
|
102
|
+
# return :all if entity == :all
|
103
|
+
# index = source_index(name)
|
104
|
+
# return entity if index.nil?
|
105
|
+
# if Array === entity
|
106
|
+
# entity.collect{|e| index[e] || e }
|
107
|
+
# else
|
108
|
+
# index[entity] || entity
|
109
|
+
# end
|
110
|
+
# end
|
111
|
+
#
|
112
|
+
#
|
113
|
+
# def identify_target(name, entity)
|
114
|
+
# return :all if entity == :all
|
115
|
+
# index = target_index(name)
|
116
|
+
# return entity if index.nil?
|
117
|
+
# if Array === entity
|
118
|
+
# entity.collect{|e| index[e] || e }
|
119
|
+
# else
|
120
|
+
# index[entity] || entity
|
121
|
+
# end
|
122
|
+
# end
|
123
|
+
#
|
124
|
+
# def identify(name, entity)
|
125
|
+
# identify_source(name, entity) || identify_target(name, entity)
|
126
|
+
# end
|
127
|
+
#end
|
128
|
+
#
|
@@ -1,94 +1,94 @@
|
|
1
|
-
require 'rbbt/knowledge_base/registry'
|
2
|
-
|
3
|
-
class KnowledgeBase
|
4
|
-
|
5
|
-
def _subset(name, source = :all, target = :all, options = {})
|
6
|
-
repo = get_index name, options
|
7
|
-
|
8
|
-
repo.subset(source, target)
|
9
|
-
end
|
10
|
-
|
11
|
-
def subset(name, entities, options = {}, &block)
|
12
|
-
entities, options = options, entities if entities.nil? and Hash === options
|
13
|
-
|
14
|
-
entities = case entities
|
15
|
-
when :all
|
16
|
-
{:target => :all, :source => :all}
|
17
|
-
when AnnotatedArray
|
18
|
-
format = entities.format if entities.respond_to? :format
|
19
|
-
format ||= entities.base_entity.to_s
|
20
|
-
{format => entities.purge}
|
21
|
-
when Hash
|
22
|
-
entities
|
23
|
-
else
|
24
|
-
raise "Entities are not a Hash or an AnnotatedArray: #{Log.fingerprint entities}"
|
25
|
-
end
|
26
|
-
|
27
|
-
identify, identify_source, identify_target = entities.merge(options || {}).values_at :identify, :identify_source, :identify_target
|
28
|
-
|
29
|
-
source, target = select_entities(name, entities, options)
|
30
|
-
|
31
|
-
source = identify_source(name, source) if identify_source
|
32
|
-
target = identify_target(name, target) if identify_target
|
33
|
-
|
34
|
-
source = identify(name, source) if identify && !identify_source
|
35
|
-
target = identify(name, target) if identify && !identify_target
|
36
|
-
|
37
|
-
return [] if source.nil? or target.nil?
|
38
|
-
return [] if Array === target and target.empty?
|
39
|
-
return [] if Array === source and source.empty?
|
40
|
-
|
41
|
-
matches = _subset name, source, target, options
|
42
|
-
|
43
|
-
setup(name, matches)
|
44
|
-
|
45
|
-
matches = matches.select(&block) if block_given?
|
46
|
-
|
47
|
-
matches
|
48
|
-
end
|
49
|
-
|
50
|
-
def all(name, options={})
|
51
|
-
repo = get_index name, options
|
52
|
-
setup name, repo.keys
|
53
|
-
end
|
54
|
-
|
55
|
-
def _children(name, entity)
|
56
|
-
repo = get_index name
|
57
|
-
repo.match(entity)
|
58
|
-
end
|
59
|
-
|
60
|
-
def children(name, entity)
|
61
|
-
entity = identify_source(name, entity)
|
62
|
-
setup(name, _children(name, entity))
|
63
|
-
end
|
64
|
-
|
65
|
-
def _parents(name, entity)
|
66
|
-
repo = get_index name
|
67
|
-
repo.reverse.match(entity)
|
68
|
-
end
|
69
|
-
|
70
|
-
def parents(name, entity)
|
71
|
-
entity = identify_target(name, entity)
|
72
|
-
matches = _parents(name, entity)
|
73
|
-
#matches.each{|m| m.replace(m.partition("~").reverse*"") } unless undirected(name)
|
74
|
-
setup(name, matches, true)
|
75
|
-
end
|
76
|
-
|
77
|
-
def _neighbours(name, entity)
|
78
|
-
if undirected(name) and source(name) == target(name)
|
79
|
-
{:children => _children(name, entity)}
|
80
|
-
else
|
81
|
-
{:parents => _parents(name, entity), :children => _children(name, entity)}
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def neighbours(name, entity)
|
86
|
-
hash = _neighbours(name, entity)
|
87
|
-
IndiferentHash.setup(hash)
|
88
|
-
setup(name, hash[:children]) if hash[:children]
|
89
|
-
setup(name, hash[:parents], true) if hash[:parents]
|
90
|
-
hash
|
91
|
-
end
|
92
|
-
|
93
|
-
end
|
94
|
-
|
1
|
+
#require 'rbbt/knowledge_base/registry'
|
2
|
+
#
|
3
|
+
#class KnowledgeBase
|
4
|
+
#
|
5
|
+
# def _subset(name, source = :all, target = :all, options = {})
|
6
|
+
# repo = get_index name, options
|
7
|
+
#
|
8
|
+
# repo.subset(source, target)
|
9
|
+
# end
|
10
|
+
#
|
11
|
+
# def subset(name, entities, options = {}, &block)
|
12
|
+
# entities, options = options, entities if entities.nil? and Hash === options
|
13
|
+
#
|
14
|
+
# entities = case entities
|
15
|
+
# when :all
|
16
|
+
# {:target => :all, :source => :all}
|
17
|
+
# when AnnotatedArray
|
18
|
+
# format = entities.format if entities.respond_to? :format
|
19
|
+
# format ||= entities.base_entity.to_s
|
20
|
+
# {format => entities.purge}
|
21
|
+
# when Hash
|
22
|
+
# entities
|
23
|
+
# else
|
24
|
+
# raise "Entities are not a Hash or an AnnotatedArray: #{Log.fingerprint entities}"
|
25
|
+
# end
|
26
|
+
#
|
27
|
+
# identify, identify_source, identify_target = entities.merge(options || {}).values_at :identify, :identify_source, :identify_target
|
28
|
+
#
|
29
|
+
# source, target = select_entities(name, entities, options)
|
30
|
+
#
|
31
|
+
# source = identify_source(name, source) if identify_source
|
32
|
+
# target = identify_target(name, target) if identify_target
|
33
|
+
#
|
34
|
+
# source = identify(name, source) if identify && !identify_source
|
35
|
+
# target = identify(name, target) if identify && !identify_target
|
36
|
+
#
|
37
|
+
# return [] if source.nil? or target.nil?
|
38
|
+
# return [] if Array === target and target.empty?
|
39
|
+
# return [] if Array === source and source.empty?
|
40
|
+
#
|
41
|
+
# matches = _subset name, source, target, options
|
42
|
+
#
|
43
|
+
# setup(name, matches)
|
44
|
+
#
|
45
|
+
# matches = matches.select(&block) if block_given?
|
46
|
+
#
|
47
|
+
# matches
|
48
|
+
# end
|
49
|
+
#
|
50
|
+
# def all(name, options={})
|
51
|
+
# repo = get_index name, options
|
52
|
+
# setup name, repo.keys
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# def _children(name, entity)
|
56
|
+
# repo = get_index name
|
57
|
+
# repo.match(entity)
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# def children(name, entity)
|
61
|
+
# entity = identify_source(name, entity)
|
62
|
+
# setup(name, _children(name, entity))
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# def _parents(name, entity)
|
66
|
+
# repo = get_index name
|
67
|
+
# repo.reverse.match(entity)
|
68
|
+
# end
|
69
|
+
#
|
70
|
+
# def parents(name, entity)
|
71
|
+
# entity = identify_target(name, entity)
|
72
|
+
# matches = _parents(name, entity)
|
73
|
+
# #matches.each{|m| m.replace(m.partition("~").reverse*"") } unless undirected(name)
|
74
|
+
# setup(name, matches, true)
|
75
|
+
# end
|
76
|
+
#
|
77
|
+
# def _neighbours(name, entity)
|
78
|
+
# if undirected(name) and source(name) == target(name)
|
79
|
+
# {:children => _children(name, entity)}
|
80
|
+
# else
|
81
|
+
# {:parents => _parents(name, entity), :children => _children(name, entity)}
|
82
|
+
# end
|
83
|
+
# end
|
84
|
+
#
|
85
|
+
# def neighbours(name, entity)
|
86
|
+
# hash = _neighbours(name, entity)
|
87
|
+
# IndiferentHash.setup(hash)
|
88
|
+
# setup(name, hash[:children]) if hash[:children]
|
89
|
+
# setup(name, hash[:parents], true) if hash[:parents]
|
90
|
+
# hash
|
91
|
+
# end
|
92
|
+
#
|
93
|
+
#end
|
94
|
+
#
|