check first (select.getFirstElement() instanceof Resource)