query-7adb3a99504b49219ce1e13dc5cabd89

rq turtle/ttl

Motivation ]reply[10:18, 19 June 2019 (UTC)) talk (EurohunterProperty for artists included in BBC. This SPARQL query will generate links to both Musicbrainz and BBC Music for Basshunter ]reply[19:54, 24 June 2019 (UTC)) talk (Eurohunter: I didn't knew about it. You are right. How I can use it? Do you know examples? Piecesofuk@ ]reply[18:14, 24 June 2019 (UTC)) talk (Piecesofuk (P434)MusicBrainz artist ID . There is a third-party formatter URL for BBC Music on https://www.bbc.co.uk/blogs/bbcinternet/2008/07/bbc_music_artist_pages_beta.html I believe the BBC artist ID is identical to the MusicBrainz ID, see for example Oppose ]reply[06:38, 20 June 2019 (UTC)) talk (David Support

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?mb_URL ?bbc_URL WHERE {
  wd:Q383541 wdt:P434 ?mb_id .  # get BassHunter's MusicBrainz id

  # generate MusicBrainz URL
  wd:P434 p:P1630 ?stmt .
  ?stmt ps:P1630 ?mb_formatter .
  ?stmt pq:P137 wd:Q14005 .   # operator MusicBrainz
  BIND(IRI(REPLACE(?mb_id, '^(.+)$', ?mb_formatter)) AS ?mb_URL).

  # generate BBC Music URL
  wd:P434 p:P3303 ?stmt1 .
  ?stmt1 ps:P3303 ?mb_bbc_formatter .
  ?stmt1 pq:P137 wd:Q4834855 . # operator BBC Music
  BIND(IRI(REPLACE(?mb_id, '^(.+)$', ?mb_bbc_formatter)) AS ?bbc_URL).
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?bbc_URL"):::projected v4("?mb_URL"):::projected v6("?mb_bbc_formatter") v3("?mb_formatter") v1("?mb_id") v2("?stmt") v5("?stmt1") c7(["wd:Q14005"]):::iri c3(["wd:P434"]):::iri c10(["wd:Q4834855"]):::iri c1(["wd:Q383541"]):::iri c1 --"p:direct/P434"--> v1 c3 --"p:P1630"--> v2 v2 --"p:statement/P1630"--> v3 v2 --"p:qualifier/P137"--> c7 bind0[/"replace(?mb_id,'^(.+)$',?mb_formatter)"/] v1 --o bind0 v3 --o bind0 bind0 --as--o v4 c3 --"p:P3303"--> v5 v5 --"p:statement/P3303"--> v6 v5 --"p:qualifier/P137"--> c10 bind1[/"replace(?mb_id,'^(.+)$',?mb_bbc_formatter)"/] v1 --o bind1 v6 --o bind1 bind1 --as--o v7