query-265cc21333879f546e11e725bb5e861e
Number of Facebook IDs versus number of Twitter IDs for things that are not people
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 ?type ?typeLabel ((COUNT(?tw)) AS ?twitter) (COUNT(?fb) AS ?facebook) WHERE {
{?t wdt:P2002 ?tw} UNION {?t wdt:P2013 ?fb}
?t wdt:P31 ?type.
FILTER (?type != wd:Q5)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?type ?typeLabel
ORDER BY DESC(?twitter)
LIMIT 80
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?facebook")
v5("?fb"):::projected
v3("?t")
v4("?tw"):::projected
v6("?twitter")
v2("?type"):::projected
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?type != 'wd:Q5'"]]
f0 --> v2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P2013"--> v5
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P2002"--> v4
end
union0r <== or ==> union0l
end
v3 --"wdt:P31"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind3[/"count(?tw)"/]
v4 --o bind3
bind3 --as--o v6
bind4[/"count(?fb)"/]
v5 --o bind4
bind4 --as--o v6