fix logic translations question

Both parts of the UNION need to
select logic_ids in order to work properly. So
we shall not pass the ontology.id, but the
ontology.logic_id to the query.