add graph.Primitive utility