query-751031142b19183649d72243f1fa43e2
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 schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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#>
#title: First/Sec chamber members pictures "vilde" how they are presented in "Porträttbooks"
#defaultView:ImageGrid
SELECT DISTINCT ?file ?wd ?name ?image (CONCAT(?party," ", ?timevilde) AS ?vilde) (concat("Book published ",str(year(?booktime))) AS ?bookPublished)
WHERE
{
{ SELECT distinct ?wd ?name ?itemDescription ?party ?timevilde ?startvilde ?endvilde WHERE
{
SERVICE <https://query.wikidata.org/sparql>
{
VALUES ?position { wd:Q81531912 wd:Q33071890 }
?wd wdt:P31 wd:Q5;
wdt:P39 ?position.
?wd rdfs:label ?name. FILTER(lang(?name)="sv")
{
?wd p:P102 ?PartyWD.
?PartyWD ps:P102 ?p
OPTIONAL {?PartyWD pq:P580 ?startvilde}
OPTIONAL {?PartyWD pq:P582 ?endvilde}
BIND (concat(str(year(?startvilde))," - ", str(year(?endvilde))) AS ?timevilde)
?p rdfs:label ?party.
FILTER(LANG(?party) ="sv").
FILTER(CONTAINS(?party, 'vilde'))
SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
#FILTER (?wd = wd:Q5555629)
}
}
}
}.
OPTIONAL {?file wdt:P180 ?wd.}
OPTIONAL {
VALUES ?booksP1433 {
wd:Q116445396 # 1894
wd:Q110380539 # 1897
wd:Q110380456 # 1900
wd:Q110375618 # 1903
wd:Q110376088 # 1906
wd:Q116313186 # 1909
}
SERVICE <https://query.wikidata.org/sparql>
{
?booksP1433 wdt:P585 ?booktime
}
FILTER (?startvilde <= ?booktime)
FILTER (?endvilde >= ?booktime)
?file wdt:P1433 ?booksP1433.
?file schema:contentUrl ?url.
bind(iri(concat("http://commons.wikimedia.org/wiki/Special:FilePath/", wikibase:decodeUri(substr(str(?url),53)))) AS ?image)
}
}
order by ?name ?startvilde
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?PartyWD")
v16("?bookPublished")
v12("?booksP1433")
v3("?booktime"):::projected
v4("?endvilde")
v11("?file"):::projected
v14("?image"):::projected
v1("?name"):::projected
v9("?p")
v7("?party"):::projected
v5("?position")
v2("?startvilde")
v10("?timevilde"):::projected
v13("?url")
v15("?vilde")
v6("?wd"):::projected
c13(["bd:serviceParam"]):::iri
c4(["wd:Q5"]):::iri
c15(["sv,en"]):::literal
subgraph s1["https://query.wikidata.org/sparql"]
style s1 stroke-width:4px;
f0[["?name = 'sv'"]]
f0 --> v1
bind1[/VALUES ?position/]
bind1-->v5
bind10(["wd:Q81531912"])
bind10 --> bind1
bind11(["wd:Q33071890"])
bind11 --> bind1
v6 --"p:direct/P31"--> c4
v6 --"p:direct/P39"--> v5
v6 --"rdfs:label"--> v1
f2[["contains(?party,'vilde')"]]
f2 --> v7
f3[["?party = 'sv'"]]
f3 --> v7
v6 --"p:P102"--> v8
v8 --"p:statement/P102"--> v9
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v8 -."p:qualifier/P580".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v8 -."p:qualifier/P582".-> v4
end
bind4[/"concat(str(year-from-dateTime(?startvilde)),' - ',str(year-from-dateTime(?endvilde)))"/]
v2 --o bind4
v4 --o bind4
bind4 --as--o v10
v9 --"rdfs:label"--> v7
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c13 --"wikibase:language"--> c15
end
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v11 -."p:direct/P180".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
bind5[/VALUES ?booksP1433/]
bind5-->v12
bind50(["wd:Q116445396"])
bind50 --> bind5
bind51(["wd:Q110380539"])
bind51 --> bind5
bind52(["wd:Q110380456"])
bind52 --> bind5
bind53(["wd:Q110375618"])
bind53 --> bind5
bind54(["wd:Q110376088"])
bind54 --> bind5
bind55(["wd:Q116313186"])
bind55 --> bind5
subgraph s1["https://query.wikidata.org/sparql"]
style s1 stroke-width:4px;
v12 -."p:direct/P585".-> v3
end
v11 --"p:direct/P1433"--> v12
v11 --"schema:contentUrl"--> v13
bind6[/"concat('http://commons.wikimedia.org/wiki/Special:FilePath/',http://wikiba.se/ontology#decodeUri(substring(str(?url),'53^^xsd:integer')))"/]
v13 --o bind6
bind6 --as--o v14
end
bind7[/"concat(?party,' ',?timevilde)"/]
v7 --o bind7
v10 --o bind7
bind7 --as--o v15
bind8[/"concat('Book published ',str(year-from-dateTime(?booktime)))"/]
v3 --o bind8
bind8 --as--o v16