title: SPARQL BIND breaks VALUES?
body: <p>I was using VALUES in many SPARQL queries recently, only to realize that in one of them I was not getting what I was expecting.</p>
  
  <p>Here is a simple case:</p>
  
  <pre><code>@prefix ns: &lt;http://some/ns&gt; .
  
  &lt;http://some/uri&gt; a ns:Document ;
  ns:A5000 "00003381" ;
  ns:A5080 "sredniowiecze" .
  </code></pre>
  
  <p>I am using VALUES to "translate" from nsA5080 literals to URIs. The simple query:</p>
  
  <pre><code>PREFIX ns: &lt;http://some/ns&gt;
  SELECT  ?document ?u ?p ?lp 
  WHERE
  {
       ?document ns:A5080 ?p .    
        VALUES (?p ?u) {
              ( "sredniowiecze" ns:MiddleAges )
              ( "other" ns:Other )
      }    
  }
  </code></pre>
  
  <p>works as expected:</p>
  
  <pre><code>Document    U   P LP 
  &lt;http://some/uri&gt;   &lt;http://some/nsMiddleAges&gt;  "sredniowiecze" 
  </code></pre>
  
  <p>But if I will change it to:</p>
  
  <pre><code>SELECT  ?document ?u ?p ?lp 
  WHERE
  {
        ?document ns:A5080 ?p .    
        BIND ( LCASE(?p) AS ?lp )
        VALUES (?lp ?u) {
              ( "sredniowiecze" ns:MiddleAges )
              ( "other" ns:Other )
      }    
  
  }
  </code></pre>
  
  <p>I am getting:</p>
  
  <pre><code>Document    U   P   Lp
  &lt;http://some/uri&gt;   &lt;http://some/nsMiddleAges&gt;  "sredniowiecze" "sredniowiecze"
  &lt;http://some/uri&gt;   &lt;http://some/nsOther&gt;   "sredniowiecze" "sredniowiecze"
  </code></pre>
  
  <p>Which does not make any sens to me. Where does the extra tuple come from? In the real query I have ca. 30+ tuples in VALUES and they all land in the results. 
  What is more interesting queries that look almost like that one - work just fine everywhere else. </p>
  
  <p>Ideas?</p>