/** 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; }
private List<Triple> asTriples( List<Statement> statements ) { List<Triple> L = new ArrayList<>( statements.size() ); for ( Statement statement : statements ) { L.add( statement.asTriple() ); } return L; }
@Override public boolean test(final Statement s) throws AuthenticationRequiredException { return evaluator.evaluateAny(principal, actions, modelNode, s.asTriple()); }
/** * Return a simplified print string for a statement */ public static String print(Statement stmt) { if (stmt == null) return "(null)"; return print(stmt.asTriple()); }
@Override public Model remove(Statement s) { graph.delete(s.asTriple()); return this; }
/** * 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()); }
public Map<Object, Integer> asBag( final List<Statement> l ) { final Map<Object, Integer> result = new HashMap<>(); for ( Statement aL : l ) { another( result, aL.asTriple() ); } return result; }
@Override public boolean test( final ReifiedStatement t ) { return evaluator.evaluateAny(evaluator.getPrincipal(), actions, modelNode, t.getStatement().asTriple()); }
@Override public String toString() throws ReadDeniedException, AuthenticationRequiredException { if (canRead() && canRead(holder.getBaseItem().asTriple())) { return holder.getBaseItem().toString(); } else { return super.toString(); } }
/** 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; }
@Override public double getDouble() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); checkRead(holder.getBaseItem().asTriple()); return holder.getBaseItem().getDouble(); }
@Override public char getChar() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); checkRead(holder.getBaseItem().asTriple()); return holder.getBaseItem().getChar(); }
@Override public short getShort() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); checkRead(holder.getBaseItem().asTriple()); return holder.getBaseItem().getShort(); }
@Override public boolean getBoolean() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); checkRead(holder.getBaseItem().asTriple()); return holder.getBaseItem().getBoolean(); }
@Override public int getInt() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); checkRead(holder.getBaseItem().asTriple()); return holder.getBaseItem().getInt(); }
@Override public long getLong() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); checkRead(holder.getBaseItem().asTriple()); return holder.getBaseItem().getLong(); }
@Override public boolean hasWellFormedXML() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); checkRead(holder.getBaseItem().asTriple()); return holder.getBaseItem().getLiteral().isWellFormedXML(); }
@Override public SecuredRDFNode getObject() throws ReadDeniedException, AuthenticationRequiredException { checkRead(); checkRead(holder.getBaseItem().asTriple()); final RDFNode rdfNode = holder.getBaseItem().getObject(); return SecuredRDFNodeImpl.getInstance(getModel(), rdfNode); }
@Override public SecuredStatement changeLiteralObject(final long o) throws UpdateDeniedException, AuthenticationRequiredException { checkUpdate(); final Triple base = holder.getBaseItem().asTriple(); final Triple newBase = getNewTriple(base, o); checkUpdate(base, newBase); return SecuredStatementImpl.getInstance(getModel(), holder .getBaseItem().changeLiteralObject(o)); }
@Override public SecuredStatement changeObject(final String o) throws UpdateDeniedException, AuthenticationRequiredException { checkUpdate(); final Triple base = holder.getBaseItem().asTriple(); final Triple newBase = getNewTriple(base, o); checkUpdate(base, newBase); return SecuredStatementImpl.getInstance(getModel(), holder .getBaseItem().changeObject(o)); }