query-c754393b267755d2c35c9e79fd869c01
title=Count items with image SELECT (count(DISTINCT ?item) as ?count) WHERE { VALUES ?heritage_designation { wd:Q219538 # Scheduled Monument wd:Q15700818 # Grade I Listed Building wd:Q15700831 # Grade II* Listed Building wd:Q15700834 # Grade II Listed Building wd:Q10729054 # Category A Listed Building wd:Q10729125 # Category B Listed Building wd:Q10729142 # Category C Listed Building wd:Q71055272 # Grade A Listed Building wd:Q71056106 # Grade B Listed Building wd:Q71056072 # Grade C Listed Building } ?item wdt:P1435 ?heritage_designation . ?item wdt:P18 ?image. }
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#title=Count items with image
SELECT (count(DISTINCT ?item) as ?count) WHERE {
VALUES ?heritage_designation
{
wd:Q219538 # Scheduled Monument
wd:Q15700818 # Grade I Listed Building
wd:Q15700831 # Grade II* Listed Building
wd:Q15700834 # Grade II Listed Building
wd:Q10729054 # Category A Listed Building
wd:Q10729125 # Category B Listed Building
wd:Q10729142 # Category C Listed Building
wd:Q71055272 # Grade A Listed Building
wd:Q71056106 # Grade B Listed Building
wd:Q71056072 # Grade C Listed Building
}
?item wdt:P1435 ?heritage_designation .
?item wdt:P18 ?image.
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count")
v1("?heritage_designation")
v3("?image")
v2("?item"):::projected
bind0[/VALUES ?heritage_designation/]
bind0-->v1
bind00(["wd:Q219538"])
bind00 --> bind0
bind01(["wd:Q15700818"])
bind01 --> bind0
bind02(["wd:Q15700831"])
bind02 --> bind0
bind03(["wd:Q15700834"])
bind03 --> bind0
bind04(["wd:Q10729054"])
bind04 --> bind0
bind05(["wd:Q10729125"])
bind05 --> bind0
bind06(["wd:Q10729142"])
bind06 --> bind0
bind07(["wd:Q71055272"])
bind07 --> bind0
bind08(["wd:Q71056106"])
bind08 --> bind0
bind09(["wd:Q71056072"])
bind09 --> bind0
v2 --"wdt:P1435"--> v1
v2 --"wdt:P18"--> v3
bind2[/"count(?item)"/]
v2 --o bind2
bind2 --as--o v4