Examples of GraphMLWriter


Examples of com.tinkerpop.gremlin.structure.io.graphml.GraphMLWriter

    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS)
    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_NUMERIC_IDS)
    @LoadGraphWith(LoadGraphWith.GraphData.CLASSIC)
    public void shouldWriteNormalizedGraphML() throws Exception {
        try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
            final GraphMLWriter w = GraphMLWriter.build().normalize(true).create();
            w.writeGraph(bos, g);

            final String expected = streamToString(IoTest.class.getResourceAsStream(GRAPHML_RESOURCE_PATH_PREFIX + "tinkerpop-classic-normalized.xml"));
            assertEquals(expected.replace("\n", "").replace("\r", ""), bos.toString().replace("\n", "").replace("\r", ""));
        }
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.graphml.GraphMLWriter

    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_STRING_IDS)
    public void shouldProperlyEncodeWithGraphML() throws Exception {
        final Vertex v = g.addVertex(T.id, "1");
        v.property("text", "\u00E9");

        final GraphMLWriter w = GraphMLWriter.build().create();

        final File f = File.createTempFile("test", "txt");
        try (final OutputStream out = new FileOutputStream(f)) {
            w.writeGraph(out, g);
        }

        validateXmlAgainstGraphMLXsd(f);

        // reusing the same config used for creation of "g".
View Full Code Here

Examples of org.apache.flex.compiler.internal.graph.GraphMLWriter

        if (dependencyGraphOutput != null)
        {
            LinkageChecker linkageChecker = new LinkageChecker(project, getTargetSettings());
            Target.RootedCompilationUnits rootedCompilationUnits = target.getRootedCompilationUnits();
            problems.addAll(rootedCompilationUnits.getProblems());
            GraphMLWriter dependencyGraphWriter =
                new GraphMLWriter(project.getDependencyGraph(),
                        rootedCompilationUnits.getUnits(), true,
                        linkageChecker);
            BufferedOutputStream graphStream = new BufferedOutputStream(new FileOutputStream(dependencyGraphOutput));
            LinkedList<ICompilerProblem> problemList = new LinkedList<ICompilerProblem>();
            Iterables.addAll(problemList, rootedCompilationUnits.getProblems());
            dependencyGraphWriter.writeToStream(graphStream, problemList);
            problems.addAll(problemList);
        }
    }
View Full Code Here

Examples of org.gvt.util.GraphMLWriter

        ((ChsRootEditPart) main.getViewer().getRootEditPart().
          getChildren().get(0)).getModel();

      BufferedWriter xmlFile =
        new BufferedWriter(new FileWriter(fileName));
      GraphMLWriter writer = new GraphMLWriter();
      xmlFile.write(writer.writeXMLFile(root).toString());
      xmlFile.close();

      // mark save location in commandstack
      main.getEditDomain().getCommandStack().markSaveLocation();
    }
View Full Code Here

Examples of prefuse.data.io.GraphMLWriter

//################################################################################################
    // Generate the XML file from the graph   
    public boolean writeFile(Graph graph, String fileName)
    {
           GraphMLWriter graphWriter = new GraphMLWriter();
           try
            {
               //=== See if the file exists, if so overwrite it, if not create a new file and write to it
               File newFile = new File(fileName);
               if (newFile.exists())
               {
                   graphWriter.writeGraph(graph, newFile);                         
               }
               else
               {
                   newFile.createNewFile();
                   graphWriter.writeGraph(graph, newFile);
               }
               return true;
             }
           catch(Exception e){
               System.out.println("Exception "+ e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.