Construct URL from raw query