I use Overpass-Turbo with this XML script to download buildings in a given area:
<osm-script>
<union>
<query type="way">
<has-kv k="building"/>
<bbox-query {{bbox}}/>
</query>
<query type="relation">
<has-kv k="building"/>
<bbox-query {{bbox}}/>
</query>
</union>
<print mode="body"/>
<recurse type="down"/>
<print mode="skeleton" order="quadtile"/>
</osm-script>
The building are well downloaded except those with a hole inside. Like the following example, these buildings are multipolygon relations (but not tagged building=yes) composed of an outer tagged building=yes and an inner not tagged.
When I use my Overpass script, I only get the outer.
So, are these building correct? Shouldn't the relation also be tagged as building?
Else does anyone know how to select the relation from its outer building child?
The query is correct and also returns the "holes", i.e. the ways of the relation with role inner.
See this example. The result contains relation 7621, the outer way 23316006 as well as both inner ways 23316007 and 23316008.
It is also correct that both the relation itself as well as the inner ways don't (and shouldn't) have any building tag. See multipolygon relations in the OSM wiki for more information.
You haven't told us which application has problems with the result. It might be possible that this application has no or incomplete support for multipolygon relations.
Edit: Try the following query:
<osm-script>
<union>
<query type="way">
<has-kv k="building"/>
<bbox-query {{bbox}}/>
</query>
<query type="relation">
<has-kv k="building"/>
<bbox-query {{bbox}}/>
</query>
</union>
<print mode="body"/>
<recurse type="up"/>
<recurse type="down"/>
<print mode="skeleton" order="quadtile"/>
</osm-script>
The only difference to your query is the additional <recurse type="up"/>
call.
Another edit: If I understood correctly the first recursion step is modifying the temporary data and thus "breaking" the second recursion step. Try the following query instead:
<osm-script>
<query type="way">
<has-kv k="building"/>
<bbox-query {{bbox}}/>
</query>
<union>
<item/>
<recurse type="up"/>
</union>
<union>
<item/>
<recurse type="down"/>
</union>
<print mode="body"/>
</osm-script>