they're equal if they return the same query
 Takes a string and adds a where clause to this criteria.
 Returns a criteria object.
 Note: the subject being returned by the query must be identified by ?uri
 e.g. my_criteria.where("?uri a <http://my-type>")
424176
def where(filter)
      if filter.is_a?(String) # we got a Sparql snippet
        where_clauses << filter
      elsif filter.is_a?(Hash)
        filter.each_pair do |key, value|
          field = resource_class.get_field(key)
          value = RDF::Literal.new(value) unless value.respond_to?(:to_base)
          where_clauses << "?uri <#{ field.predicate }> #{ value.to_base }"
        end
      end
      self
    end
996566
def equal_to(self, key, value):
        
        self._where[key] = utils.encode(value)
        return self
401041
def create_criteria(cls, query):
        
        criteria = []
        for name, value in query.items():
            if isinstance(value, list):
                for inner_value in value:
                    criteria += cls.create_criteria({name: inner_value})
            else:
                criteria.append({
                    'criteria': {
                        'field': name,
                        'value': value,
                    },
                })
        return criteria or None
1297044
def _match(self, query):
        
        response = self._match_dialog(query)
        if response is not None:
            return response

        response = self._match_getters(query)
        if response is not None:
            return response

        response = self._match_registers(query)
        if response is not None:
            return response

        response = self._match_errors_queues(query)
        if response is not None:
            return response

        response = self._match_setters(query)
        if response is not None:
            return response

        if response is None:
            for channel in self._channels.values():
                response = channel.match(query)
                if response:
                    return response

        return None
1299369
protected Predicate createNotEqual(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyPath, Object argument,
                                       PersistenceContext context)
    {
        return cb.notEqual(root.get(propertyPath), argument);
    }
1291706
def where(self, *custom_restrictions, **restrictions):
        
        for attr, value in restrictions.items():
            self.where_query[attr] = value
        if custom_restrictions:
            self.custom_where.append(tuple(custom_restrictions))
        return self
262177
def match(value, query):
    
    if type(query) in [str, int, float, type(None)]:
        return value == query
    elif type(query) == dict and len(query.keys()) == 1:
        for op in query:
            if op == "$eq": return value == query[op]
            elif op == "$lt": return value < query[op]
            elif op == "$lte": return value <= query[op]
            elif op == "$gt": return value > query[op]
            elif op == "$gte": return value >= query[op]
            elif op == "$ne": return value != query[op]
            elif op == "$in": return value in query[op]
            elif op == "$nin": return value not in query[op]
            else: GeoQLError("Not a valid query operator: " + op)
    else:
        raise GeoQLError("Not a valid query: " + str(query))
963137
def where_in(self, field_name, values, exact=False):
        
        field_name = Query.escape_if_needed(field_name)
        self._add_operator_if_needed()
        self.negate_if_needed(field_name)

        token = _Token(field_name=field_name, value=self.add_query_parameter(list(Utils.unpack_iterable(values))),
                       token="in", exact=exact)
        token.write = self.rql_where_write(token)
        self._where_tokens.append(token)

        return self
554005
def _where_clause(where):
        
        assert isinstance(where, tuple)
        if len(where) == 3:
            where_col, operator, where_val = where
        else:
            where_col, where_val = where
            operator = '='
        assert operator in SELECT_WHERE_OPERATORS

        # Concatenate WHERE clause (ex: **first_name='John'**)
        return "{0}{1}'{2}'".format(where_col, operator, where_val)
394097
public function addWhere($where, $params = [], $operator = 'AND')
    {
        if ($where instanceof Criteria) {
            return $this->addCriteria($where);
        }
        if (null === $where) {
            return $this;
        }
        if (isset($this->query['where']) && !empty($this->query['where'])) {
            $operator = strtoupper($operator);
            $where = "({$this->query['where']}) {$operator} ({$where})";
        }
        $this->query['where'] = $where;
        $this->addParams($params);
        return $this;
    }
498503
def query=(query)
      raise ArgumentError, "Invalid URL: #{self.url}" unless self.url.respond_to?(:query)
      if query.kind_of?(Hash)
        query = build_query_from_hash(query)
      end
      query = query.to_s unless query.is_a?(String)
      self.url.query = query
    end
1357512
def _get_repo_filter(self, query):
        
        if self.filter is not None:
            return query.extra(where=[self.filter])
        return query
52048
@Transactional(readOnly = true)
	public Collection<Response> find(SearchCriteria searchCriteria) {
		CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
		CriteriaQuery<Response> criteriaQuery = criteriaBuilder.createQuery(Response.class);
		Root<Response> root = criteriaQuery.from(Response.class);
		
		Collection<Predicate> conditions = new ArrayList<>();
		
		if (searchCriteria.getUser() != null) {
			Predicate userCondition = criteriaBuilder.equal(root.get("user").get("username"), searchCriteria.getUser().getUsername());
			conditions.add(userCondition);
		}
		
		if (searchCriteria.getDetectionSystemIds() != null) {
			Predicate detectionSystemCondition = root.get("detectionSystem").get("detectionSystemId").in(searchCriteria.getDetectionSystemIds());
			conditions.add(detectionSystemCondition);
		}

		if (conditions.size() > 0) {
			criteriaQuery.where(criteriaBuilder.and(conditions.toArray(new Predicate[0])));
		}
		
		criteriaQuery.orderBy(criteriaBuilder.asc(root.get("timestamp")));

		TypedQuery<Response> query = em.createQuery(criteriaQuery); 
		List<Response> result = query.getResultList();
		
		return result;
	}
982711
public final QueryParser.equal_return equal() throws RecognitionException {
        QueryParser.equal_return retval = new QueryParser.equal_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token WS71=null;
        Token EQUAL72=null;
        Token WS73=null;
        QueryParser.field_return field70 = null;

        QueryParser.value_return value74 = null;


        CommonTree WS71_tree=null;
        CommonTree EQUAL72_tree=null;
        CommonTree WS73_tree=null;

        try {
            // src/riemann/Query.g:65:7: ( field ( WS )* EQUAL ( WS )* value )
            // src/riemann/Query.g:65:9: field ( WS )* EQUAL ( WS )* value
            {
            root_0 = (CommonTree)adaptor.nil();

            pushFollow(FOLLOW_field_in_equal488);
            field70=field();

            state._fsp--;

            adaptor.addChild(root_0, field70.getTree());
            // src/riemann/Query.g:65:15: ( WS )*
            loop27:
            do {
                int alt27=2;
                int LA27_0 = input.LA(1);

                if ( (LA27_0==WS) ) {
                    alt27=1;
                }


                switch (alt27) {
            	case 1 :
            	    // src/riemann/Query.g:65:15: WS
            	    {
            	    WS71=(Token)match(input,WS,FOLLOW_WS_in_equal490); 
            	    WS71_tree = (CommonTree)adaptor.create(WS71);
            	    adaptor.addChild(root_0, WS71_tree);


            	    }
            	    break;

            	default :
            	    break loop27;
                }
            } while (true);

            EQUAL72=(Token)match(input,EQUAL,FOLLOW_EQUAL_in_equal493); 
            EQUAL72_tree = (CommonTree)adaptor.create(EQUAL72);
            root_0 = (CommonTree)adaptor.becomeRoot(EQUAL72_tree, root_0);

            // src/riemann/Query.g:65:26: ( WS )*
            loop28:
            do {
                int alt28=2;
                int LA28_0 = input.LA(1);

                if ( (LA28_0==WS) ) {
                    alt28=1;
                }


                switch (alt28) {
            	case 1 :
            	    // src/riemann/Query.g:65:26: WS
            	    {
            	    WS73=(Token)match(input,WS,FOLLOW_WS_in_equal496); 
            	    WS73_tree = (CommonTree)adaptor.create(WS73);
            	    adaptor.addChild(root_0, WS73_tree);


            	    }
            	    break;

            	default :
            	    break loop28;
                }
            } while (true);

            pushFollow(FOLLOW_value_in_equal499);
            value74=value();

            state._fsp--;

            adaptor.addChild(root_0, value74.getTree());

            }

            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
1150970
public Object searchEqual(
                             Object            searchKey)
    {
        SearchComparator comp = searchComparator(SearchComparator.EQ);
        Object p = find(comp, searchKey);
        return p;
    }
998999
def get(self, *args, **kwargs):
        
        if self.query.where:
            # If there is any other ``where`` filter on this QuerySet just call
            # super. There will be a where clause if this QuerySet has already
            # been filtered/cloned.
            return super(CachingQuerySet, self).get(*args, **kwargs)
 
        # Punt on anything more complicated than get by pk/id only...
        if len(kwargs) == 1:
            k = kwargs.keys()[0]
            if k in ('pk', 'pk__exact', '%s' % self.model._meta.pk.attname, 
                     '%s__exact' % self.model._meta.pk.attname):
                obj = cache.get(self.model._cache_key(pk=kwargs.values()[0]))
                if obj is not None:
                    obj.from_cache = True
                    return obj
 
        # Calls self.iterator to fetch objects, storing object in cache.
        return super(CachingQuerySet, self).get(*args, **kwargs)
263487
def where(self, key, operator, value):
        
        self.__store_query({"key": key, "operator": operator, "value": value})
        return self