I can’t even tell you how important it is that you can realize that. Most people can’t seem to overcome that obstacle.
In order to know if rights are being violated - in other words, would the builder being acting rightfully or wrongfully if he were to build a dam - we need to know what the rights of the owners are. I don’t know if you have read these, but I very strongly recommend reading the following links if you haven’t already:
A Praxeological Account of Law
Crusoe, Morality, and Axiomatic Libertarianism
Depending upon how the owners come to own the various parts of the river, there may be no one size fits all rule for all rivers and free societies.