Ontology-Based Data Access (OBDA) has become a popular paradigm for the integration of heterogeneous data. The key components of an OBDA system are the mappings between the data source and the target ontology. The great efforts required to create manual mappings are still a significant barrier to adopting the OBDA. Current relational-to-ontology mapping generators are far from providing 100 % of the mappings required in real-world problems. To overcome this issue we present AutoMap4OBDA, a system which automatically generates R2RML mappings based on the intensive use of relational source contents and features of the target ontology. Ontology learning techniques are applied to infer class hierarchies, the string similarity metrics are selected based on the target ontology labels, and graph structures are applied to generate the mappings. We have used the RODI benchmarking suite to evaluate AutoMap4OBDA which outperforms the most advanced state-of-the-art mapping generators.