query-4779684a63b9fe532dba13ec4af3a1dc
Propertiesinstance of (P31)subclass of (P279)X username (P2002)country (P17)Facebook username (P2013)Instagram username (P2003)
Use at
- https://query.wikidata.org/sparql
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#>
SELECT DISTINCT ?museum ?museumLabel ?countryLabel (URI(CONCAT("https://www.facebook.com/",?facebook)) AS ?facebooklink) (URI(CONCAT("https://www.instagram.com/",?instagram)) AS ?instagramlink) (URI(CONCAT("https://twitter.com/",?twitter)) AS ?twitterlink)
WHERE {
?museum wdt:P31/wdt:P279* wd:Q33506;
wdt:P2002 ?twitter.
OPTIONAL { ?museum wdt:P17 ?country}
OPTIONAL { ?museum wdt:P2013 ?facebook}
OPTIONAL { ?museum wdt:P2003 ?instagram}
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en,nl,fr,de,es,pt,bg,be,ru,hu,uk,ja"}
} ORDER BY ?countryLabel ?museumLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?country")
v1("?countryLabel"):::projected
v6("?facebook"):::projected
v8("?facebooklink")
v7("?instagram"):::projected
v9("?instagramlink")
v3("?museum"):::projected
v2("?museumLabel"):::projected
v4("?twitter"):::projected
v10("?twitterlink")
a1((" "))
c3(["wd:Q33506"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,mul,en,nl,fr,de,es,pt,bg,be,ru,hu,uk,ja"]):::literal
v3 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v3 --"wdt:P2002"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P17".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P2013".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P2003".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind0[/"concat('https://www.facebook.com/',?facebook)"/]
v6 --o bind0
bind0 --as--o v8
bind1[/"concat('https://www.instagram.com/',?instagram)"/]
v7 --o bind1
bind1 --as--o v9
bind2[/"concat('https://twitter.com/',?twitter)"/]
v4 --o bind2
bind2 --as--o v10