implement getRelations and getRelationIndexes, set structures