PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX math: <http://www.w3.org/2000/10/swap/math#>
PREFIX e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
PREFIX : <http://josd.github.io/eye/reasoning#>

{(?U ?N) :randomsample ?A} <=
{
    ?U log:semantics ?G.
    ?G e:graphList ?L.
    ?L math:memberCount ?C.
    ?S e:findall (
        ?T
        {   ("between" 1 ?N ?I) e:derive true.
            (?C) e:random ?J.
            ("nth0" ?J ?L ?T) e:derive true.
        }
        ?B
    ).
    ?B log:conjunction ?A.
}.
