Water is observed to be a major constituent of planet-forming disks around young stars and its presence likely plays a major role in formation of planets and their atmospheres, including those destined to orbit in a habitable zone. Yet, the path from disks to planets is one fraught with complexity, making it difficult to derive precise theoretical predictions for planetary chemistry. Planet-forming disks are no longer considered uniform well-mixed structures; rather, they are complex worlds with many different heterogenous environments, most of which play some part in determining the composition of planetesimals and planets. Direct observations of atomic and molecular abundances on all size scales are therefore needed for understanding planet formation at a very fundamental level, and for answering the question of how chemically common the Earth is among exoplanets. In the past years, great progress has been made in observing protoplanetary chemistry, in particular in measuring the molecular composition in protoplanetary disks across the planet-forming regions from 1 to 10s of AU. We will present recent observations of water with Herschel, the VLT and Gemini in disks, and we will demonstrate how we retrieve the local abundances and radial distribution of water vapor and ice using detailed radiative transfer models. We find that most of the oxygen is likely bound in water near 1 AU in disks around solar-mass stars and that the disk surface composition at these radii is likely dominated by local gas-phase chemistry rather than by primordial material delivered from the interstellar medium. We discuss how these observations relate to complementary constraints from the solar system. We further discuss the implications for the observed composition of exoplanetary atmospheres.