Sample n items without replacement in Prolog
In SWI-Prolog you could do this that way:

sample_swi(Domain, N, Sample) :-
    random_permutation(Domain, Permutation),
    length(Sample, N),
    append(Sample, _, Permutation).


Be careful, this predicate is not a true relation (just as in your code).