  This paper considers the problem of minimizing the ordered weighted average
(or ordered median) function of finitely many rational functions over compact
semi-algebraic sets. Ordered weighted averages of rational functions are not,
in general, neither rational functions nor the supremum of rational functions
so that current results available for the minimization of rational functions
cannot be applied to handle these problems. We prove that the problem can be
transformed into a new problem embedded in a higher dimension space where it
admits a convenient representation. This reformulation admits a hierarchy of
SDP relaxations that approximates, up to any degree of accuracy, the optimal
value of those problems. We apply this general framework to a broad family of
continuous location problems showing that some difficult problems (convex and
non-convex) that up to date could only be solved on the plane and with
Euclidean distance, can be reasonably solved with different $\ell_p$-norms and
in any finite dimension space. We illustrate this methodology with some
extensive computational results on location problems in the plane and the
3-dimension space.
