query: SELECT ?item ?qid (GROUP_CONCAT(DISTINCT ?discog) as ?discogs) (GROUP_CONCAT(DISTINCT ?rymurl) as ?rym_url) (GROUP_CONCAT(DISTINCT ?evnurl) as ?evn_url) (GROUP_CONCAT(DISTINCT ?mburl) as ?mb_url) (GROUP_CONCAT(DISTINCT ?amurl) as ?am_url) WHERE {
    BIND( xsd:integer( STRAFTER( STR( ?item ), STR( wd:Q ) ) ) AS ?qid )
    ?item wdt:P31/wdt:P279* wd:Q108676140.
    OPTIONAL {?item wdt:P9218 ?DgID. 
              BIND(CONCAT("[https://www.discogs.com/genre/",?DgID," ",?DgID,"]") as ?DgIDurl)}
    OPTIONAL {?item wdt:P9219 ?DsID. 
              BIND(CONCAT("[https://www.discogs.com/style/",?DsID," ",?DsID,"]") as ?DsIDurl)}
    BIND(IF(BOUND(?DgIDurl) && BOUND(?DsIDurl),concat(?DgIDurl," ",?DsIDurl),
            IF(BOUND(?DgIDurl),?DgIDurl,
              IF(BOUND(?DsIDurl),?DsIDurl,""))) as ?discog) 
    OPTIONAL {?item wdt:P9173 ?rymID.
              BIND(CONCAT("[https://rateyourmusic.com/genre/",?rymID," ",?rymID,"]") as ?rymurl)}
    OPTIONAL {?item wdt:P9881 ?evnID. 
              BIND(CONCAT("[https://everynoise.com/engenremap-",?evnID,".html ",?evnID,"]") as ?evnurl)}
    OPTIONAL {?item wdt:P8052 ?mbID. 
              wd:P8052 rdfs:label ?propItemLabelmb . FILTER (lang(?propItemLabelmb) = "en"). 
              BIND(CONCAT("[https://musicbrainz.org/genre/",?mbID," ID]") as ?mburl)}
    OPTIONAL {?item wdt:P9185 ?amID. 
              wd:P9185 rdfs:label ?propItemLabelam . FILTER (lang(?propItemLabelam) = "en"). 
              BIND(CONCAT("[https://www.allmusic.com/style/",?amID," ID]") as ?amurl)} 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  } group by ?item ?P495 ?P495Label ?qid ORDER BY ?qid