Added some tests and implemented addTriple for qgraph