title: Using condition in SPARQL query
body: <p>I have a SPARQL query which is like this-</p>
  
  <pre><code>SELECT ?informationPath ?businessEntitylabel ?path ?sourced ?mastered ?delivered
  WHERE {
  ?businessEntity dd:hasPropertyPath ?informationPath .
  ?businessEntity rdfs:label ?businessEntitylabel .
  ?informationPath dd:hasPath ?path .
  OPTIONAL {
  ?informationPath a dd:SourcedData .
  BIND("Yes" as ?sourced)
  }
  OPTIONAL {
  ?informationPath a dd:MasteredData .
  BIND("Yes" as ?mastered)
  }
  OPTIONAL {
  ?informationPath a dd:DeliveredData .
  BIND("Yes" as ?delivered)
  }
  } ORDER BY ?businessEntitylabel ?path
  </code></pre>
  
  <p>Now I want to have only one column instead of ?sourced ?mastered ?delivered and name is ?traceability. And the column will show if an ?informationPath is Mastered data or Sourced data or delivered data and accordingly I want to BIND ("Sourced data" as ?traceability) or ("Mastered data" as ?traceability) or ("Delivered data" as ?traceability)</p>
  
  <p>I am new in SPARQL, and I was wondering if there is any 'if' statement in SPARQL which can be used as-</p>
  
  <pre><code>if(?informationPath a dd:SourcedData)
  BIND("SourcedData" as ?traceability)
  </code></pre>
  
  <p>Any help will be much appreciated.</p>