query-0cb592c56806fded617fb6500819302f

rq turtle/ttl

title: Social media accounts and official websites of Boston public artists select ?artist ?artistLabel ?instagramURL ?twitterURL ?homepageURL where { wd:P2003 wdt:P1630 ?instaFormatterURL. wd:P2002 wdt:P1630 ?twitterFormatterURL. ?artist wdt:P5008 wd:Q108040915; wdt:P31 wd:Q5. optional{?artist wdt:P2003 ?instaHandle.} optional{?artist wdt:P2002 ?twitterHandle.} optional{?artist wdt:P856 ?homepageURL.} BIND(IRI(REPLACE(?instaHandle, '^(.+)$', ?instaFormatterURL)) AS ?instagramURL). BIND(IRI(REPLACE(?twitterHandle, '^(.+)$', ?twitterFormatterURL)) AS ?twitterURL). SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } order by ?artistLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Social media accounts and official websites of Boston public artists
select ?artist ?artistLabel ?instagramURL ?twitterURL ?homepageURL where {
  wd:P2003 wdt:P1630 ?instaFormatterURL.
  wd:P2002 wdt:P1630 ?twitterFormatterURL.
  ?artist wdt:P5008 wd:Q108040915; 
          wdt:P31 wd:Q5.
  optional{?artist wdt:P2003 ?instaHandle.}
  optional{?artist wdt:P2002 ?twitterHandle.}
  optional{?artist wdt:P856 ?homepageURL.}
  BIND(IRI(REPLACE(?instaHandle, '^(.+)$', ?instaFormatterURL)) AS ?instagramURL).
  BIND(IRI(REPLACE(?twitterHandle, '^(.+)$', ?twitterFormatterURL)) AS ?twitterURL).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?artistLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?artist"):::projected v1("?artistLabel"):::projected v7("?homepageURL"):::projected v2("?instaFormatterURL") v5("?instaHandle") v8("?instagramURL"):::projected v3("?twitterFormatterURL") v6("?twitterHandle") v9("?twitterURL"):::projected c1(["wd:P2003"]):::iri c3(["wd:P2002"]):::iri c12(["bd:serviceParam"]):::iri c5(["wd:Q108040915"]):::iri c7(["wd:Q5"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal c1 --"wdt:P1630"--> v2 c3 --"wdt:P1630"--> v3 v4 --"wdt:P5008"--> c5 v4 --"wdt:P31"--> c7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P2003".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P2002".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P856".-> v7 end bind0[/"replace(?instaHandle,'^(.+)$',?instaFormatterURL)"/] v5 --o bind0 v2 --o bind0 bind0 --as--o v8 bind1[/"replace(?twitterHandle,'^(.+)$',?twitterFormatterURL)"/] v6 --o bind1 v3 --o bind1 bind1 --as--o v9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end