query-b961a5112b3966c4f2dbda656cf289a2
117th Congress replaces/replaced by qualifiers. (P1366)replaced by and (P1365)replaces : I used the following to fill in the Andrew Gray@
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
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#>
SELECT ?sen ?senLabel ?prevSen ?prevSenLabel WHERE {
?sen p:P39 ?ps.
?ps ps:P39 wd:Q4416090;
pq:P2937 wd:Q65089999;
pq:P768 ?district.
?prevSen p:P39 ?ps2.
?ps2 ps:P39 wd:Q4416090;
pq:P2937 wd:Q28227688;
pq:P768 ?district .
FILTER ( ?sen != ?prevSen )
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?district")
v2("?prevSen"):::projected
v3("?ps")
v5("?ps2")
v1("?sen"):::projected
c5(["wd:Q65089999"]):::iri
c7(["wd:Q28227688"]):::iri
c9(["bd:serviceParam"]):::iri
c3(["wd:Q4416090"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?sen != ?prevSen"]]
f0 --> v1
f0 --> v2
v1 --"p:P39"--> v3
v3 --"p:statement/P39"--> c3
v3 --"p:qualifier/P2937"--> c5
v3 --"p:qualifier/P768"--> v4
v2 --"p:P39"--> v5
v5 --"p:statement/P39"--> c3
v5 --"p:qualifier/P2937"--> c7
v5 --"p:qualifier/P768"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end