use of org.apache.jena.atlas.lib.Tuple in project jena by apache.
the class ExQuadFilter method createFilter.
/** Create a filter to exclude the graph http://example/g2 */
private static Filter<Tuple<NodeId>> createFilter(Dataset ds) {
// Filtering operates at a very low level:
// Need to know the internal identifier for the graph name.
final NodeId target = TDBInternal.getNodeId(ds, NodeFactory.createURI(graphToHide));
System.out.println("Hide graph: " + graphToHide + " --> " + target);
// Filter for accept/reject as quad as being visible.
// Return true for "accept", false for "reject"
Filter<Tuple<NodeId>> filter = new Filter<Tuple<NodeId>>() {
@Override
public boolean accept(Tuple<NodeId> item) {
//System.err.println(item) ;
if (item.size() == 4 && item.get(0).equals(target)) {
//System.out.println("Reject: "+item) ;
return false;
}
//System.out.println("Accept: "+item) ;
return true;
}
};
return filter;
}