created the query to search freebase database