Nowadays there are many proposals that allow users to perform fuzzy queries on relational databases. Regardless of these proposals, fuzzy queries are really useful on scalar values where fuzzy sets can be adjusted to the user needs and domains, but non-scalar values are a more complex task. Here, we extend non-scalar attribute management in fuzzy queries with the use of ontologies. Thus, we allow to compute this kind of queries not only with the similarity relationships defined explicitly on a fuzzy set but with semantically interrelated terms modeled as a domain ontology as well. Moreover, we present the architecture of a novel system that combines both techniques to return an answer as much complete as possible and ordered by a degree of accomplishment. Finally, a qualitative and quantitative study about the use of flexible queries on relational databases is included in this work, as well. (C) 2016 Elsevier Inc. All rights reserved.