query-c2d1a9d5c9df73c4959899e62e3588a9
Image gallery of notable manuscripts (which have an image on Wikimedia Commons)
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 schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:ImageGrid
SELECT ?link (MIN(?image) AS ?img) ?qLabel (COUNT(DISTINCT ?sitelink) AS ?linkcount) WHERE {
?q (wdt:P31/wdt:P279*) wd:Q87167.
FILTER (?q != wd:Q145780) # Exclude Dead Sea Scrolls: too broad
?sitelink schema:about ?q.
?q wdt:P18 ?image.
BIND(URI(CONCAT("http://example.org/test/manuscripts/index.php?q=manuscript/",SUBSTR(STR(?q),32))) AS ?link)
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?q rdfs:label ?qLabel.
}
}
GROUP BY ?link ?qLabel
ORDER BY DESC(?linkcount)
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?image"):::projected
v7("?img")
v5("?link"):::projected
v8("?linkcount")
v2("?q")
v6("?qLabel"):::projected
v3("?sitelink"):::projected
a1((" "))
c4(["wd:Q87167"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?q != 'wd:Q145780'"]]
f0 --> v2
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
v3 --"schema:about"--> v2
v2 --"wdt:P18"--> v4
bind1[/"concat('http://example.org/test/manuscripts/index.php?q=manuscript/',substring(str(?q),'32^^xsd:integer'))"/]
v2 --o bind1
bind1 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
v2 --"rdfs:label"--> v6
end
bind4[/"min(?image)"/]
v4 --o bind4
bind4 --as--o v7
bind5[/"count(?sitelink)"/]
v3 --o bind5
bind5 --as--o v8