@staticmethod
def __find_clause(query, clause):
    """
        checks if a sparql query already has some clause. Useful when trying to batch retrieve the results
        :param query: the sparql query string
        :return: -1 if the clause does not exist or the range of the number after the clause
        """
    clause = ' {} '.format(clause.strip().lower())
    query = query.lower().replace('\n', ' ')
    pos = query.find(clause)
    if pos == -1:
        return -1, -1
    else:
        i = pos + len(clause)
        while i < len(query) and query[i].isdigit():
            i += 1
        return pos + len(clause), i
