def is_wd_id(var):
    """
    Checks whether a variable is a Wikidata id
    """
    if var[0] == "Q" and var.split("Q")[1].isnumeric():  # check if it's a QID
        return True

    if var[0] == "P" and var.split("P")[1].isnumeric():  # check if it's a PID
        return True

    return False