Practical – Personalising a SPARQL query and mass edits

We’ve created some SPARQL queries recently which demonstrate the information Wikidata possesses about alumni from the University of Edinburgh.

Map of University of Edinburgh alumni by place of birth.

Timeline of University of Edinburgh alumni by date of birth.

Timeline of works by Robert Louis Stevenson.

It is very easy to amend these queries to display different results by virtue of changing one aspect; the institution.

  1. You will each be allocated a university from the list below. Look up the unique Q number for the institution you have been allocated on Wikidata. Copy the Q number.
  2. Then click on the map link above to swap out the University of Edinburgh’s unique Q number (Q160302) with the new Q number. Hit run.
  3. Copy the link to export the result onto the Etherpad sheet. Give it a name e.g University of York – map of alumni.


  1. University of York (Q967165) – Petscan.
  2. University of Bristol – Petscan
  3. University of Oxford – Petscan
  4. University of Cambridge – Petscan
  5. University of Glasgow – Petscan
  6. University of St. Andrews – Petscan
  7. University of Teesside – Petscan
  8. University of Trinity College, Dublin – Petscan
  9. University of Dundee – Petscan
  10. University of Heriot-Watt – Petscan
  11. University of Edinburgh Napier – Petscan
  12. Queen’s University Belfast – Petscan
  13. University of Strathclyde – Petscan
  14. Glasgow Caledonian University – Petscan
  15. University of Stirling – Petscan
  16. University of Manchester – Petscan
  17. University of Plymouth – Petscan
  18. University of Northampton – Petscan
  19. London Metropolitan University – Petscan
  20. University of Liverpool – Petscan
  21. University of Leeds – Petscan
  22. University of East Anglia – Petscan
  23. University of Exeter – Petscan
  24. University of Sheffield – Petscan
  25. Cardiff University – Petscan
  26. Aberystwyth University – Petscan
  27. Bath Spa University – Petscan
  28. Swansea University – Petscan


Mass editing Wikidata.

Petscan is a very useful tool. In the above links, I have asked Petscan to show me Wikipedia articles on that exist in a Wikipedia category of ‘Alumni of xxxxxxx’. I have then filtered the result to show me only those Wikipedia pages from that category where there is a Wikidata item for that person BUT no Place of Education (P69) statement.


Using this information, I can copy the resulting information into a Google spreadsheet and arrange it in a format that Wikidata can import via the QuickStatements tool. So that’s exactly what we’re going to do.

It’s graduation day all over again for the alumni above!

(Video tutorial 1) (Video tutorial 2). (Exemplar sheet).

The syntax you need is explained in QuickStatements v.1 and you can use the Wikidata plug-in for Google Sheets to make wrangling the data in Google Sheets easier.