def __init__(self,
                 keyword = None,
                 conceptUri = None,
                 categoryUri = None,
                 sourceUri = None,
                 locationUri = None,
                 lang = None,
                 dateStart = None,
                 dateEnd = None,
                 dateMention = None,
                 sourceLocationUri = None,
                 sourceGroupUri=None,
                 authorUri = None,
                 keywordLoc = "body",
                 minMaxArticlesInEvent = None,
                 exclude = None):
        """
        @param keyword: keyword(s) to query. Either None, string or QueryItems instance
        @param conceptUri: concept(s) to query. Either None, string or QueryItems instance
        @param sourceUri: source(s) to query. Either None, string or QueryItems instance
        @param locationUri: location(s) to query. Either None, string or QueryItems instance
        @param categoryUri: categories to query. Either None, string or QueryItems instance
        @param lang: language(s) to query. Either None, string or QueryItems instance
        @param dateStart: starting date. Either None, string or date or datetime
        @param dateEnd: ending date. Either None, string or date or datetime
        @param dateMention: search by mentioned dates - Either None, string or date or datetime or a list of these types
        @param sourceLocationUri: find content generated by news sources at the specified geographic location - can be a city URI or a country URI. Multiple items can be provided using a list
        @param sourceGroupUri: a single or multiple source group URIs. A source group is a group of news sources, commonly defined based on common topic or importance
        @param authorUri: author(s) to query. Either None, string or QueryItems instance
        @param keywordLoc: where should we look when searching using the keywords provided by "keyword" parameter. "body" (default), "title", or "body,title"
        @param minMaxArticlesInEvent: a tuple containing the minimum and maximum number of articles that should be in the resulting events. Parameter relevant only if querying events
        @param exclude: a instance of BaseQuery, CombinedQuery or None. Used to filter out results matching the other criteria specified in this query
        """
        super(BaseQuery, self).__init__()

        self._setQueryArrVal("keyword", keyword)
        self._setQueryArrVal("conceptUri", conceptUri)
        self._setQueryArrVal("categoryUri", categoryUri)
        self._setQueryArrVal("sourceUri", sourceUri)
        self._setQueryArrVal("locationUri", locationUri)
        self._setQueryArrVal("lang", lang)

        # starting date of the published articles (e.g. 2014-05-02)
        if dateStart != None:
            self._queryObj["dateStart"] = QueryParamsBase.encodeDate(dateStart)
        # ending date of the published articles (e.g. 2014-05-02)
        if dateEnd != None:
            self._queryObj["dateEnd"] = QueryParamsBase.encodeDate(dateEnd)

        # mentioned date detected in articles (e.g. 2014-05-02)
        if dateMention != None:
            if isinstance(dateMention, list):
                self._queryObj["dateMention"] = [QueryParamsBase.encodeDate(d) for d in dateMention]
            else:
                self._queryObj["dateMention"] = QueryParamsBase.encodeDate(dateMention)

        self._setQueryArrVal("sourceLocationUri", sourceLocationUri)
        self._setQueryArrVal("sourceGroupUri", sourceGroupUri)
        self._setQueryArrVal("authorUri", authorUri)

        if keywordLoc != "body":
            self._queryObj["keywordLoc"] = keywordLoc

        if minMaxArticlesInEvent != None:
            assert isinstance(minMaxArticlesInEvent, tuple), "minMaxArticlesInEvent parameter should either be None or a tuple with two integer values"
            self._queryObj["minArticlesInEvent"] = minMaxArticlesInEvent[0]
            self._queryObj["maxArticlesInEvent"] = minMaxArticlesInEvent[1]

        if exclude != None:
            assert isinstance(exclude, (CombinedQuery, BaseQuery)), "exclude parameter was not a CombinedQuery or BaseQuery instance"
            self._queryObj["$not"] = exclude.getQuery()
def __init__ ( self , keyword = None , conceptUri = None , categoryUri = None , sourceUri = None , locationUri = None , lang = None , dateStart = None , dateEnd = None , dateMention = None , sourceLocationUri = None , sourceGroupUri = None , authorUri = None , keywordLoc = "body" , minMaxArticlesInEvent = None , exclude = None ) : super ( BaseQuery , self ) . __init__ ( ) self . _setQueryArrVal ( "keyword" , keyword ) self . _setQueryArrVal ( "conceptUri" , conceptUri ) self . _setQueryArrVal ( "categoryUri" , categoryUri ) self . _setQueryArrVal ( "sourceUri" , sourceUri ) self . _setQueryArrVal ( "locationUri" , locationUri ) self . _setQueryArrVal ( "lang" , lang ) if dateStart != None : self . _queryObj [ "dateStart" ] = QueryParamsBase . encodeDate ( dateStart ) if dateEnd != None : self . _queryObj [ "dateEnd" ] = QueryParamsBase . encodeDate ( dateEnd ) if dateMention != None : if isinstance ( dateMention , list ) : self . _queryObj [ "dateMention" ] = [ QueryParamsBase . encodeDate ( d ) for d in dateMention ] else : self . _queryObj [ "dateMention" ] = QueryParamsBase . encodeDate ( dateMention ) self . _setQueryArrVal ( "sourceLocationUri" , sourceLocationUri ) self . _setQueryArrVal ( "sourceGroupUri" , sourceGroupUri ) self . _setQueryArrVal ( "authorUri" , authorUri ) if keywordLoc != "body" : self . _queryObj [ "keywordLoc" ] = keywordLoc if minMaxArticlesInEvent != None : assert isinstance ( minMaxArticlesInEvent , tuple ) , "minMaxArticlesInEvent parameter should either be None or a tuple with two integer values" self . _queryObj [ "minArticlesInEvent" ] = minMaxArticlesInEvent [ 0 ] self . _queryObj [ "maxArticlesInEvent" ] = minMaxArticlesInEvent [ 1 ] if exclude != None : assert isinstance ( exclude , ( CombinedQuery , BaseQuery ) ) , "exclude parameter was not a CombinedQuery or BaseQuery instance" self . _queryObj [ "$not" ] = exclude . getQuery ( )
@param keyword: keyword(s) to query. Either None, string or QueryItems instance
        @param conceptUri: concept(s) to query. Either None, string or QueryItems instance
        @param sourceUri: source(s) to query. Either None, string or QueryItems instance
        @param locationUri: location(s) to query. Either None, string or QueryItems instance
        @param categoryUri: categories to query. Either None, string or QueryItems instance
        @param lang: language(s) to query. Either None, string or QueryItems instance
        @param dateStart: starting date. Either None, string or date or datetime
        @param dateEnd: ending date. Either None, string or date or datetime
        @param dateMention: search by mentioned dates - Either None, string or date or datetime or a list of these types
        @param sourceLocationUri: find content generated by news sources at the specified geographic location - can be a city URI or a country URI. Multiple items can be provided using a list
        @param sourceGroupUri: a single or multiple source group URIs. A source group is a group of news sources, commonly defined based on common topic or importance
        @param authorUri: author(s) to query. Either None, string or QueryItems instance
        @param keywordLoc: where should we look when searching using the keywords provided by "keyword" parameter. "body" (default), "title", or "body,title"
        @param minMaxArticlesInEvent: a tuple containing the minimum and maximum number of articles that should be in the resulting events. Parameter relevant only if querying events
        @param exclude: a instance of BaseQuery, CombinedQuery or None. Used to filter out results matching the other criteria specified in this query