public static Iterator<Triple> listMember(Graph graph, final Node s, Node o) {
if ( isAny(s) ) {
Set<Node> x = findAllLists(graph) ;
IteratorConcat<Triple> iterConcat = new IteratorConcat<>() ;
for ( Node s2 : x ) {
Iterator<Triple> iter = listMember(graph, s2, o) ;
if ( iter.hasNext() )
iterConcat.add(iter);
}
return iterConcat ;
}
GNode gn = new GNode(graph, s) ;
if ( ! isAny(o) ) {
if ( contains(gn, o) )
return Iter.singleton(Triple.create(s, ListPFunction.nListMember, o)) ;
else
return Iter.nullIterator() ;
}
List<Node> x = members(gn) ;
return Iter.map(x.iterator(), t -> Triple.create(s, ListPFunction.nListMember, t)) ;
}