I have a query returning a couple of variable, ?a
and ?b
. The problem is that the results contain, for instance, 10, 15
, and 15, 10
. I need only one of these. How can I check if the tuple already exists?
My query is messy but looks like below:
SELECT DISTINCT ?a ?b
WHERE { ?a rno:is_extent_of ?x1
; rno:is_extent_of ?x2
. ?b rno:is_extent_of ?x3
; rno:is_extent_of ?x4
. ?x1 rno:is_part_of ?d
. ?x3 rno:is_part_of ?d
. ?d a rno:detailed_partition
. ?x2 rno:is_part_of ?r
. ?x4 rno:is_part_of ?r
. ?r a rno:Roundabout
. FILTER ( ?x1 != ?x2
&& ?x1 != ?x3
&& ?x1 != ?x4 )
}