Skip to content

Instantly share code, notes, and snippets.

@tmtmtmtm
Created July 6, 2020 13:19
Show Gist options
  • Save tmtmtmtm/1e1a0ff621b9aa03da943c4a90d73fa3 to your computer and use it in GitHub Desktop.
Save tmtmtmtm/1e1a0ff621b9aa03da943c4a90d73fa3 to your computer and use it in GitHub Desktop.
Fix 'position held' qualifiers for merged constituencies
# Update 'position held' statements for Members of the Parliament of Ghana
# to point at the correct constituency items, after merging
#
# wd sparql migrate-merged-constituencies.rq | jq -r '.[] | "\(.ps) P768 \(.old) \(.new)"' | wd update-qualifier --batch --summary "Update constituencies qualifiers after merges"
SELECT DISTINCT ?ps ?id ?old ?new WHERE {
?id p:P39 ?ps .
?ps ps:P39 wd:Q61659845 ; pq:P768 ?old .
?old owl:sameAs ?new .
}
@tmtmtmtm
Copy link
Author

tmtmtmtm commented Jul 6, 2020

I ran a first batch of these as https://editgroups.toolforge.org/b/wikibase-cli/0dcca21f3dfdf/ — there will be more later, after I've merged more items.

@tmtmtmtm
Copy link
Author

tmtmtmtm commented Jul 6, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment