title: "or" in a SPARQL query
body: <p>I don't quite understand why in SPARQL they haven't implemented the basic logic operators. However in most of the cases is possible to obtain the same result in a number of way.</p>
  <p>The purpose of this question is to have a quick reference for the possible way troughs that can substitute an &quot;or&quot; statement.</p>
  <p>Here's what I can think of:</p>
  <h3>1)<code>UNION</code></h3>
  <p>e.g:</p>
  <pre><code>SELECT * WHERE
  {  { ?s :propA ?o } UNION { ?s :propB ?o }  }
  </code></pre>
  <p>-not often suitable because it can became very verbose because</p>
  <pre><code>SELECT * WHERE { 
      { GRAPH ?g {?s ?p ?o. ?o ?pp ?data1}} UNION 
      { GRAPH ?g {?s ?p ?o. ?o ?pp ?data2}}
  } 
  </code></pre>
  <p>doesn't work as</p>
  <pre><code>SELECT * WHERE { 
      GRAPH ?g {
         ?s ?p ?o. 
         {?o ?pp ?data1} UNION 
         {?o ?pp ?data2} 
      }
   }
  </code></pre>
  <p>(at least not with Stardog)</p>
  <h3>2)<code>FILTER</code></h3>
  <p>e.g:</p>
  <pre><code>SELECT * WHERE
      { 
          ?s ?p ?o.
          FILTER (?p = :propA || ?p = :propB )
      }
  </code></pre>
  <p>Any other ideas?</p>