Need help with Overpass Turbo relations query

I am trying to get a list of all rivers that are not in relations. This returns both, ways that are in relations, and are not.

Any general hints how to debug this (get partial printout for each step, etc).
Are there online tools that help construct OT queries?

[out:json][timeout:120][maxsize:1073741824];

area[name="Rhode Island"]->.searchArea;

// Find all named streams & store in all_ways
way[waterway=river][name](area.searchArea)->.all_ways;

// Based all_ways -> relations of type:waterway
rel[waterway](area.searchArea)(br.all_ways);

// from those relations, exact ways, store in relation_ways
way[waterway][name](r)(area.searchArea)->.relation_ways;

// get the interesting subset
(.all_ways; - .relation_ways; );

// convert nodes to ways
(._;>;);

out body;

>;
out skel qt;

That should be (bw.all_ways). br is backward from relations and bw is backward from ways. There are no relations in the set all_ways.

As to debugging, I tend to add out count; at various places to see if I have the expected number of items.

2 Likes