public static Conjunction<Pattern> atomsToPattern(List<Atom> atoms, Set<IdPredicate> subs){
        return Graql.and(
                Stream.concat(
                        atoms.stream().flatMap(at -> Stream.concat(Stream.of(at), at.getNonSelectableConstraints())),
                        subs.stream()
                )
                        .map(Atomic::getCombinedPattern)
                        .flatMap(p -> p.statements().stream())
                        .collect(Collectors.toSet())
        );
    }
public static Conjunction < Pattern > atomsToPattern ( List < Atom > atoms , Set < IdPredicate > subs ) { return Graql . and ( Stream . concat ( atoms . stream ( ) . flatMap ( at -> Stream . concat ( Stream . of ( at ) , at . getNonSelectableConstraints ( ) ) ) , subs . stream ( ) ) . map ( Atomic :: getCombinedPattern ) . flatMap ( p -> p . statements ( ) . stream ( ) ) . collect ( Collectors . toSet ( ) ) ) ; }
@param atoms of interest
@param subs extra substitutions in the form of id predicates
@return conjunctive pattern composed of atoms + their constraints + subs