'Remove all nodes, links, and annotation items from the scheme.'

def clear(self):

    def is_terminal(node):
        return (not bool(self.find_links(source_node=node)))
    while self.nodes:
        terminal_nodes = list(filter(is_terminal, self.nodes))
        for node in terminal_nodes:
            self.remove_node(node)
    for annotation in self.annotations:
        self.remove_annotation(annotation)
    assert (not (self.nodes or self.links or self.annotations))
