How to using Overpass API to combine several relations into a single query

Hi folks,
I used this statement to query the Overpass API for several different tags (railway=station and railway=halt) in the same relation.

[out:json][timeout:120];

relation(4189512);
map_to_area;

nwr[railway=station][usage!=tourism](area)->.stations;
nwr[railway=halt][usage!=tourism](area)->.halts;

//union block statement
(
.stations;
.halts;
);

out center body;

Next I like to combine the following 2 statements for a specific tag (railway=station) that are only distinguished by the relation into a single statement.

  1. Statement:
[out:json][timeout:120];

relation(4189513);
map_to_area;
(
nwr[railway=station][usage!=tourism](area);
);
out center body;
  1. Statement:

[out:json][timeout:120];

relation(4189512);
map_to_area;
(
nwr[railway=station][usage!=tourism](area);
);
out center body;

Does anyone has an idea how to combine these 2 statements into 1 query?

Cheers!

I think it would be something like this?

[out:json][timeout:120];

relation(id:4189513,4189512);
map_to_area;
nwr[railway=station][usage!=tourism](area);
out center body;
 area(id:3604189512,3604189513);
 nwr[railway~"^(station|halt)$"] [usage!=tourism] (area);
 out center;
  1. Many polygon relations are auto converted to area. Calculate the number by adding 3600000000 to the relation id.
  2. Use Regex to return multiple entities. ‘|’ means OR. Note the tilde ‘~. ‘’^’ & ‘$’ means ‘starts & ends with’. Required in the search as there are station named service_stations.
  3. I don’t think body is required when using ‘center’