@Override public String transform(Edge edge) { return edge.getLabel(); } };
public String getLabel() { return ((Edge) this.baseElement).getLabel(); }
public String getLabel() { return ((Edge) this.baseElement).getLabel(); } }
public String getLabel() { return ((Edge) this.baseElement).getLabel(); }
@Override public Double compute(final Edge argument) { final Double d = edgeLabelBiasMap.get(argument.getLabel()); return (null == d) ? 0.0d : d; } };
protected Edge processNextStart() { while (true) { final Edge edge = this.starts.next(); if (this.predicate.evaluate(edge.getLabel(), this.label)) return edge; } }
/** * @return The label associated with this edge */ protected String getLabel() { return element().getLabel(); }
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) {
public boolean isLegal(final Element element) { if (this.key.equals(StringFactory.ID)) { return this.predicate.evaluate(element.getId(), this.value); } else if (this.key.equals(StringFactory.LABEL) && element instanceof Edge) { return this.predicate.evaluate(((Edge) element).getLabel(), this.value); } else { return this.predicate.evaluate(element.getProperty(this.key), this.value); } } }
@Override public Boolean compute(Edge edge) { String type = edge.getVertex(Direction.OUT).getProperty(Constants.ENTITY_TYPE_PROPERTY_KEY); VertexWrapper v = new TermVertexWrapper(edge.getVertex(Direction.IN)); return edge.getLabel().startsWith(type) && v.getPropertyKeys().contains("available_as_tag"); } }));
private void writeGraphEdges(OutputStream os) throws IOException { for(Edge edge : graph.getEdges()) { String label = edge.getLabel(); String source = ""+edge.getVertex(Direction.IN).getId().hashCode(); String target = ""+edge.getVertex(Direction.OUT).getId().hashCode(); writeGraphEdge(label, source, target, 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 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 label = edge.getLabel(); String source = ""+edge.getVertex(Direction.IN).getId().hashCode(); String target = ""+edge.getVertex(Direction.OUT).getId().hashCode(); writeGraphEdge(label, source, target, os); } }
@Override public Boolean compute(Edge edge) { String name = edge.getVertex(Direction.OUT).getProperty(Constants.ENTITY_TYPE_PROPERTY_KEY); if (edge.getLabel().startsWith(name)) { VertexWrapper v = new TermVertexWrapper(edge.getVertex(Direction.IN)); return v.getPropertyKeys().contains("available_as_tag") && ! isDeleted(v.getVertex()); } else { return false; } } });
@Override public Boolean compute(Edge edge) { String name = edge.getVertex(Direction.OUT).getProperty(Constants.ENTITY_TYPE_PROPERTY_KEY); if (edge.getLabel().startsWith(name)) { VertexWrapper v = new TermVertexWrapper(edge.getVertex(Direction.IN)); return ! v.getPropertyKeys().contains("available_as_tag") && ! isDeleted(v.getVertex()); } else { return false; } } });
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); }
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; }