query-3bcc53e68ae9162fdc6291e68f708dee
Finding databases from different countries
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 ?item ?itemLabel ?ctryLabel ?fowLabel (COUNT(DISTINCT ?p) AS ?size)
WHERE {
?item wdt:P31/wdt:P279* wd:Q8513.
?item wdt:P17 ?ctry.
OPTIONAL {?item wdt:P101 ?fow.}
?item ?p ?v.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?item ?itemLabel ?ctryLabel ?fowLabel
ORDER BY ?ctryLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?ctry")
v1("?ctryLabel"):::projected
v4("?fow")
v2("?item"):::projected
v5("?p"):::projected
v7("?size")
v6("?v")
a1((" "))
c7(["bd:serviceParam"]):::iri
c9(["en"]):::literal
c3(["wd:Q8513"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P17"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P101".-> v4
end
v2 -->v5--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end
bind1[/"count(?p)"/]
v5 --o bind1
bind1 --as--o v7