Alison; Gokhan's analysis is correct, that you only want one binding
for ?x. Another way to unserstand the query is that for each match of
the graph pattern, a variable can have only one value. In your case
when #1 and #4 were used, there was a value of ?x that was the same
(1 or 0). When bind operations #1-3 were included, ?x matched on the
value 0. For #2, #3, and #4, ?x was bound to different values, such
as ?x=-1 (#2), ?x=1 (#3), ?x=0 (#4). Same for the others.
The IF pattern Gokhan provided should provide a single binding to ?x,
although it's a bit unclear what the intentions of the query are. I.e.
wouldn't a FILTER statement do what you want?.
BTW, with SPARQL 1.1 property paths, the UNION in the WHERE clause can
be replaced by:
?agent rdfs:subClassOf | rdf:type ?agent_type .
-- Scott