prefix dct: SELECT DISTINCT ?country_in_year ?year ?country ?entrant WHERE { ?countries_in_esc_by_year skos:broader dbc:Countries_in_the_Eurovision_Song_Contest_by_year. ?country_in_year dct:subject ?countries_in_esc_by_year. bind( REPLACE(str(?country_in_year), ".*(\\d{4})", "$1") as ?year). FILTER ( xsd:integer(?year) < 2020). ?country_in_year dbp:country ?country. ?country_in_year dbp:entrant ?entrant FILTER (isLITERAL(?entrant)). ?country_in_year dbp:song ?song. } ORDER BY ASC(?countries_in_esc_by_year)