Implement vertex, edge and document classes.