/** returns an array of triples corresponding to the array of statements; ie the i'th element of the result is the i'th element of the input as a triple. @param statements the array of statements to convert @return the corresponding array of triples */ public static Triple [] asTriples( Statement [] statements ) { Triple [] triples = new Triple[statements.length]; for (int i = 0; i < statements.length; i += 1) triples[i] = statements[i].asTriple(); return triples; }
@Override public Triple convert(Statement item) { return item.asTriple(); } }),
@Override public Triple apply(final Statement s) { return s.asTriple(); }
@Override public Triple map1( Statement s ) { return s.asTriple(); } };
private List<Triple> asTriples( List<Statement> statements ) { List<Triple> L = new ArrayList<Triple>( statements.size() ); for (int i = 0; i < statements.size(); i += 1) L.add( statements.get(i).asTriple() ); return L; }
/** * Return a simplified print string for a statment */ public static String print(Statement stmt) { if (stmt == null) return "(null)"; return print(stmt.asTriple()); }
/** Answer whatever the triple-boundary answers for the triple of <code>s</code>. */ @Override public boolean stopAt( Statement s ) { return tb.stopAt( s.asTriple() ); }
@Override public Model remove(Statement s) { graph.delete(s.asTriple()); return this; }
@Override public Triple next() { Statement st = it.next(); return st.asTriple(); }
@Override public boolean contains( Statement s ) { return graph.contains( s.asTriple() ); }
public Model explain(Statement stmt) { return explainTriple( stmt.asTriple() ); }
/** * Return the derivation of the given statement (which should be the result of * some previous list operation). * Not all reasoneers will support derivations. * @return an iterator over Derivation records or null if there is no derivation information * available for this triple. */ @Override public Iterator<Derivation> getDerivation(Statement statement) { return getInfGraph().getDerivation(statement.asTriple()); }
/** * Return the derivation of the given statement (which should be the result of * some previous list operation). * Not all reasoneers will support derivations. * @return an iterator over Derivation records or null if there is no derivation information * available for this triple. */ @Override public Iterator<Derivation> getDerivation(Statement statement) { return (getGraph() instanceof InfGraph) ? ((InfGraph) getGraph()).getDerivation( statement.asTriple() ) : null; }
baseURI = r.getProperty(baseURIProp).asTriple().getObject().toString(); baseURI = baseURI.replace("\"", "");
/** tell the underlying graph's reifier that this ReifiedStatement's node represents any Statement with this statement's triple. (May throw an exception if the node is already reified to something different.) */ private ReifiedStatementImpl installInReifier() { ReifierStd.reifyAs(getModel().getGraph(), this.asNode(), statement.asTriple() ); 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() ); }
object); return s.asTriple();
private String show( Model m, PrefixMapping pm ) { StringBuilder sb = new StringBuilder(); sb.append( "\n" ); for (Statement s: m.listStatements().toList()) { sb.append( " " ).append( s.asTriple().toString( pm ) ).append( "\n" ); } return sb.toString(); }