Inlining of expressions and handling WITH in the query graph