def get_quad_tag_parts(reftag:str):
    """
    Return a 4-tuple given a tag
    """

    # Split tag into parts
    tag_parts = reftag.split("/")

    if len(tag_parts) < 3 or len(tag_parts) > 4:
        return None, None, None, None

    tag_prefix = tag_parts[0]
    tag_context_name = tag_parts[1]
    tag_value_name = tag_parts[2]
    tag_comparison = "equals"
    if len(tag_parts) == 4:
        tag_comparison = tag_parts[3]

    return tag_prefix, tag_context_name, tag_value_name, tag_comparison