add ability to get declarations from rule by query