sort tables, add rels from CoRE