Implement query of items and collections

hi! care for a pull request?