In a first part, I defend that formal semantics can be used as a guide to ontological commitment. Thus, if one endorses an ontological view \(O\) and wants to interpret a formal language \(L\) , a thorough understanding of the relation between semantics and ontology will help us to construct a semantics for \(L\) in such a way that its ontological commitment will be in perfect accordance with \(O\) . Basically, that is what I call constructing formal semantics from an ontological perspective. In the rest of the paper, I develop rigorously and put into practice such a method, especially concerning the interpretation of second-order quantification. I will define the notion of ontological framework: it is a set-theoretical structure from which one can construct semantics whose ontological commitments correspond exactly to a given ontological view. I will define five ontological frameworks corresponding respectively to: (i) predicate nominalism, (ii) resemblance nominalism, (iii) armstrongian realism, (iv) platonic realism, and (v) tropism. From those different frameworks, I will construct different semantics for first-order and second-order languages. Notably I will present different kinds of nominalist semantics for second-order languages, showing thus that we can perfectly quantify over properties and relations while being ontologically committed only to individuals. I will show in what extent those semantics differ from each other; it will make clear how the disagreements between the ontological views extend from ontology to logic, and thus why endorsing an ontological view should have an impact on the kind of logic one should use.