Semantic parsing is the process of mapping a natural language sentence into aformal representation of its meaning. In this work we use the neural networkapproach to transform natural language sentence into a query to an ontologydatabase in the SPARQL language. This method does not rely on handcraft-rules,high-quality lexicons, manually-built templates or other handmade complexstructures. Our approach is based on vector space model and neural networks.The proposed model is based in two learning steps. The first step generates avector representation for the sentence in natural language and SPARQL query.The second step uses this vector representation as input to a neural network(LSTM with attention mechanism) to generate a model able to encode naturallanguage and decode SPARQL.