def get_notes(ref_key, ref_id, **kwargs):
    """
        Get all the notes for a resource, identifed by ref_key and ref_ido.
        Returns [] if no notes are found or if the resource doesn't exist.
    """
    notes = db.DBSession.query(Note).filter(Note.ref_key==ref_key)
    if ref_key == 'NETWORK':
        notes = notes.filter(Note.network_id == ref_id)
    elif ref_key == 'NODE':
        notes = notes.filter(Note.node_id == ref_id)
    elif ref_key == 'LINK':
        notes = notes.filter(Note.link_id == ref_id)
    elif ref_key == 'GROUP':
        notes = notes.filter(Note.group_id == ref_id)
    elif ref_key == 'PROJECT':
        notes = notes.filter(Note.project_id == ref_id)
    elif ref_key == 'SCENARIO':
        notes = notes.filter(Note.scenario_id == ref_id)
    else:
        raise HydraError("Ref Key %s not recognised.")

    note_rs = notes.all()

    return note_rs