Ejemplo n.º 1
0
func ioGmlTest(t *testing.T, filename1 string, filename2 string) {

	var ag *caes.ArgGraph
	var err error

	file, err := os.Open(filename1)
	gmlcheck(t, err)
	ag, err = yaml.Import(file)
	file.Close()
	gmlcheck(t, err)
	//	fmt.Printf("---------- WriteArgGraph %s ----------\n", filename1)
	//	yaml.ExportWithReferences(os.Stdout, ag)
	//	fmt.Printf("---------- End: WriteArgGraph %s ----------\n", filename1)
	l := ag.GroundedLabelling()
	ag.ApplyLabelling(l)
	//	fmt.Printf("---------- printLabeling %s ----------\n", filename1)
	//	printLabeling(l)
	//	fmt.Printf("---------- End: printLabeling %s ----------\n", filename1)
	file, err = os.Create(filename2)
	gmlcheck(t, err)
	graphml.Export(file, *ag)

}
Ejemplo n.º 2
0
func GraphMLExportToString(ag caes.ArgGraph) (string, error) {
	var b bytes.Buffer
	var err = graphml.Export(&b, ag)
	return b.String(), err
}