public void removeVertex(final Vertex vertex) { Value vertexValue = ((SailVertex) vertex).getRawVertex(); try { if (vertexValue instanceof Resource) { this.sailConnection.get().removeStatements((Resource) vertexValue, null, null); } this.sailConnection.get().removeStatements(null, null, vertexValue); } catch (SailException e) { throw ExceptionFactory.vertexWithIdDoesNotExist(vertex.getId()); } }
public void removeVertex(final Vertex vertex) { if (!this.vertices.containsKey(vertex.getId().toString())) throw ExceptionFactory.vertexWithIdDoesNotExist(vertex.getId()); for (Edge edge : vertex.getEdges(Direction.BOTH)) { this.removeEdge(edge); } this.vertexKeyIndex.removeElement((TinkerVertex) vertex); for (Index index : this.getIndices()) { if (Vertex.class.isAssignableFrom(index.getIndexClass())) { TinkerIndex<TinkerVertex> idx = (TinkerIndex<TinkerVertex>) index; idx.removeElement((TinkerVertex) vertex); } } this.vertices.remove(vertex.getId().toString()); }
public void removeVertex(final Vertex vertex) { this.autoStartTransaction(true); try { final Node node = ((Neo4j2Vertex) vertex).getRawVertex(); for (final Relationship relationship : node.getRelationships(org.neo4j.graphdb.Direction.BOTH)) { relationship.delete(); } node.delete(); } catch (NotFoundException nfe) { throw ExceptionFactory.vertexWithIdDoesNotExist(vertex.getId()); } catch (IllegalStateException ise) { // wrap the neo4j exception so that the message is consistent in blueprints. throw ExceptionFactory.vertexWithIdDoesNotExist(vertex.getId()); } }
@Override public void removeVertex(final Vertex vertex) { if (getVertex(vertex.getId()) == null) { throw ExceptionFactory.vertexWithIdDoesNotExist(vertex.getId()); } assert vertex instanceof SparkseeVertex; autoStartTransaction(true); try { getRawGraph().drop((Long) vertex.getId()); } catch (Exception e) { ExceptionFactory.vertexWithIdDoesNotExist(vertex.getId()); } }
throw ExceptionFactory.vertexWithIdDoesNotExist(this.getId());
@Override public void remove() { globals.getCaches().remove(getId(), Vertex.class); super.removeElementFromNamedIndexes(); // Throw exception if the element does not exist. if (!globals.getVertexWrapper().elementExists(id)) { throw ExceptionFactory.vertexWithIdDoesNotExist(getId()); } // Remove properties from key/value indexes. Map<String, Object> props = globals.getVertexWrapper() .readAllProperties(this); for (Entry<String,Object> ent : props.entrySet()) { globals.getVertexKeyIndexWrapper().removePropertyFromIndex(this, ent.getKey(), ent.getValue()); } // Remove edges incident to this vertex. CloseableIterable<Edge> iter = (CloseableIterable<Edge>)getEdges(Direction.BOTH); for (Edge edge : iter) { edge.remove(); } iter.close(); globals.checkedFlush(); // Get rid of the vertex. globals.getVertexWrapper().deleteVertex(this); globals.checkedFlush(); }
@Override public void remove() { globals.getCaches().remove(getId(), Vertex.class); super.removeElementFromNamedIndexes(); // Throw exception if the element does not exist. if (!globals.getVertexWrapper().elementExists(id)) { throw ExceptionFactory.vertexWithIdDoesNotExist(getId()); } // Remove properties from key/value indexes. Map<String, Object> props = globals.getVertexWrapper() .readAllProperties(this); for (Entry<String,Object> ent : props.entrySet()) { globals.getVertexKeyIndexWrapper().removePropertyFromIndex(this, ent.getKey(), ent.getValue()); } // Remove edges incident to this vertex. CloseableIterable<Edge> iter = (CloseableIterable<Edge>)getEdges(Direction.BOTH); for (Edge edge : iter) { edge.remove(); } iter.close(); globals.checkedFlush(); // Get rid of the vertex. globals.getVertexWrapper().deleteVertex(this); globals.checkedFlush(); }