PREFIX :    <http://example/>
PREFIX  rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT (?s1 AS ?subset) (?s2 AS ?superset)
WHERE
{
    # All pairs of sets except (S,S)
    ?s2 rdf:type :Set .
    ?s1 rdf:type :Set .
    MINUS {
        # See subset-01 ...
        ?s1 rdf:type :Set .
        ?s2 rdf:type :Set .
        ?s1 :member ?x .
        FILTER ( NOT EXISTS { ?s2 :member ?x . } )
    }
    # Remove those that are the pairs with the same elements.
    # See set-equals-1
    MINUS {
        ?s2 rdf:type :Set .
        ?s1 rdf:type :Set .
        MINUS 
        {
            ?s1 rdf:type :Set .
            ?s2 rdf:type :Set .
            ?s1 :member ?x .
            FILTER NOT EXISTS { ?s2 :member ?x . }
        }
        MINUS 
        {
            ?s1 rdf:type :Set .
            ?s2 rdf:type :Set .
            ?s2 :member ?x .
            FILTER NOT EXISTS { ?s1 :member ?x . }
        }
    }
}
