def collect(tp, *args):
    """
    Decorator to attach a collector function to a triple pattern
    :param tp:
    :param args:
    :return:
    """

    def decorator(f):
        add_triple_pattern(tp, f, args)

    return decorator
Decorator to attach a collector function to a triple pattern
    :param tp:
    :param args:
    :return: