A median graph G is a graph where, for any three vertices u, v and w, there is a unique node that lies on a shortest path from u to v, from u to w, and from v to w. While not obvious from the definition, median graphs are partial cubes; that is, they can be isometrically embedded in hypercubes and, consequently, in integer lattices. The isometric and lattice dimensions of G, denoted as dimI(G) and dimZ(G), are the smallest integers k and r so that G can be isometrically embedded in the k-dimensional hypercube and the r-dimensional lattice respectively. Motivated by recent results on the cover graphs of distributive lattices, we study these parameters through median semilattices, a class of ordered structures related to median graphs. We show that not only does this approach provide new combinatorial characterizations for dimI(G) and dimZ(G), they also have nice algorithmic consequences. Assume G has n vertices and m edges. We prove that dimI(G) can be computed in O(n + m) time, and an isometric embedding of G on a hypercube with dimension dimI(G) can be constructed in O(n × dimI(G)) time. The algorithms are extremely simple and the running times are optimal. We also show that dimZ(G) can be computed and an isometric embedding of G on a lattice with dimension dimZ(G) can be constructed in \(O( n \times dim_I(G) + dim_I(G)^{2.5})\) time by using an existing algorithm of Eppstein’s that performs the same tasks for partial cubes. We are able to speed up his algorithm by using our framework to provide a new “interpretation” to the algorithm. In particular, we note that its main part is essentially a generalization of Fulkerson’s method for finding a smallest-sized chain decomposition of a poset.