I have raw data in this format:

I need to have sequences like this using Oracle SQL:

Background: Order_Release_Gid starts from LINE and goes to PORT B. This Order will be broken into 7 movement pices as:
Line to Factory Yard
Factory Yard - Factory Yard
Factory Yard - EY1
EY1 -EY1 ...etc
Please provide your sql to solve this. I am also trying and if I will get the solution will post here.
Thank You.