Examples of addVertex()


Examples of com.tinkerpop.blueprints.util.wrappers.batch.BatchGraph.addVertex()

      List<FaunusVertex> faunusVertexList = FaunusGraphSONUtility.fromJSON(inputStream);

      // add vertices w/ properties to graph, also saving id->id mapping for edge creation
      Vertex blueprintsVertex;
      for (FaunusVertex faunusVertex : faunusVertexList) {
        blueprintsVertex = graph.addVertex(faunusVertex.getIdAsLong());
        for (String property : faunusVertex.getPropertyKeys()) {
          blueprintsVertex.setProperty(property, faunusVertex.getProperty(property));
        }
        faunusToBlueprintsId.put(faunusVertex.getIdAsLong(), (Long) blueprintsVertex.getId());
      }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.Graph.addVertex()

    }

    @Test
    public void serializeEdge() throws Exception {
        final Graph g = TinkerGraph.open();
        final Vertex v1 = g.addVertex();
        final Vertex v2 = g.addVertex();
        final Edge e = v1.addEdge("test", v2);
        e.property("abc", 123);

        final Iterable<Edge> iterable = g.E().toList();
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.util.batch.BatchGraph.addVertex()

                } else if (fieldName.equals(GraphSONTokens.VERTICES)) {
                    while (parser.nextToken() != JsonToken.END_ARRAY) {
                        final Map<String, Object> vertexData = parser.readValueAs(mapTypeReference);
                        readVertexData(vertexData, detachedVertex -> {
                            final Vertex v = Optional.ofNullable(graph.v(detachedVertex.id())).orElse(
                                    graph.addVertex(T.label, detachedVertex.label(), T.id, detachedVertex.id()));
                            detachedVertex.iterators().propertyIterator().forEachRemaining(p -> createVertexProperty(graphToWriteTo, v, p, false));
                            detachedVertex.iterators().hiddenPropertyIterator().forEachRemaining(p -> createVertexProperty(graphToWriteTo, v, p, true));
                            return v;
                        });
                    }
View Full Code Here

Examples of cu.repsystestbed.graphs.ReputationGraph.addVertex()

        Agent sink = new Agent(new Integer(feedbackInstance[1]));
        Double reputation = new Double(feedbackInstance[2]);
       
        if(!repGraph.containsVertex(src))
        {
          repGraph.addVertex(src);
        }
       
        if(!repGraph.containsVertex(sink))
        {
          repGraph.addVertex(sink);
View Full Code Here

Examples of cu.repsystestbed.graphs.TrustGraph.addVertex()

        Agent src = new Agent(new Integer(feedbackInstance[0]));
        Agent sink = new Agent(new Integer(feedbackInstance[1]));
       
        if(!trustGraph.containsVertex(src))
        {
          trustGraph.addVertex(src);
        }
       
        if(!trustGraph.containsVertex(sink))
        {
          trustGraph.addVertex(sink);
View Full Code Here

Examples of de.hpi.bpt.graph.DirectedGraph.addVertex()

   
    DirectedGraph g = new DirectedGraph();
   
    for(String key:idMap.keySet()){
      Vertex s = new Vertex(key);
      g.addVertex(s);
      idToVertex.put(key, s);
    }
     
   
    for(String key:idMap.keySet()){
View Full Code Here

Examples of edu.brown.designer.AccessGraph.addVertex()

    public static AccessGraph convertToSingleColumnEdges(Database catalog_db, AccessGraph orig_agraph) {
        AccessGraph agraph = new AccessGraph(catalog_db);
        Map<CatalogPair, DesignerEdge> entry_edges = new HashMap<CatalogPair, DesignerEdge>();

        for (DesignerVertex v : orig_agraph.getVertices()) {
            agraph.addVertex(v);
        } // FOR

        for (DesignerEdge e : orig_agraph.getEdges()) {
            // Split up the ColumnSet into separate edges, one per entry
            PredicatePairs cset = e.getAttribute(EdgeAttributes.COLUMNSET);
View Full Code Here

Examples of edu.brown.designer.DependencyGraph.addVertex()

        DependencyGraph dgraph = new DependencyGraph(catalogContext.database);
        DesignerVertex vertices[] = new DesignerVertex[TABLE_NAMES.length];
        for (int i = 0; i < vertices.length; i++) {
            Table catalog_tbl = this.getTable(TABLE_NAMES[i]);
            vertices[i] = new DesignerVertex(catalog_tbl);
            dgraph.addVertex(vertices[i]);
           
            if (i > 0) {
                for (int j = 0; j < num_edges; j++) {
                    dgraph.addEdge(new DesignerEdge(dgraph), vertices[i-1], vertices[i]);
                } // FOR
View Full Code Here

Examples of edu.brown.designer.PartitionTree.addVertex()

            //
            // Make sure we include the replicated tables
            //
            for (String table_name : proc_hints.force_replication) {
                DesignerVertex vertex = agraph.getVertex(info.catalogContext.database.getTables().get(table_name));
                ptree.addVertex(vertex);
                vertex.setAttribute(ptree, PartitionTree.VertexAttributes.METHOD.name(), PartitionMethodType.REPLICATION);
            } // FOR
            try {
                for (DesignerVertex root : candidate_roots) {
                    buildPartitionTree(ptree, root, agraph, proc_hints);
View Full Code Here

Examples of edu.brown.markov.MarkovGraph.addVertex()

                MarkovVertex v = new MarkovVertex(cntStmt.statement,
                                                  MarkovVertex.Type.QUERY,
                                                  cntStmt.counter,
                                                  this.stmt_partitions,
                                                  this.past_partitions);
                markov.addVertex(v);
               
                // For now we'll set the new edge's probability to 1.0 to just
                // make the calculations down below work. This will get updated
                // overtime when we recompute the probabilities in the entire graph.
                candidate_edge = new MarkovEdge(markov, 1, 1.0f);
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.