@Override protected boolean isIncluded(Edge o) { String entityVertexId = o.getOtherVertexId(workspaceVertex.getId()); return entityVertexId.equalsIgnoreCase(vertexId); } };
protected ImmutableList<String> getDependentPropertyIris(Vertex vertex, String workspaceId) { List<Edge> dependentProperties = Lists.newArrayList(vertex.getEdges(Direction.OUT, OntologyProperties.EDGE_LABEL_DEPENDENT_PROPERTY, getAuthorizations(workspaceId))); dependentProperties.sort((e1, e2) -> { Integer o1 = OntologyProperties.DEPENDENT_PROPERTY_ORDER_PROPERTY_NAME.getPropertyValue(e1, 0); Integer o2 = OntologyProperties.DEPENDENT_PROPERTY_ORDER_PROPERTY_NAME.getPropertyValue(e2, 0); return Integer.compare(o1, o2); }); return ImmutableList.copyOf(dependentProperties.stream().map(e -> { String propertyId = e.getOtherVertexId(vertex.getId()); return propertyId.substring(VertexiumOntologyRepository.ID_PREFIX_PROPERTY.length()); }).collect(Collectors.toList())); }
@Override protected boolean isIncluded(Edge edge) { return edge.getOtherVertexId(getId()).equals(otherVertex.getId()); } };
@Override protected boolean isIncluded(Edge edge) { return edge.getOtherVertexId(getId()).equals(otherVertex.getId()); } };
@Override protected boolean isIncluded(Edge edge) { return edge.getOtherVertexId(getId()).equals(otherVertex.getId()); } };
/** * Given a vertexId that represents one side of a relationship, get me the vertex of the other side. */ default Vertex getOtherVertex(String myVertexId, FetchHints fetchHints, Authorizations authorizations) { String vertexId = getOtherVertexId(myVertexId); return getGraph().getVertex(vertexId, fetchHints, authorizations); }
/** * Given a vertexId that represents one side of a relationship, get me the vertex of the other side. */ default Vertex getOtherVertex(String myVertexId, FetchHints fetchHints, Authorizations authorizations) { String vertexId = getOtherVertexId(myVertexId); return getGraph().getVertex(vertexId, fetchHints, authorizations); }
@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 boolean isIncluded(Edge edge) { return edge.getOtherVertexId(getSourceVertex().getId()).equals(getOtherVertexId()); } };
@Override protected boolean isIncluded(Edge edge) { return edge.getOtherVertexId(getSourceVertex().getId()).equals(getOtherVertexId()); } };
protected Map<String, Vertex> getWorkspaceVertices( final Workspace workspace, List<Edge> entityEdges, Authorizations authorizations ) { Map<String, Vertex> workspaceVertices; Iterable<String> workspaceVertexIds = entityEdges.stream() .map(edge -> edge.getOtherVertexId(workspace.getWorkspaceId())) .collect(Collectors.toList()); Iterable<Vertex> vertices = getGraph().getVertices( workspaceVertexIds, FetchHint.ALL_INCLUDING_HIDDEN, authorizations ); workspaceVertices = Maps.uniqueIndex(vertices, new Function<Vertex, String>() { @Nullable @Override public String apply(Vertex v) { return v.getId(); } }); return workspaceVertices; }
@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); } };
); List<String> ids = StreamUtil.stream(productVertexEdges) .map(edge -> edge.getOtherVertexId(productVertex.getId())) .collect(Collectors.toList()); Map<String, Boolean> othersById = graph.doVerticesExist(ids, authorizations); while (edgeIterator.hasNext()) { Edge propertyVertexEdge = edgeIterator.next(); String otherId = propertyVertexEdge.getOtherVertexId(productVertex.getId()); GraphWorkProductVertex vertexOrNode = new GraphWorkProductVertex(); vertexOrNode.setId(otherId);
String entityVertexId = edge.getOtherVertexId(workspace.getWorkspaceId());
usersWithAccess = stream(userEdges) .map((edge) -> { String userId = edge.getOtherVertexId(workspaceId);
if (!edge.getOtherVertexId(startingVertex.getId()).equals(endVertex.getId())) { return;
if (!edge.getOtherVertexId(startingVertex.getId()).equals(endVertex.getId())) { return;
.map(edge -> edge.getOtherVertexId(id)) .collect(Collectors.toList()); Map<String, Vertex> othersById = StreamUtil.stream(graph.getVertices(ids, FetchHint.NONE, authorizations)) String otherId = propertyVertexEdge.getOtherVertexId(id); TVertex vertex = createWorkProductVertex(); vertex.setId(otherId);
@Override public void cleanUpElements( Graph graph, Vertex productVertex, Authorizations authorizations ) { Iterable<Edge> productElementEdges = productVertex.getEdges( Direction.OUT, WorkspaceProperties.PRODUCT_TO_ENTITY_RELATIONSHIP_IRI, authorizations ); for (Edge productToElement : productElementEdges) { if (GraphProductOntology.NODE_CHILDREN.hasProperty(productToElement)) { String otherElementId = productToElement.getOtherVertexId(productVertex.getId()); graph.softDeleteVertex(otherElementId, authorizations); } else { graph.softDeleteEdge(productToElement, authorizations); } } graph.flush(); }
String otherVertexId = edge.getOtherVertexId(graphVertexId); Vertex otherVertex = graph.getVertex(otherVertexId, authorizations); if (otherVertex == null) {