Suppose "template" is a sequence of "term"s, it makes more sense to handle an empty sequence there. It might be even better to disallow empty template other than the top-level one.
add_config()
ui.graph.format
ui.graph.style