query-1af281d55e0888e9f81ab74cd3ea3b78
DiscussionI believe I can use the following SPARQL to get a list of items to update:
Use at
- https://query.wikidata.org/sparql
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
SELECT DISTINCT ?item ?id WHERE {
?item ?prop ?claim.
?claim prov:wasDerivedFrom [ pr:P248 wd:Q104074149 ; pr:P854 ?url ].
BIND (REPLACE(STR(?url),"^.*/([0-9]+)[-/].*$","$1") as ?id)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?claim")
v5("?id"):::projected
v1("?item"):::projected
v2("?prop")
v4("?url")
a1((" "))
c2(["wd:Q104074149"]):::iri
v1 -->v2--> v3
a1 --"pr:P248"--> c2
a1 --"pr:P854"--> v4
v3 --"prov:wasDerivedFrom"--> a1
bind0[/"replace(str(?url),'^.*/(#91;0-9#93;+)#91;-/#93;.*$','$1')"/]
v4 --o bind0
bind0 --as--o v5