code: def make_sparql_filter(filters):
      
      def make_filter_str(variable, operator, union_type, values):
          """ generates a filter string for a sparql query
  
          args:
              variable: the variable to reference
              operator: '=' or '!='
              union_type" '&&' or '||'
              values: list of values to apply the filter
          """
          formated_vals = UniqueList()
          for val in values:
              try:
                  formated_vals.append(val.sparql)
              except AttributeError:
                  formated_vals.append(val)
          pre_str = "?%s%s" % (variable.replace("?", ""), operator)
          union = "%s\n\t\t" % union_type
          return "\tFilter( %s) .\n" % union.join([pre_str + val
                                                        for val in formated_vals])
  
      if not filters:
          return ""
      rtn_str = ""
      for param in filters:
          rtn_str += make_filter_str(**param)
      return rtn_str
docs: Make the filter section for a query template
  
      args:
          filters: list of dictionaries to generate the filter
  
      example:
          filters = [{'variable': 'p',
                      'operator': '=',
                      'union_type': '||',
                      'values': ['rdf:type', 'rdfs:label']}]