It would be really nice to be able to filter objects based on a "count", ie quantity of subquery results. Something like this, to find all RandomSequenceContainers that have 0 children for example:
$ from type randomsequencecontainer select this where children.count = 0