@Override public Boolean run() { return graph.remove(o); } });
@Override public void remove() { graph.remove(lastReturned); } };
@Override public Boolean run() { return graph.remove(o); } });
@Override public boolean remove(Object e) { if (baseTripleCollections.length == 0) { throw new RuntimeException("no base graph for removing triples"); } return baseTripleCollections[0].remove(e); }
@Override public boolean remove(Object o) { checkWrite(); return wrapped.remove(o); }
@Override public void performDelete(com.hp.hpl.jena.graph.Triple triple) { Triple clerezzaTriple = jena2TriaUtil.convertTriple(triple); if (clerezzaTriple != null) { graph.remove(clerezzaTriple); } }
/** * Delete property to the node with the specified predicate and object * * @param predicate * @param object */ public void deleteProperty(IRI predicate, RDFTerm object) { if (resource instanceof BlankNodeOrIRI) { graph.remove(new TripleImpl((BlankNodeOrIRI) resource, predicate, object)); } }
/** * Deletes the context of a node * @see getNodeContext() */ public void deleteNodeContext() { for (Triple triple : getNodeContext()) { graph.remove(triple); } }
/** * Delete property to the node with the specified predicate and object * * @param predicate * @param object */ public void deleteProperty(IRI predicate, RDFTerm object) { if (resource instanceof BlankNodeOrIRI) { graph.remove(new TripleImpl((BlankNodeOrIRI) resource, predicate, object)); } }
void removeMapping(OWLOntologyID ontologyReference) { Iterator<Triple> it = graph.filter(buildResource(ontologyReference), MAPS_TO_GRAPH_URIREF, null); // I expect a concurrent modification exception here, but we can deal with it later. while (it.hasNext()) graph.remove(it.next()); }
void removeMapping(OWLOntologyID ontologyReference) { Iterator<Triple> it = graph.filter(buildResource(ontologyReference), MAPS_TO_GRAPH_URIREF, null); // I expect a concurrent modification exception here, but we can deal with it later. while (it.hasNext()) graph.remove(it.next()); }
@Override public void scopeDetached(Session session, String scopeId) { final IRI sessionur = getIRIforSession(session), scopeur = getIRIforScope(scopeId); if (sessionur == null || scopeur == null) throw new IllegalArgumentException( "IRIs for scope and session cannot be null."); if (meta instanceof Graph) synchronized (meta) { // TripleImpl implements equals() and hashCode() ... meta.remove(new TripleImpl(sessionur, HAS_APPENDED_URIREF, scopeur)); meta.remove(new TripleImpl(scopeur, APPENDED_TO_URIREF, sessionur)); } }
/** * Removes a base URI from the Clerezza platform instance. * * @param baseUri The base URI which will be removed from the platform instance */ public void removeBaseUri(IRI baseUri) { systemGraph.remove(new TripleImpl(getPlatformInstanceRDFTerm(), PLATFORM.baseUri, baseUri)); }
private void removeValues(IRI proptery){ Iterator<Triple> toRemove = factory.getGraph().filter(rdfNode, proptery, null); while(toRemove.hasNext()){ factory.getGraph().remove(toRemove.next()); } }
private boolean removeValue(IRI property, Object value){ RDFTerm rdfValue; try { rdfValue = getRdfResource(value); return factory.getGraph().remove(new TripleImpl(rdfNode, property, rdfValue)); } catch (NoConvertorException e){ throw new IllegalArgumentException("Unable to transform "+value.getClass() +" to an RDF Node. Only "+RdfEntity.class+" and RDF Literal Types are supported"); } } private void removeValues(IRI proptery){
private boolean removeValue(IRI property, Object value){ RDFTerm rdfValue; try { rdfValue = getRdfResource(value); return factory.getGraph().remove(new TripleImpl(rdfNode, property, rdfValue)); } catch (NoConvertorException e){ throw new IllegalArgumentException("Unable to transform "+value.getClass() +" to an RDF Node. Only "+RdfEntity.class+" and RDF Literal Types are supported"); } } private void removeValues(IRI proptery){
private void removeList(BlankNodeOrIRI list, Graph permissionMGraph) { try { Triple t = permissionMGraph.filter(list, rest, null).next(); RDFTerm restList = t.getObject(); removeList((BlankNodeOrIRI) restList, permissionMGraph); permissionMGraph.remove(t); Iterator<Triple> iter = permissionMGraph.filter(list, first, null); iter.next(); iter.remove(); } catch (NoSuchElementException e) { //if it has no rest its rdf:NIL and has no first } }
private void removeExistingRequiredReadPermissions(IRI GraphUri, Graph permissionMGraph) { try { Triple t = permissionMGraph.filter(GraphUri, readPermissionListProperty, null).next(); RDFTerm list = t.getObject(); removeList((BlankNodeOrIRI) list, permissionMGraph); permissionMGraph.remove(t); } catch (NoSuchElementException e) { //There was no existing to remove } }
@Override public Recipe removeRule(Recipe recipe, Rule rule) { Graph tripleCollection = tcManager.getGraph(recipe.getRecipeID()); // remove from the graph recipe all the triples having the ruleID as subject. Iterator<Triple> triplesIterator = tripleCollection.filter(rule.getRuleID(), null, null); while (triplesIterator.hasNext()) { tripleCollection.remove(triplesIterator.next()); } // remove from the graph recipe the triple recipeID hasRule ruleID tripleCollection.remove(new TripleImpl(recipe.getRecipeID(), Symbols.hasRule, rule.getRuleID())); recipe.removeRule(rule); return recipe; }
@Test public void testRemoveSingleTriple() throws Exception { Graph graph = getEmptyGraph(); final Triple triple= createTriple( "http://example.org/ontology/Person", "http://example.org/ontology/hasName", "http://example.org/people/alice"); Assert.assertTrue(graph.add(triple)); Assert.assertTrue(graph.remove(triple)); Assert.assertEquals(0, graph.size()); }