implemented a demo visitor implementation that pretty prints the query graph