query-cffb53d3361119ceef1c692badffc511

rq turtle/ttl

TweetsFactsAndQueriesAlso with help from

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#>
# Map of Germanophone Museums by number of sitelinks to different language wikipedias
#defaultView:Map
SELECT ?GLAM ?GLAMLabel ?coord ?layer ?image 
WHERE {
    ?GLAM wdt:P31/wdt:P279* wd:Q33506;                                                    # find all museums
    {?GLAM wdt:P17 wd:Q39} UNION {?GLAM wdt:P17 wd:Q40} UNION  {?GLAM wdt:P17 wd:Q183}    # located in Switzerland, Austria & Germany  

OPTIONAL { ?GLAM wdt:P625 ?coord. }                                                       # get the geographical location, if available
OPTIONAL { ?GLAM wdt:P18 ?image. }                                                        # get an image of the museum, if available

  ?GLAM wikibase:sitelinks ?sitelinks.
  BIND(IF(?sitelinks >= 5, "5+", ?sitelinks) AS ?layer)

SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?GLAM"):::projected v2("?coord"):::projected v3("?image"):::projected v5("?layer"):::projected v4("?sitelinks") a1((" ")) c14(["de"]):::literal c3(["wd:Q33506"]):::iri c6(["wd:Q40"]):::iri c5(["wd:Q39"]):::iri c12(["bd:serviceParam"]):::iri c7(["wd:Q183"]):::iri v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P17"--> c7 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P17"--> c6 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P17"--> c5 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P625".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P18".-> v3 end v1 --"wikibase:sitelinks"--> v4 bind0[/"if(?sitelinks >= '5^^xsd:integer','5+',?sitelinks)"/] v4 --o bind0 bind0 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end