title: Filtering data in SPARQL query using python script
body: <p>I am trying to get uri against firstname literal of the user using following query in RDFlib Python.</p>
  
  <pre><code>plugin.register(
      'sparql', rdflib.query.Processor,
      'rdfextras.sparql.processor', 'Processor')
  plugin.register(
      'sparql', rdflib.query.Result,
      'rdfextras.sparql.query', 'SPARQLQueryResult')
  
  f1Str="Thomas"
  
  ecsuri= GraphS.query("""
                      PREFIX akt: &lt;http://www.aktors.org/ontology/portal#&gt;
  
                      SELECT ?akturi WHERE{
                          ?akturi akt:family-name ?fname.
                          FILTER (?fname = """+f1Str+""")
  
                      }""")
  </code></pre>
  
  <p>It gives following error and it seems to be due to <strong><em>f1Str</em></strong>, how can we filter data in SPARQL using value stored in some variable. Please help.</p>
  
  <pre><code>*Exception Type: ParseException
  Exception Value: Expected "}" (at char 481), (line:10, col:29)*
  </code></pre>