SELECT?era?eraLabel(YEAR(?start_time)AS?start)(YEAR(?end_time)AS?end)?subera?suberaLabel(YEAR(?sub_start_time)AS?sub_start)(YEAR(?sub_end_time)AS?sub_end)WHERE{?erawdt:P31wd:Q11514315;wdt:P361wd:Q130436;# eras of the history of Japanwdt:P580?start_time.MINUS{?erawdt:P2348[]}# exclude sub-erasOPTIONAL{?erawdt:P582?end_time}OPTIONAL{?suberawdt:P2348?era;wdt:P361wd:Q130436;wdt:P580?sub_start_time;wdt:P582?sub_end_time}SERVICEwikibase:label{bd:serviceParamwikibase:language"[AUTO_LANGUAGE],en"}}ORDER BY?startDESC(?end)