def is_nested(ctx, rp1_uuid, rp2_uuid):
    """Returns True if the two resource providers are related with a :CONTAINS
    relationship. The direction of the relationship doesn't matter.
    """
    query = """
            MATCH p=(rp1 {uuid: '%s'})-[:CONTAINS*]-(rp2 {uuid: '%s'})
            RETURN p
    """ % (rp1_uuid, rp2_uuid)
    result = ctx.tx.run(query).data()
    return bool(result)