The role of Question Answering is central to the fulfillmentof the Semantic Web. Recently, several approaches relying on artificial neural networks have been proposed to tackle the problem of question answering over knowledge graphs. Such techniques are however known to be data-hungry and the creation of training sets requires a substantial manual effort. We thus introduce DBNQA, a comprehensive dataset of 894,499 pairs of questions and SPARQL queries based on templates which are specifically designed on the DBpedia knowledge base. We show howthe method used to generate our dataset can be easily reused for other purposes. We report the successful adoption of DBNQA in an experimental phase and present how it compares with existing question-answering corpora.