query-794d50c70c17dd2b54ecb8e54f00c2c5
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT (year(?date) AS ?year) ?old_work ?old_workLabel (GROUP_CONCAT(DISTINCT ?old_lang_label; SEPARATOR = ' / ') AS ?old_langs)
(GROUP_CONCAT(DISTINCT ?new_lang_label; SEPARATOR = ' / ') AS ?new_langs) ?new_work ?new_workLabel (year(?new_date) AS ?new_year)
WHERE {
?new_work wdt:P629 ?old_work .
?new_work wdt:P407 ?new_lang .
?old_work wdt:P407 ?old_lang .
FILTER (?new_lang != ?old_lang) .
OPTIONAL {?old_work wdt:P577 ?date} .
OPTIONAL {?old_work wdt:P571 ?date} .
OPTIONAL {?new_work wdt:P577 ?new_date} .
OPTIONAL {?new_work wdt:P571 ?new_date} .
?new_lang rdfs:label ?new_lang_label FILTER(lang(?new_lang_label) = 'en') .
?old_lang rdfs:label ?old_lang_label FILTER(lang(?old_lang_label) = 'en') .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,de,it,es,nl,la,pl,ru,uk". }
} GROUP BY ?date ?old_work ?old_workLabel ?new_work ?new_workLabel ?new_date
ORDER BY ?year str(?old_workLabel) str(?old_work) ?new_year str(?new_workLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v11("?date"):::projected
v12("?new_date"):::projected
v8("?new_lang")
v7("?new_lang_label"):::projected
v14("?new_langs")
v10("?new_work"):::projected
v5("?new_workLabel"):::projected
v15("?new_year")
v9("?old_lang")
v6("?old_lang_label"):::projected
v13("?old_langs")
v3("?old_work"):::projected
v2("?old_workLabel"):::projected
v13("?year")
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en,fr,de,it,es,nl,la,pl,ru,uk"]):::literal
f0[["?old_lang_label = 'en'"]]
f0 --> v6
f1[["?new_lang_label = 'en'"]]
f1 --> v7
f2[["?new_lang != ?old_lang"]]
f2 --> v8
f2 --> v9
v10 --"wdt:P629"--> v3
v10 --"wdt:P407"--> v8
v3 --"wdt:P407"--> v9
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P577".-> v11
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P571".-> v11
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v10 -."wdt:P577".-> v12
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v10 -."wdt:P571".-> v12
end
v8 --"rdfs:label"--> v7
v9 --"rdfs:label"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind5[/"year-from-dateTime(?date)"/]
v11 --o bind5
bind5 --as--o v13
bind6[/"?old_lang_label"/]
v6 --o bind6
bind6 --as--o v13
bind7[/"?new_lang_label"/]
v7 --o bind7
bind7 --as--o v14
bind8[/"year-from-dateTime(?new_date)"/]
v12 --o bind8
bind8 --as--o v15