public void findPredicates(final RippleValue subject,
final Sink<RippleValue> sink)
throws RippleException {
final Sink<Value> valueSink = new Sink<Value>() {
public void put(final Value v) throws RippleException {
sink.put(connection.canonicalValue(new RDFValue(v)));
}
};
Sink<Statement> predSelector = new Sink<Statement>() {
Sink<Value> predSink = new DistinctFilter<Value>(valueSink);
public void put(final Statement st) throws RippleException {
//TODO: don't create a new RdfValue before checking for uniqueness
predSink.put(st.getPredicate());
}
};
RDFValue v = subject.toRDF(connection);
// Not all RippleValues have an RDF identity.
if (null != v) {
connection.getStatements(v, null, null, predSelector);
}
}