query-5f9d8651e9da15c82dc5e4260598e56b

rq turtle/ttl

Every state library association website (http://librarian.net/stax/4920/every-state-library-association-website/) SELECT distinct ?item ?itemLabel ?acronymLabel ?websiteLabel WHERE { ?item wdt:P31 wd:Q856564. #Q856564 = library association ?item wdt:P17 wd:Q30 . #Q30 = United States of America OPTIONAL { ?item wdt:P1813 ?acronym} OPTIONAL { ?item wdt:P856 ?website} SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } ORDER BY ?itemLabel

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#>
#Every state library association website (http://librarian.net/stax/4920/every-state-library-association-website/)
  SELECT distinct ?item ?itemLabel ?acronymLabel ?websiteLabel
  WHERE 
  {
     ?item wdt:P31 wd:Q856564. #Q856564 = library association
     ?item wdt:P17 wd:Q30 . #Q30 = United States of America
    OPTIONAL {  ?item wdt:P1813 ?acronym}
    OPTIONAL {  ?item wdt:P856 ?website}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  }
  ORDER BY ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?acronym") v2("?item"):::projected v1("?itemLabel"):::projected v4("?website") c2(["wd:Q856564"]):::iri c8(["bd:serviceParam"]):::iri c4(["wd:Q30"]):::iri c10(["en"]):::literal v2 --"wdt:P31"--> c2 v2 --"wdt:P17"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1813".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P856".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end