query-b9f97c0025dc9c00c9afed034f50fb0f
title:Deprecated values sourced with Beweb, and corresponding correct values SELECT DISTINCT ?item ?itemLabel ?pLabel ?deprecatedValueLabel ?BeWeB ?valueToUseLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "it". } ?item ?property ?deprecatedStatement . ?p wikibase:claim ?property ; wikibase:statementProperty ?stprop . ?deprecatedStatement ?stprop ?deprecatedValue ; prov:wasDerivedFrom ?ref ; wikibase:rank wikibase:DeprecatedRank . OPTIONAL { ?item ?property ?normalStatement . ?normalStatement ?stprop ?normalValue ; wikibase:rank wikibase:NormalRank } . OPTIONAL { ?item ?property ?preferredStatement . ?preferredStatement ?stprop ?preferredValue ; wikibase:rank wikibase:PreferredRank } . BIND(COALESCE(?preferredValue,?normalValue) AS ?valueToUse). ?ref pr:P248 wd:Q77541206 . ?ref pr:P7796 ?beweb. wd:P7796 wdt:P1630 ?fmt . BIND(IRI(REPLACE(?beweb, CONCAT('(',?beweb,')'), ?fmt)) AS ?BeWeB) . } ORDER BY ?pLabel
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 prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Deprecated values sourced with Beweb, and corresponding correct values
SELECT DISTINCT ?item ?itemLabel ?pLabel ?deprecatedValueLabel ?BeWeB ?valueToUseLabel
WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "it". }
?item ?property ?deprecatedStatement .
?p wikibase:claim ?property ; wikibase:statementProperty ?stprop .
?deprecatedStatement ?stprop ?deprecatedValue ; prov:wasDerivedFrom ?ref ; wikibase:rank wikibase:DeprecatedRank .
OPTIONAL { ?item ?property ?normalStatement . ?normalStatement ?stprop ?normalValue ; wikibase:rank wikibase:NormalRank } .
OPTIONAL { ?item ?property ?preferredStatement . ?preferredStatement ?stprop ?preferredValue ; wikibase:rank wikibase:PreferredRank } .
BIND(COALESCE(?preferredValue,?normalValue) AS ?valueToUse).
?ref pr:P248 wd:Q77541206 .
?ref pr:P7796 ?beweb.
wd:P7796 wdt:P1630 ?fmt .
BIND(IRI(REPLACE(?beweb, CONCAT('(',?beweb,')'), ?fmt)) AS ?BeWeB) .
}
ORDER BY ?pLabel
Query found at
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/Queries
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/sandbox