Slice(Distinct(Project(OrderBy(Union(Filter((?term1 != ?term2) && (lcase(str(?term1) ) = lcase(str(?term2) ) ) && (?g1 != ?g2), Join(Graph(?g2, BGP( ?term2 ?a )), Graph(?g1, BGP( ?term1 ?a )))), BGP( ?s ?p ?o)), (?term1)), {?term1, ?g1, ?g2})), 0, 1000)