2-pass parsing to read all relations before ways