title: SPARQL - AND & OR Filters on Literal
body: <p>I am trying to understand how to do filtering in SPARQL with combined AND and OR conditions.</p>
  <p>I try to find all physicists living within Newton's lifetime via the Wikidata Query Service (query.wikidata.org). This is my query:</p>
  <pre><code>SELECT ?p1 ?p1Label ?p1t1 ?p1t2 ?p2 ?p2Label ?p2t1 ?p2t2
  WHERE {
    FILTER (?p1=wd:Q935) .    # Newton
    ?p1 wdt:P569 ?p1t1 .      # date of birth
    ?p1 wdt:P570 ?p1t2 .      # date of death
    ?p2 wdt:P106 wd:Q169470 . # physicist
    ?p2 wdt:P569 ?p2t1 .      # date of birth
    ?p2 wdt:P570 ?p2t2 .      # date of death
    { FILTER (xsd:dateTime(?p2t1) &gt; xsd:dateTime(?p1t1))
    . FILTER  (xsd:dateTime(?p2t1) &lt; xsd:dateTime(?p1t2)) }
    UNION
    { FILTER (xsd:dateTime(?p2t2) &gt; xsd:dateTime(?p1t1))
    . FILTER (xsd:dateTime(?p2t2) &lt; xsd:dateTime(?p1t2)) }
    UNION
    { FILTER (xsd:dateTime(?p2t1) &lt; xsd:dateTime(?p1t1))
    . FILTER (xsd:dateTime(?p2t2) &gt; xsd:dateTime(?p1t2)) } .
    SERVICE wikibase:label { bd:serviceParam wikibase:language &quot;en&quot; }
  }
  ORDER BY xsd:dateTime(?p2t1)
  </code></pre>
  <p>The query can be processed but does not yield any results.</p>
  <p>Each one of the three <code>{ FILTER . FILTER }</code> blocks works fine when used without the others.</p>
  <p>What am I doing wrong?</p>