In https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example

there is an example as shown below in the code section. I would like to know what is

and b.u?


foreach .a -> .b (
  rel.a(if:t[wikidata] == b.u(t[wikidata]))->.d;
  rel.d(if: id() == d.min(id()) && d.count(relations) > 1 );
  convert rel ::id = _.u(id()),
             wikidata = _.u(t[wikidata]),
             all_relation_ids = d.set( id() );
  (._ ; .result; ) -> .result;

.result out;

1 Answer 1


These are just arbitrary names for sets. Sets contain OSM elements such as nodes, ways and relations. If you don't specify an explicit set name then the default set named _ will be used.

From your example: Set a is populated by this line:


Then it will loop through set a and populate set b:

foreach .a -> .b (

Inside the loop, a set d gets created:

rel.a(if:t[wikidata] == b.u(t[wikidata]))->.d;
  • what is u then please
    – Amrmsmb
    Commented Mar 8, 2021 at 9:39
  • 1
    u is an aggregator function for sets. In my opinion, Overpass QL has a rather poor naming scheme. At least for some operations.
    – scai
    Commented Mar 8, 2021 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.