query-9e1d62c1ce49647e7fe8af77c847edb9

rq turtle/ttl

Redirects on Commons statements. Querry (P180)depicts . Eventually I would like to look for redirects in any property of Item type, but I first tried checking just this one I just replacedI am trying to come up with some queries on Commons to find and replace redirected wikidata items, like

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT  ?file ?redirect_from ?redirect_to
{
  ?file wdt:P180 ?redirect_from . 
  SERVICE <https://query.wikidata.org/sparql> {
      ?redirect_from owl:sameAs ?redirect_to .
      FILTER( ?redirect_from != ?redirect_to  ) .
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?file"):::projected v2("?redirect_from"):::projected v3("?redirect_to"):::projected v1 --"wdt:P180"--> v2 subgraph s1["https://query.wikidata.org/sparql"] style s1 stroke-width:4px; f0[["?redirect_from != ?redirect_to"]] f0 --> v2 f0 --> v3 v2 --"owl:sameAs"--> v3 end