SELECT ?countries_in_esc_by_year ?country_in_year (?year AS ?Year) (?country AS ?Country) ?entrant (?entrant_label AS ?Creator) ?song (?song_label AS ?Title) (?was_derived_from AS ?WikipediaURL) 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. ?entrant rdfs:label ?entrant_label FILTER (lang(?entrant_label) = 'en'). ?country_in_year dbp:song ?song. ?song rdfs:label ?song_label_raw FILTER (lang(?song_label_raw) = 'en'). BIND(REPLACE(?song_label_raw, "\\s*\\(.*?song\\)$", "", "i") AS ?song_label). OPTIONAL { ?song prov:wasDerivedFrom ?was_derived_from } } ORDER BY ASC(?countries_in_esc_by_year) ?country