query-17096db6f7e6793a10a0b559d3902713
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#>
SELECT ?item1 ?item1Label ?country1 ?country1Label ?item2 ?item2Label ?country2 ?country2Label ?place ?placeLabel ?startDate ?endDate WHERE {
?item1 wdt:P1412 wd:Q143.
?item1 p:P26 ?statement.
?statement ps:P26 ?item2.
?item2 wdt:P1412 wd:Q143.
OPTIONAL { ?statement pq:P580 ?startDate. }
OPTIONAL { ?statement pq:P582 ?endDate. }
OPTIONAL { ?statement pq:P2842 ?place. }
OPTIONAL { ?item1 wdt:P27 ?country1. }
OPTIONAL { ?item2 wdt:P27 ?country2. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "eo". }
FILTER((STR(?item1)) < (STR(?item2)))
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?country1"):::projected
v8("?country2"):::projected
v5("?endDate"):::projected
v1("?item1"):::projected
v2("?item2"):::projected
v6("?place"):::projected
v4("?startDate"):::projected
v3("?statement")
c10(["bd:serviceParam"]):::iri
c12(["eo"]):::literal
c2(["wd:Q143"]):::iri
f0[["str(?item1) < str(?item2)"]]
f0 --> v1
f0 --> v2
v1 --"p:direct/P1412"--> c2
v1 --"p:P26"--> v3
v3 --"p:statement/P26"--> v2
v2 --"p:direct/P1412"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P580".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P582".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P2842".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P27".-> v7
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P27".-> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end