Skip to content

Commit b21ed7a

Browse files
Create statement-count-generator
1 parent 4bfdd8e commit b21ed7a

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# prefixes
2+
PREFIX wd: <https://catalog.digital-scriptorium.org/entity/>
3+
PREFIX wds: <https://catalog.digital-scriptorium.org/entity/statement/>
4+
PREFIX wdv: <https://catalog.digital-scriptorium.org/value/>
5+
PREFIX wdt: <https://catalog.digital-scriptorium.org/prop/direct/>
6+
PREFIX p: <https://catalog.digital-scriptorium.org/prop/>
7+
PREFIX ps: <https://catalog.digital-scriptorium.org/prop/statement/>
8+
PREFIX pq: <https://catalog.digital-scriptorium.org/prop/qualifier/>
9+
PREFIX wikibase: <http://wikiba.se/ontology#>
10+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
11+
12+
SELECT (COUNT(?string) AS ?stringCount)
13+
# declared variable that will be counted and passed to another variable to display as a number
14+
15+
WHERE {
16+
?stringStatement ps:P10 ?string .
17+
# use "as recorded" property P-value for the data you want to count
18+
19+
SERVICE wikibase:label {
20+
bd:serviceParam wikibase:language "en" .
21+
# allows English language labels to be returned for Wikibase items
22+
}
23+
}
24+
GROUP BY (?stringCount)
25+
# this sorts the results by number, and is necessary for COUNT clauses

0 commit comments

Comments
 (0)