query-b94d9026b8b1c1b80481e6864c6f6069
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ((xsd:integer(YEAR(?released )/ 10)) * 10 AS ?released_decade) ?convict ?convictLabel ?released ?address ?coords ?pic ?layer WHERE
{
?convict wdt:P31 wd:Q5 .
?convict wdt:P373 'Mug shots from the Register of Returned Convicts of Aberdeen (1869-1939)'. #?commonsCategory .
?convict wdt:P1399 ?crime .
?crime wdt:P279* wd:Q83267 .
?convict p:P793 ?statement .
?statement ps:P793 ?parole.
OPTIONAL{?statement pq:P585 ?released.}
OPTIONAL{?statement pq:P6375 ?address.}
OPTIONAL {?statement pq:P625 ?coords .}
OPTIONAL{?convict wdt:P18 ?pic .}
BIND (?released_decade AS ?layer).
SERVICE wikibase:label {bd:serviceParam wikibase:language "en". }
}
ORDER By ?released
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?address"):::projected
v2("?convict"):::projected
v7("?coords"):::projected
v3("?crime")
v9("?layer"):::projected
v5("?parole")
v8("?pic"):::projected
v1("?released"):::projected
v10("?released_decade")
v4("?statement")
c17(["en"]):::literal
c15(["bd:serviceParam"]):::iri
c7(["wd:Q83267"]):::iri
c2(["wd:Q5"]):::iri
c4(["Mug shots from the Register of Returned Convicts of Aberdeen (1869-1939)"]):::literal
v2 --"p:direct/P31"--> c2
v2 --"p:direct/P373"--> c4
v2 --"p:direct/P1399"--> v3
v3 --"p:direct/P279"--> c7
v2 --"p:P793"--> v4
v4 --"p:statement/P793"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P585".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P6375".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P625".-> v7
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P18".-> v8
end
bind0[/"?released_decade"/]
v10 --o bind0
bind0 --as--o v9
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c15 --"wikibase:language"--> c17
end
bind1[/"http://www.w3.org/2001/XMLSchema#integer(year-from-dateTime(?released) / '10^^xsd:integer') * '10^^xsd:integer'"/]
v1 --o bind1
bind1 --as--o v10