Skip to content

Instantly share code, notes, and snippets.

@waldyrious
Last active October 23, 2021 15:45
Show Gist options
  • Save waldyrious/d0e57926f6a2d1904795c928eb6a0e5e to your computer and use it in GitHub Desktop.
Save waldyrious/d0e57926f6a2d1904795c928eb6a0e5e to your computer and use it in GitHub Desktop.
Remove "NAME" at the start of exoplanet names
  1. Run the following query (inspired by this one) to get the list of exoplanets (Q44559) whose names start with "NAME":
    SELECT ?qid ?Len
    WHERE
    {
      ?qid wdt:P31 wd:Q44559;
            rdfs:label ?Len;
      FILTER (lang(?Len) = "en").
      FILTER regex (?Len, "^NAME").
    }
  2. Download the output as a CSV file
  3. In a text editor, convert the contents to the QuickStatements instructions format (replace the Wikidata item URLs with just the QID). Note: The query above is already designed to provide the correct header row for QuickStatements: qid (instead of ?item) and Len (instead of ?itemLabel).
  4. Remove the "NAME " from the Len column
  5. Paste the instructions into a new batch in QuickStatements, and execute it.
  6. Do the same steps for unconfirmed exoplanet items (Q18611609).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment