MAPPINGS = {
Logic => LogicMapping,
}
TARGET_MAPPINGS = {
}
end
source: nil,
end
@source = source
end
end
else
end
end
@source.
else
@source.
end
end
end
func_stmt = <<-SQL
(SELECT fetch_distributed_graph_data(#{@center.id}))
SQL
edges = on_source(@center.id, '"ontology_id" =')
nodes = on_target(func_stmt)
[nodes, edges]
end
def on_source(stmt, portion='"id" IN')
@source.where("\"#{@source_table}\".#{portion} #{stmt}")
end
def on_target(stmt, portion='"id" IN')
@target.where("\"#{@target_table}\".#{portion} #{stmt}")
end
def build_statement(type = :node)
type = type.to_s
<<-SQL
( SELECT DISTINCT "#{type}_id" FROM fetch_graph_data(#{@center.id}, '#{@source_table}', '#{@target_table}', #{@depth}) )
SQL
end
end