@Override public Model removeAll() { getGraph().clear(); return this; }
@Override public String toString() { return "<ModelCom " + getGraph() + " | " + reifiedToString() + ">"; }
private PrefixMapping getPrefixMapping() { return getGraph().getPrefixMapping(); }
@Deprecated @Override public Model add( Model m, boolean suppressReifications ) { // suppressReifications is a no-op. GraphUtil.addInto( getGraph(), m.getGraph() ); return this; }
@Override @Deprecated public Model remove( Model m, boolean suppressReifications ) { GraphUtil.deleteFrom( getGraph(), m.getGraph()); return this; }
/** Remove all the reifications of a given statement in this model, whatever their associated resources. @param s the statement whose reifications are to be removed */ public void removeAllReifications( FrontsTriple s ) { ReifierStd.remove( model.getGraph(), s.asTriple() ); }
/** Answer true iff a given statement is reified in this model @param s the statement for which a reification is sought @return true iff s has a reification in this model */ public boolean isReified( FrontsTriple s ) { return ReifierStd.hasTriple(model.getGraph(), s.asTriple() ); }
@Override public Model remove( StmtIterator iter ) { GraphUtil.delete( getGraph(), asTriples( iter ) ); return this; }
/** remove all the Statements from the model by converting them to triples and removing those triples from the underlying graph. */ @Override public Model remove( Statement [] statements ) { GraphUtil.delete( getGraph(), StatementImpl.asTriples( statements ) ); return this; }
/** Add all the statements to the model by converting them to an array of corresponding triples and removing those from the underlying graph. */ @Override public Model add( Statement [] statements ) { GraphUtil.add(getGraph(), StatementImpl.asTriples( statements ) ); return this; }
/** Add all the statements to the model by converting the list to an array of Statement and removing that. */ @Override public Model add( List<Statement> statements ) { GraphUtil.add(getGraph(), asTriples( statements ) ); return this; }
/** Remove all the Statements from the model by converting the List to a List(Statement) and removing that. */ @Override public Model remove( List<Statement> statements ) { GraphUtil.delete( getGraph(), asTriples( statements ) ); return this; }
/** Answer whether or not these two graphs are isomorphic, taking the hidden (reification) statements into account. */ @Override public boolean isIsomorphicWith( Model m ) { Graph L = this.getGraph(); Graph R = m.getGraph(); return L.isIsomorphicWith( R ); }
public static ReifiedStatement createExistingReifiedStatement( ModelCom model, Node n ) { Triple t = ReifierStd.getTriple(model.getGraph(), n ); return new ReifiedStatementImpl( model, n, model.asStatement( t ) ); } }
@Override public Model add( StmtIterator iter ) { try { GraphUtil.add( getGraph(), asTriples( iter ) ); } finally { iter.close(); } return this; }
/** Unregister the listener from this model by unregistering its GraphListener adaption from the underlying Graph. @param a ModelChangedListener to unregister from model events @return this model, for cascading */ @Override public Model unregister( ModelChangedListener listener ) { getGraph().getEventManager().unregister( adapt( listener ) ); return this; }
/** Register the listener with this model by registering its GraphListener adaption with the underlying Graph. @param a ModelChangedListener to register for model events @return this model, for cascading */ @Override public Model register( ModelChangedListener listener ) { getGraph().getEventManager().register( adapt( listener ) ); return this; }
/** Remove a given reification from this model. Other reifications of the same statement are untouched. @param rs the reified statement to be removed */ public void removeReification( ReifiedStatement rs ) { ReifierStd.remove( model.getGraph(), rs.asNode(), rs.getStatement().asTriple() ); }
@Override public Model removeAll( Resource s, Property p, RDFNode o ) { getGraph().remove( asNode( s ), asNode( p ), asNode( o ) ); return this; }