@Override protected String convert(Edge edge) { return edge.getId(); } };
@Override protected String convert(Edge edge) { return edge.getId(); } };
@Override protected String convert(Edge edge) { return edge.getId(); } }
@Override public Map<String, Boolean> doEdgesExist(Iterable<String> ids, Long endTime, Authorizations authorizations) { Map<String, Boolean> results = new HashMap<>(); for (String id : ids) { results.put(id, false); } for (Edge edge : getEdges(ids, FetchHints.NONE, endTime, authorizations)) { results.put(edge.getId(), true); } return results; }
@Override public Map<String, Boolean> doEdgesExist(Iterable<String> ids, Long endTime, Authorizations authorizations) { Map<String, Boolean> results = new HashMap<>(); for (String id : ids) { results.put(id, false); } for (Edge edge : getEdges(ids, FetchHints.NONE, endTime, authorizations)) { results.put(edge.getId(), true); } return results; }
@Override public Edge getEdge(String edgeId, FetchHints fetchHints, Long endTime, Authorizations authorizations) { for (Edge edge : getEdges(fetchHints, endTime, authorizations)) { if (edge.getId().equals(edgeId)) { return edge; } } return null; }
@Override protected boolean isIncluded(Vertex termMention) { String forElementId = VisalloProperties.TERM_MENTION_FOR_ELEMENT_ID.getPropertyValue(termMention); if (forElementId == null || !forElementId.equals(edge.getId())) { return false; } return isTermMentionForProperty(termMention, propertyKey, propertyName, propertyVisibility); } };
protected void broadcastEdgeDeletion(Edge edge) { JSONObject dataJson = new JSONObject(); if (edge != null) { dataJson.put("edgeId", edge.getId()); dataJson.put("outVertexId", edge.getVertexId(Direction.OUT)); dataJson.put("inVertexId", edge.getVertexId(Direction.IN)); } JSONObject json = new JSONObject(); json.put("type", "edgeDeletion"); json.put("data", dataJson); broadcastJson(json); }
void removeOutEdge(Edge edge) { if (this.outEdges instanceof EdgesWithEdgeInfo) { ((EdgesWithEdgeInfo) this.outEdges).remove(edge.getId()); } else { throw new VertexiumException("Cannot remove out edge"); } }
void removeOutEdge(Edge edge) { if (this.outEdges instanceof EdgesWithEdgeInfo) { ((EdgesWithEdgeInfo) this.outEdges).remove(edge.getId()); } else { throw new VertexiumException("Cannot remove out edge"); } }
/** * If this is a resolved term mention. This allows setting that information. * * @param resolvedToVertex The vertex this term mention resolves to. * @param resolvedEdge The edge that links the source vertex to the resolved vertex. */ public TermMentionBuilder resolvedTo(Vertex resolvedToVertex, Edge resolvedEdge) { return resolvedTo(resolvedToVertex.getId(), resolvedEdge.getId()); }
@Override protected EdgeVertexPair convert(Edge edge) { String otherVertexId = edge.getOtherVertexId(sourceVertexId); Vertex otherVertex = vertices.get(otherVertexId); if (otherVertex == null) { throw new VertexiumException("Found an edge " + edge.getId() + ", but could not find the vertex on the other end: " + otherVertexId); } return new EdgeVertexPair(edge, otherVertex); } };
@Override protected EdgeVertexPair convert(Edge edge) { String otherVertexId = edge.getOtherVertexId(sourceVertexId); Vertex otherVertex = vertices.get(otherVertexId); if (otherVertex == null) { throw new VertexiumException("Found an edge " + edge.getId() + ", but could not find the vertex on the other end: " + otherVertexId); } return new EdgeVertexPair(edge, otherVertex); } };
public ClientApiSourceInfo getSourceInfoForEdge(Edge edge, Authorizations authorizations) { String inVertexId = edge.getVertexId(Direction.IN); Vertex termMention = findTermMention(inVertexId, edge.getId(), null, null, null, authorizations); return getSourceInfoFromTermMention(termMention, authorizations); }
public boolean alterEdgeVertexOutVertex(Mutation vertexOutMutation, Edge edge, Visibility newVisibility) { ColumnVisibility currentColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility()); ColumnVisibility newColumnVisibility = visibilityToAccumuloVisibility(newVisibility); if (currentColumnVisibility.equals(newColumnVisibility)) { return false; } EdgeInfo edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edge.getLabel()), edge.getVertexId(Direction.IN)); vertexOutMutation.putDelete(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), currentColumnVisibility); vertexOutMutation.put(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue()); return true; }
public boolean alterEdgeVertexOutVertex(Mutation vertexOutMutation, Edge edge, Visibility newVisibility) { ColumnVisibility currentColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility()); ColumnVisibility newColumnVisibility = visibilityToAccumuloVisibility(newVisibility); if (currentColumnVisibility.equals(newColumnVisibility)) { return false; } EdgeInfo edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edge.getLabel()), edge.getVertexId(Direction.IN)); vertexOutMutation.putDelete(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), currentColumnVisibility); vertexOutMutation.put(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue()); return true; }
void addInEdge(Edge edge) { if (this.inEdges instanceof EdgesWithEdgeInfo) { ((EdgesWithEdgeInfo) this.inEdges).add(edge.getId(), new org.vertexium.accumulo.iterator.model.EdgeInfo(edge.getLabel(), edge.getVertexId(Direction.OUT))); } else { throw new VertexiumException("Cannot add edge"); } }
void addInEdge(Edge edge) { if (this.inEdges instanceof EdgesWithEdgeInfo) { ((EdgesWithEdgeInfo) this.inEdges).add(edge.getId(), new org.vertexium.accumulo.iterator.model.EdgeInfo(edge.getLabel(), edge.getVertexId(Direction.OUT))); } else { throw new VertexiumException("Cannot add edge"); } }
public void alterEdgeLabel(Edge edge, String newEdgeLabel) { ColumnVisibility edgeColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility()); Mutation m = createAlterEdgeLabelMutation(edge, newEdgeLabel, edgeColumnVisibility); saveEdgeMutation(m); saveEdgeInfoOnVertex( edge.getId(), edge.getVertexId(Direction.OUT), edge.getVertexId(Direction.IN), newEdgeLabel, edgeColumnVisibility ); }
public void alterEdgeLabel(Edge edge, String newEdgeLabel) { ColumnVisibility edgeColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility()); Mutation m = createAlterEdgeLabelMutation(edge, newEdgeLabel, edgeColumnVisibility); saveEdgeMutation(m); saveEdgeInfoOnVertex( edge.getId(), edge.getVertexId(Direction.OUT), edge.getVertexId(Direction.IN), newEdgeLabel, edgeColumnVisibility ); }