query-f2260829dcdf2caaa2c0a51266fbac0c
TODO
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/>
SELECT ?item ?preferredVersion ?preferredVersionDate ?normalVersion ?normalVersionDate WHERE {
?item p:P348 ?version1stmt .
?version1stmt ps:P348 ?preferredVersion; pq:P577 ?preferredVersionDate; wikibase:rank wikibase:PreferredRank .
MINUS {
VALUES ?devVersion { wd:Q2122918 wd:Q3295609 wd:Q1072356 }
?version1stmt pq:P548 ?devVersion .
}
?item p:P348 ?version2stmt .
?version2stmt ps:P348 ?normalVersion; pq:P577 ?normalVersionDate; wikibase:rank wikibase:NormalRank .
MINUS {
VALUES ?devVersion { wd:Q2122918 wd:Q3295609 wd:Q1072356 }
?version2stmt pq:P548 ?devVersion .
}
FILTER(?preferredVersion != ?normalVersion) .
FILTER(?normalVersionDate > ?preferredVersionDate) .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?devVersion")
v5("?item"):::projected
v4("?normalVersion"):::projected
v1("?normalVersionDate"):::projected
v3("?preferredVersion"):::projected
v2("?preferredVersionDate"):::projected
v6("?version1stmt")
v8("?version2stmt")
c5(["wikibase:PreferredRank"]):::iri
c7(["wikibase:NormalRank"]):::iri
f0[["?normalVersionDate > ?preferredVersionDate"]]
f0 --> v1
f0 --> v2
f1[["?preferredVersion != ?normalVersion"]]
f1 --> v3
f1 --> v4
v5 --"p:P348"--> v6
v6 --"p:statement/P348"--> v3
v6 --"p:qualifier/P577"--> v2
v6 --"wikibase:rank"--> c5
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
bind3[/VALUES ?devVersion/]
bind3-->v9
bind30(["wd:Q2122918"])
bind30 --> bind3
bind31(["wd:Q3295609"])
bind31 --> bind3
bind32(["wd:Q1072356"])
bind32 --> bind3
v6 --"p:qualifier/P548"--> v9
end
v5 --"p:P348"--> v8
v8 --"p:statement/P348"--> v4
v8 --"p:qualifier/P577"--> v1
v8 --"wikibase:rank"--> c7
subgraph minus4["MINUS"]
style minus4 stroke-width:6px,fill:pink,stroke:red;
bind5[/VALUES ?devVersion/]
bind5-->v9
bind50(["wd:Q2122918"])
bind50 --> bind5
bind51(["wd:Q3295609"])
bind51 --> bind5
bind52(["wd:Q1072356"])
bind52 --> bind5
v8 --"p:qualifier/P548"--> v9
end