query-0e9a7c6286eda53c0fafacc75e64aacd
TODO
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?itemLabel
(sample(?image_) as ?image)
(group_concat(distinct ?instanceOfTypeLabel_;separator="; " ) as ?instanceOfTypeLabel)
?location
?inception
(group_concat(distinct ?adminEntityLabel_;separator="; " ) as ?adminEntityLabel)
?historicCountyLabel
WHERE {
SERVICE bd:slice {
?item wdt:P1435 wd:Q15700834.
bd:serviceParam bd:slice.offset 0 . # Start at item number (not to be confused with QID)
bd:serviceParam bd:slice.limit 50000 . # List this many items
}
?item wdt:P18 ?image_.
?item wdt:P31 ?instanceOfType.
?item wdt:P625 ?location.
OPTIONAL { ?item wdt:P571 ?inception . }
OPTIONAL { ?item wdt:P131 ?adminEntity . }
OPTIONAL { ?item wdt:P7959 ?historicCounty . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en".
?item rdfs:label ?itemLabel .
?instanceOfType rdfs:label ?instanceOfTypeLabel_ .
?adminEntity rdfs:label ?adminEntityLabel_ .
?historicCounty rdfs:label ?historicCountyLabel .}
}
GROUP BY ?itemLabel ?location ?inception ?historicCountyLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?adminEntity")
v14("?adminEntityLabel")
v10("?adminEntityLabel_"):::projected
v7("?historicCounty")
v11("?historicCountyLabel"):::projected
v12("?image")
v2("?image_"):::projected
v5("?inception"):::projected
v3("?instanceOfType")
v13("?instanceOfTypeLabel")
v9("?instanceOfTypeLabel_"):::projected
v1("?item")
v8("?itemLabel"):::projected
v4("?location"):::projected
c3(["wd:Q15700834"]):::iri
c17(["en"]):::literal
c6(["0^^xsd:integer"]):::literal
c4(["bd:serviceParam"]):::iri
c8(["50000^^xsd:integer"]):::literal
subgraph s1["http://www.bigdata.com/rdf#slice"]
style s1 stroke-width:4px;
v1 --"wdt:P1435"--> c3
c4 --"bd:slice.offset"--> c6
c4 --"bd:slice.limit"--> c8
end
v1 --"wdt:P18"--> v2
v1 --"wdt:P31"--> v3
v1 --"wdt:P625"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P571".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P7959".-> v7
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c4 --"wikibase:language"--> c17
v1 --"rdfs:label"--> v8
v3 --"rdfs:label"--> v9
v6 --"rdfs:label"--> v10
v7 --"rdfs:label"--> v11
end
bind3[/"sample(?image_)"/]
v2 --o bind3
bind3 --as--o v12
bind4[/"?instanceOfTypeLabel_"/]
v9 --o bind4
bind4 --as--o v13
bind5[/"?adminEntityLabel_"/]
v10 --o bind5
bind5 --as--o v14