Thanks @joe.depeau, that query is indeed the one I was looking for. I now have a related performance issue though which I created a separate post for: How to improve the performance of a query that compares properties relative to other nodes?. Any help there would be much appreciated.