Migrate dbpedia queries used by phone endpoint to helper function