def is_predicate_equal_to_vocab(predicate: str, vocab_term: str) -> bool:
    """
    fast regex check for vocab terms that starts or ends with a *
    Quickly checks, whether the predicate is a direct match to the vocab term
    :param predicate: the predicate
    :param vocab_term: a vocab term (may starting and/or ending with *)
    :return: true if both are equal
    """
    if vocab_term.startswith('*') and predicate.endswith(vocab_term[1:]):
        return True
    if vocab_term.endswith('*') and predicate.startswith(vocab_term[:-1]):
        return True
    if vocab_term.startswith('*') and vocab_term.endswith('*') and vocab_term[1:-1] in predicate:
        return True
    if vocab_term == predicate:
        return True
    return False