@Override public Object getRelationId(Edge edge) { return edge.getId(); }
public void edgePropertyRemoved(final Edge edge, final String s, final Object o) { edgePropertyRemovedEvent.incrementAndGet(); order.add("e-property-removed-" + edge.getId() + "-" + s + ":" + o); }
public void edgeRemoved(final Edge edge, final Map<String, Object> props) { edgeRemovedEvent.incrementAndGet(); order.add("e-removed-" + edge.getId()); }
public void edgeAdded(final Edge edge) { addEdgeEvent.incrementAndGet(); order.add("e-added-" + edge.getId()); }
public void edgePropertyChanged(final Edge edge, final String s, final Object o, final Object n) { edgePropertyChangedEvent.incrementAndGet(); order.add("e-property-changed-" + edge.getId() + "-" + s + ":" + o + "->" + n); }
@Override public void print(Edge instance, RipplePrintStream p, ModelConnection mc) throws RippleException { p.print("[edge " + instance.getId() + "]"); } }
@Override public int compare(Edge o1, Edge o2, ModelConnection mc) { String otherLabel = o2.getLabel(); int cmp = o1.getLabel().compareTo(otherLabel); if (0 == cmp) { return ((Integer) o1.getId().hashCode()).compareTo(o2.hashCode()); } else { return cmp; } }
public boolean addEdge(final Edge edge, final Vertex outVertex, final Vertex inVertex) { this.graph.addEdge(edge.getId(), outVertex, inVertex, edge.getLabel()); return true; }
public void removeEdge(final Edge edge) { RestHelper.delete(this.graphURI + RexsterTokens.SLASH_EDGES_SLASH + RestHelper.encode(edge.getId())); }
private void writeGraphEdges(OutputStream os) throws IOException { IOUtils.write(GexfConstants.EDGES_OPEN, os); for(Edge edge : graph.getEdges()) { String id = ""+edge.getId().hashCode(); String source = ""+edge.getVertex(Direction.IN).getId().hashCode(); String target = ""+edge.getVertex(Direction.OUT).getId().hashCode(); writeGraphEdge(id, source, target, os); } IOUtils.write(GexfConstants.EDGES_CLOSE, os); }
private void writeGraphEdges(OutputStream os) throws IOException { IOUtils.write(GexfConstants.EDGES_OPEN, os); for(Edge edge : graph.getEdges()) { String id = ""+edge.getId().hashCode(); String source = ""+edge.getVertex(Direction.IN).getId().hashCode(); String target = ""+edge.getVertex(Direction.OUT).getId().hashCode(); writeGraphEdge(id, source, target, os); } IOUtils.write(GexfConstants.EDGES_CLOSE, os); }
public BaseEdgeMutator(Edge edge) { this(edge.getId().toString(), edge.getVertex(Direction.OUT).getId().toString(), edge.getVertex(Direction.IN).getId().toString(), edge.getLabel()); } public BaseEdgeMutator(String id, String outVertexId, String inVertexId, String label) {
public BaseEdgeMutator(Edge edge) { this(edge.getId().toString(), edge.getVertex(Direction.OUT).getId().toString(), edge.getVertex(Direction.IN).getId().toString(), edge.getLabel()); } public BaseEdgeMutator(String id, String outVertexId, String inVertexId, String label) {
@Override public void removeEdge(final Edge edge) { assert edge instanceof SparkseeEdge; autoStartTransaction(true); getRawGraph().drop((Long) edge.getId()); }
private void writeGraphEdges(OutputStream os) throws IOException { for(Edge edge : graph.getEdges()) { String id = ""+edge.getId().hashCode(); String source = ""+edge.getVertex(Direction.IN).getId().hashCode(); String target = ""+edge.getVertex(Direction.OUT).getId().hashCode(); String label = ""+edge.getLabel(); writeGraphEdge(id, source, target, label, os); } }
private void writeGraphEdges(OutputStream os) throws IOException { for(Edge edge : graph.getEdges()) { String id = ""+edge.getId().hashCode(); String source = ""+edge.getVertex(Direction.IN).getId().hashCode(); String target = ""+edge.getVertex(Direction.OUT).getId().hashCode(); String label = ""+edge.getLabel(); writeGraphEdge(id, source, target, label, os); } }
private void writeEdgeProperties(final Writer writer, final Edge e) throws IOException { final Object blueprintsId = e.getId(); if (!useId) { writeKey(writer, edgeIdKey); if (blueprintsId instanceof Number) { writeNumberProperty(writer, (Number) blueprintsId); } else { writeStringProperty(writer, blueprintsId); } } writeProperties(writer, e); }
Edge addEdge(Edge edge) { Edge newEdge = graph.getEdge(edge.getId()); if (null == newEdge) { Vertex outVertex = addNode(edge.getVertex(Direction.OUT)); Vertex inVertex = addNode(edge.getVertex(Direction.IN)); String label = edge.getLabel(); newEdge = graph.addEdge(edge.getId(), outVertex, inVertex, label); copyProperties(edge, edge); } return newEdge; }
public static void dumpRelationship(Edge relationship) { System.out.println(String.format("%s [%s->%s] (%s)", relationship.getId(), relationship.getVertex(Direction.OUT).getId(), relationship.getVertex(Direction.IN).getId(), relationship.getLabel())); dumpProperties(relationship); }