def ontlogyDrawDot(ontology):
    """Creates a dot file representation of an ontoloyg."""

    dotString = ''

    # Header.
    header = ('digraph markov {\n'
              '  node [shape=oval,fontname="Helvetica",fontcolor=blue'
              ',fontsize=10];\n'
              '  edge [style=solid,color=black];')

    dotString += dotString + header + '\n'
    edge = ''

    for (iClass, terminalClassList) in ontology.items():
        # Add current abstraction class to ensure all classes are
        # printed.
        dotString += iClass + '\n'
        edge = '  "' + iClass + '" ->'
        for tClass in terminalClassList:
            dotString += edge + ' {"' + tClass + '"}\n'
    dotString += '}\n'

    return dotString