count statistics for entities and relations