query-b03d062a09443ebcbd5c5893faee93f5
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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:ImageGrid
SELECT DISTINCT ?item ?itemLabel ?seq ?person ?personLabel (SAMPLE(?image_) AS ?image)
WHERE {
{
SELECT (COUNT(DISTINCT(?item1)) AS ?seq) ?item ?person WHERE {
{
SELECT ?item ?person WHERE {
?item wdt:P5008 wd:Q117322976; # item on focus list of the LSESuffrageInterviewsProject
wdt:P31 wd:Q178651 . # item is an interview
?item p:P710 ?statement . # item has a participant statement
?statement ps:P710 ?person . # participant is ?person
?statement pq:P3831 wd:Q55534929. # qualifier object has role is interviewee
?item wdt:P921 ?person . # main subject is same as participant
}
}.
{
SELECT (?item AS ?item1) ?person WHERE{
{
SELECT ?item ?person WHERE {
?item wdt:P5008 wd:Q117322976; # item on focus list of the LSESuffrageInterviewsProject
wdt:P31 wd:Q178651 . # item is an interview
?item p:P710 ?statement . # item has a participant statement
?statement ps:P710 ?person . # participant is ?person
?statement pq:P3831 wd:Q55534929. # qualifier object has role is interviewee
?item wdt:P921 ?person . # main subject is same as participant
}
}.
}
} FILTER (str(?item1) <= str(?item))
} GROUP BY ?item ?person
}
OPTIONAL {
{
SELECT (COUNT(DISTINCT(?item1)) AS ?seq) ?item ?person WHERE {
{
SELECT ?item ?person WHERE {
?item wdt:P5008 wd:Q117322976; # item on focus list of the LSESuffrageInterviewsProject
wdt:P31 wd:Q178651 . # item is an interview
?item p:P710 ?statement . # item has a participant statement
?statement ps:P710 ?person . # participant is ?person
?statement pq:P3831 wd:Q55534929. # qualifier object has role is interviewee
?item wdt:P921 ?person . # main subject is same as participant
}
}.
{
SELECT (?item AS ?item1) ?person WHERE{
{
SELECT ?item ?person WHERE {
?item wdt:P5008 wd:Q117322976; # item on focus list of the LSESuffrageInterviewsProject
wdt:P31 wd:Q178651 . # item is an interview
?item p:P710 ?statement . # item has a participant statement
?statement ps:P710 ?person . # participant is ?person
?statement pq:P3831 wd:Q55534929. # qualifier object has role is interviewee
?item wdt:P921 ?person . # main subject is same as participant
}
}.
}
} FILTER (str(?item1) <= str(?item))
} GROUP BY ?item ?person
}
FILTER (?seq > 1) .
?person wdt:P18 ?img .
BIND( IRI('http://commons.wikimedia.org/wiki/Special:FilePath/Arrow slim right.svg') AS ?image_ ) .
}
OPTIONAL { ?person wdt:P18 ?image_} .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?item ?itemLabel ?person ?personLabel ?seq
ORDER BY xsd:integer(STRAFTER(str(?person), 'Q')) ?item
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?image")
v7("?image_"):::projected
v6("?img")
v2("?item"):::projected
v6("?item1")
v1("?person"):::projected
v6("?seq"):::projected
v5("?statement")
c10(["wd:Q55534929"]):::iri
c14(["bd:serviceParam"]):::iri
c4(["wd:Q117322976"]):::iri
c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q178651"]):::iri
f0[["str(?item1) <= str(?item)"]]
f0 --> v6
f0 --> v2
v2 --"p:direct/P5008"--> c4
v2 --"p:direct/P31"--> c6
v2 --"p:P710"--> v5
v5 --"p:statement/P710"--> v1
v5 --"p:qualifier/P3831"--> c10
v2 --"p:direct/P921"--> v1
v2 --"p:direct/P5008"--> c4
v2 --"p:direct/P31"--> c6
v2 --"p:P710"--> v5
v5 --"p:statement/P710"--> v1
v5 --"p:qualifier/P3831"--> c10
v2 --"p:direct/P921"--> v1
bind1[/"?item"/]
v2 --o bind1
bind1 --as--o v6
bind3[/"count(?item1)"/]
v6 --o bind3
bind3 --as--o v6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
f4[["str(?item1) <= str(?item)"]]
f4 --> v6
f4 --> v2
v2 -."p:direct/P5008".-> c4
v2 --"p:direct/P31"--> c6
v2 --"p:P710"--> v5
v5 --"p:statement/P710"--> v1
v5 --"p:qualifier/P3831"--> c10
v2 --"p:direct/P921"--> v1
v2 --"p:direct/P5008"--> c4
v2 --"p:direct/P31"--> c6
v2 --"p:P710"--> v5
v5 --"p:statement/P710"--> v1
v5 --"p:qualifier/P3831"--> c10
v2 --"p:direct/P921"--> v1
bind5[/"?item"/]
v2 --o bind5
bind5 --as--o v6
bind7[/"count(?item1)"/]
v6 --o bind7
bind7 --as--o v6
v1 --"p:direct/P18"--> v6
bind8[/"'http://commons.wikimedia.org/wiki/Special:FilePath/Arrow slim right.svg'"/]
bind8 --as--o v7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P18".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end
bind10[/"sample(?image_)"/]
v7 --o bind10
bind10 --as--o v8