match (n:Product)-[r:instanceOf]-(m:Category) where exists(n.ID`) and exists(m.ID) return distinct count(n)
This returns the number of relationships in which n and m occurs.
What I want is to find the unique number of n or m where n is instanceOf m and both n & m have the property 'ID'.