This project provides a formal grammar for Overpass Query Language (Overpass QL), written in W3C EBNF - the notation also used in the XML 1.0 specification. It is intended to make the language’s syntax easier to work with: developers can consult it when building tools that generate queries, use it to validate queries before submitting them to an API, or explore the language’s structure. The grammar can be pasted into a railroad-diagram generator for interactive visual diagrams, or used with the REx Parser Generator to create a parser. Adapting it to other EBNF-style parser tools should also be feasible.
The grammar covers features described in the Overpass QL reference, language guide, and API blog, but those documents can be inconsistent. To improve reliability, the rules were checked against the Overpass API implementation and tested on a live instance running version 0.7.62.11. Features supported by the implementation but not documented are deliberately left out, so the grammar represents the documented language rather than every behavior the software may accept. Users are invited to report errors or omissions. The project also cautions against using the grammar to drive high-volume automated requests to public Overpass servers; workloads requiring substantial traffic should instead use a locally operated instance.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.