def __init__(self,
                 keywords = None,
                 conceptUri = None,
                 categoryUri = None,
                 sourceUri = None,
                 sourceLocationUri = None,
                 sourceGroupUri = None,
                 authorUri = None,
                 locationUri = None,
                 lang = None,
                 dateStart = None,
                 dateEnd = None,
                 minSentiment = -1,
                 maxSentiment = 1,
                 minArticlesInEvent = None,
                 maxArticlesInEvent = None,
                 dateMentionStart = None,
                 dateMentionEnd = None,
                 ignoreKeywords = None,
                 ignoreConceptUri = None,
                 ignoreCategoryUri = None,
                 ignoreSourceUri = None,
                 ignoreSourceLocationUri = None,
                 ignoreSourceGroupUri = None,
                 ignoreAuthorUri = None,
                 ignoreLocationUri = None,
                 ignoreLang = None,
                 keywordsLoc = "body",
                 ignoreKeywordsLoc = "body",
                 requestedResult = None):
        """
        Query class for searching for events in the Event Registry.
        The resulting events have to match all specified conditions. If a parameter value equals "" or [], then it is ignored.
        In order for query to be valid, it has to have at least one positive condition (condition that does not start with ignore*).

        @param keywords: find events where articles mention all the specified keywords.
            A single keyword/phrase can be provided as a string, multiple keywords/phrases can be provided as a list of strings.
            Use QueryItems.AND() if *all* provided keywords/phrases should be mentioned, or QueryItems.OR() if *any* of the keywords/phrases should be mentioned.
        @param conceptUri: find events where the concept with concept uri is important.
            A single concept uri can be provided as a string, multiple concept uris can be provided as a list of strings.
            Use QueryItems.AND() if *all* provided concepts should be mentioned, or QueryItems.OR() if *any* of the concepts should be mentioned.
            To obtain a concept uri using a concept label use EventRegistry.getConceptUri().
        @param categoryUri: find events that are assigned into a particular category.
            A single category uri can be provided as a string, multiple category uris can be provided as a list of strings.
            Use QueryItems.AND() if *all* provided categories should be mentioned, or QueryItems.OR() if *any* of the categories should be mentioned.
            A category uri can be obtained from a category name using EventRegistry.getCategoryUri().
        @param sourceUri: find events that contain one or more articles that have been written by a news source sourceUri.
            If multiple sources should be considered use QueryItems.OR() to provide the list of sources.
            Source uri for a given news source name can be obtained using EventRegistry.getNewsSourceUri().
        @param sourceLocationUri: find events that contain one or more articles that were written by news sources located in the given geographic location.
            If multiple source locations are provided, then put them into a list inside QueryItems.OR()
            Location uri can either be a city or a country. Location uri for a given name can be obtained using EventRegistry.getLocationUri().
        @param sourceGroupUri: find events that contain one or more articles that were written by news sources that are assigned to the specified source group.
            If multiple source groups are provided, then put them into a list inside QueryItems.OR()
            Source group uri for a given name can be obtained using EventRegistry.getSourceGroupUri().
        @param authorUri: find events that contain one or more articles that have been written by a specific author.
            If multiple authors should be considered use QueryItems.OR() or QueryItems.AND() to provide the list of authors.
            Author uri for a given author name can be obtained using EventRegistry.getAuthorUri().
        @param locationUri: find events that occured at a particular location.
            If value can be a string or a list of strings provided in QueryItems.OR().
            Location uri can either be a city or a country. Location uri for a given name can be obtained using EventRegistry.getLocationUri().
        @param lang: find events for which we found articles in the specified language.
            If more than one language is specified, resulting events has to be reported in *any* of the languages.
        @param dateStart: find events that occured on or after dateStart. Date should be provided in YYYY-MM-DD format, datetime.time or datetime.datetime.
        @param dateEnd: find events that occured before or on dateEnd. Date should be provided in YYYY-MM-DD format, datetime.time or datetime.datetime.
        @param minSentiment: minimum value of the sentiment, that the returned events should have. Range [-1, 1]. Note: setting the value will remove all events that don't have
                a computed value for the sentiment (all events that are not reported in English language)
        @param maxSentiment: maximum value of the sentiment, that the returned events should have. Range [-1, 1]. Note: setting the value will remove all events that don't have
                a computed value for the sentiment (all events that are not reported in English language)
        @param minArticlesInEvent: find events that have been reported in at least minArticlesInEvent articles (regardless of language)
        @param maxArticlesInEvent: find events that have not been reported in more than maxArticlesInEvent articles (regardless of language)
        @param dateMentionStart: find events where articles explicitly mention a date that is equal or greater than dateMentionStart.
        @param dateMentionEnd: find events where articles explicitly mention a date that is lower or equal to dateMentionEnd.
        @param ignoreKeywords: ignore events where articles about the event mention any of the provided keywords
        @param ignoreConceptUri: ignore events that are about any of the provided concepts
        @param ignoreCategoryUri: ignore events that are about any of the provided categories
        @param ignoreSourceUri: ignore events that have have articles which have been written by any of the specified news sources
        @param ignoreSourceLocationUri: ignore events that have articles which been written by sources located at *any* of the specified locations
        @param ignoreSourceGroupUri: ignore events that have articles which have been written by sources in *any* of the specified source groups
        @param ignoreAuthorUri: ignore articles that were written by *any* of the specified authors
        @param ignoreLocationUri: ignore events that occured in any of the provided locations. A location can be a city or a place
        @param ignoreLang: ignore events that are reported in any of the provided languages
        @param keywordsLoc: what data should be used when searching using the keywords provided by "keywords" parameter. "body" (default), "title", or "body,title"
        @param ignoreKeywordsLoc: what data should be used when searching using the keywords provided by "ignoreKeywords" parameter. "body" (default), "title", or "body,title"
        @param requestedResult: the information to return as the result of the query. By default return the list of matching events
        """
        super(QueryEvents, self).__init__()

        self._setVal("action", "getEvents")

        self._setQueryArrVal(keywords, "keyword", "keywordOper", "and")
        self._setQueryArrVal(conceptUri, "conceptUri", "conceptOper", "and")
        self._setQueryArrVal(categoryUri, "categoryUri", "categoryOper", "or")
        self._setQueryArrVal(sourceUri, "sourceUri", "sourceOper", "or")
        self._setQueryArrVal(sourceLocationUri, "sourceLocationUri", None, "or")
        self._setQueryArrVal(sourceGroupUri, "sourceGroupUri", "sourceGroupOper", "or")
        self._setQueryArrVal(authorUri, "authorUri", "authorOper", "or")
        self._setQueryArrVal(locationUri, "locationUri", None, "or")        # location such as "http://en.wikipedia.org/wiki/Ljubljana"

        self._setQueryArrVal(lang, "lang", None, "or")                      # a single lang or list (possible: eng, deu, spa, zho, slv)

        if (dateStart != None):
            self._setDateVal("dateStart", dateStart)        # e.g. 2014-05-02
        if (dateEnd != None):
            self._setDateVal("dateEnd", dateEnd)            # e.g. 2014-05-02
        if minSentiment != -1:
            assert minSentiment >= -1 and minSentiment <= 1
            self._setVal("minSentiment", minSentiment)      # e.g. -0.5
        if maxSentiment != 1:
            assert maxSentiment >= -1 and maxSentiment <= 1
            self._setVal("maxSentiment", maxSentiment)      # e.g. 0.5

        self._setValIfNotDefault("minArticlesInEvent", minArticlesInEvent, None)
        self._setValIfNotDefault("maxArticlesInEvent", maxArticlesInEvent, None)

        if (dateMentionStart != None):
            self._setDateVal("dateMentionStart", dateMentionStart)      # e.g. 2014-05-02
        if (dateMentionEnd != None):
            self._setDateVal("dateMentionEnd", dateMentionEnd)          # e.g. 2014-05-02


        # for the negative conditions, only the OR is a valid operator type
        self._setQueryArrVal(ignoreKeywords, "ignoreKeywords", None, "or")
        self._setQueryArrVal(ignoreConceptUri, "ignoreConceptUri", None, "or")
        self._setQueryArrVal(ignoreCategoryUri, "ignoreCategoryUri", None, "or")
        self._setQueryArrVal(ignoreSourceUri, "ignoreSourceUri", None, "or")
        self._setQueryArrVal(ignoreSourceLocationUri, "ignoreSourceLocationUri", None, "or")
        self._setQueryArrVal(ignoreSourceGroupUri, "ignoreSourceGroupUri", None, "or")
        self._setQueryArrVal(ignoreAuthorUri, "ignoreAuthorUri", None, "or")
        self._setQueryArrVal(ignoreLocationUri, "ignoreLocationUri", None, "or")

        self._setQueryArrVal(ignoreLang, "ignoreLang", None, "or")

        self._setValIfNotDefault("keywordLoc", keywordsLoc, "body")
        self._setValIfNotDefault("ignoreKeywordLoc", ignoreKeywordsLoc, "body")

        self.setRequestedResult(requestedResult or RequestEventsInfo())
def __init__ ( self , keywords = None , conceptUri = None , categoryUri = None , sourceUri = None , sourceLocationUri = None , sourceGroupUri = None , authorUri = None , locationUri = None , lang = None , dateStart = None , dateEnd = None , minSentiment = - 1 , maxSentiment = 1 , minArticlesInEvent = None , maxArticlesInEvent = None , dateMentionStart = None , dateMentionEnd = None , ignoreKeywords = None , ignoreConceptUri = None , ignoreCategoryUri = None , ignoreSourceUri = None , ignoreSourceLocationUri = None , ignoreSourceGroupUri = None , ignoreAuthorUri = None , ignoreLocationUri = None , ignoreLang = None , keywordsLoc = "body" , ignoreKeywordsLoc = "body" , requestedResult = None ) : super ( QueryEvents , self ) . __init__ ( ) self . _setVal ( "action" , "getEvents" ) self . _setQueryArrVal ( keywords , "keyword" , "keywordOper" , "and" ) self . _setQueryArrVal ( conceptUri , "conceptUri" , "conceptOper" , "and" ) self . _setQueryArrVal ( categoryUri , "categoryUri" , "categoryOper" , "or" ) self . _setQueryArrVal ( sourceUri , "sourceUri" , "sourceOper" , "or" ) self . _setQueryArrVal ( sourceLocationUri , "sourceLocationUri" , None , "or" ) self . _setQueryArrVal ( sourceGroupUri , "sourceGroupUri" , "sourceGroupOper" , "or" ) self . _setQueryArrVal ( authorUri , "authorUri" , "authorOper" , "or" ) self . _setQueryArrVal ( locationUri , "locationUri" , None , "or" ) self . _setQueryArrVal ( lang , "lang" , None , "or" ) if ( dateStart != None ) : self . _setDateVal ( "dateStart" , dateStart ) if ( dateEnd != None ) : self . _setDateVal ( "dateEnd" , dateEnd ) if minSentiment != - 1 : assert minSentiment >= - 1 and minSentiment <= 1 self . _setVal ( "minSentiment" , minSentiment ) if maxSentiment != 1 : assert maxSentiment >= - 1 and maxSentiment <= 1 self . _setVal ( "maxSentiment" , maxSentiment ) self . _setValIfNotDefault ( "minArticlesInEvent" , minArticlesInEvent , None ) self . _setValIfNotDefault ( "maxArticlesInEvent" , maxArticlesInEvent , None ) if ( dateMentionStart != None ) : self . _setDateVal ( "dateMentionStart" , dateMentionStart ) if ( dateMentionEnd != None ) : self . _setDateVal ( "dateMentionEnd" , dateMentionEnd ) self . _setQueryArrVal ( ignoreKeywords , "ignoreKeywords" , None , "or" ) self . _setQueryArrVal ( ignoreConceptUri , "ignoreConceptUri" , None , "or" ) self . _setQueryArrVal ( ignoreCategoryUri , "ignoreCategoryUri" , None , "or" ) self . _setQueryArrVal ( ignoreSourceUri , "ignoreSourceUri" , None , "or" ) self . _setQueryArrVal ( ignoreSourceLocationUri , "ignoreSourceLocationUri" , None , "or" ) self . _setQueryArrVal ( ignoreSourceGroupUri , "ignoreSourceGroupUri" , None , "or" ) self . _setQueryArrVal ( ignoreAuthorUri , "ignoreAuthorUri" , None , "or" ) self . _setQueryArrVal ( ignoreLocationUri , "ignoreLocationUri" , None , "or" ) self . _setQueryArrVal ( ignoreLang , "ignoreLang" , None , "or" ) self . _setValIfNotDefault ( "keywordLoc" , keywordsLoc , "body" ) self . _setValIfNotDefault ( "ignoreKeywordLoc" , ignoreKeywordsLoc , "body" ) self . setRequestedResult ( requestedResult or RequestEventsInfo ( ) )
Query class for searching for events in the Event Registry.
        The resulting events have to match all specified conditions. If a parameter value equals "" or [], then it is ignored.
        In order for query to be valid, it has to have at least one positive condition (condition that does not start with ignore*).

        @param keywords: find events where articles mention all the specified keywords.
            A single keyword/phrase can be provided as a string, multiple keywords/phrases can be provided as a list of strings.
            Use QueryItems.AND() if *all* provided keywords/phrases should be mentioned, or QueryItems.OR() if *any* of the keywords/phrases should be mentioned.
        @param conceptUri: find events where the concept with concept uri is important.
            A single concept uri can be provided as a string, multiple concept uris can be provided as a list of strings.
            Use QueryItems.AND() if *all* provided concepts should be mentioned, or QueryItems.OR() if *any* of the concepts should be mentioned.
            To obtain a concept uri using a concept label use EventRegistry.getConceptUri().
        @param categoryUri: find events that are assigned into a particular category.
            A single category uri can be provided as a string, multiple category uris can be provided as a list of strings.
            Use QueryItems.AND() if *all* provided categories should be mentioned, or QueryItems.OR() if *any* of the categories should be mentioned.
            A category uri can be obtained from a category name using EventRegistry.getCategoryUri().
        @param sourceUri: find events that contain one or more articles that have been written by a news source sourceUri.
            If multiple sources should be considered use QueryItems.OR() to provide the list of sources.
            Source uri for a given news source name can be obtained using EventRegistry.getNewsSourceUri().
        @param sourceLocationUri: find events that contain one or more articles that were written by news sources located in the given geographic location.
            If multiple source locations are provided, then put them into a list inside QueryItems.OR()
            Location uri can either be a city or a country. Location uri for a given name can be obtained using EventRegistry.getLocationUri().
        @param sourceGroupUri: find events that contain one or more articles that were written by news sources that are assigned to the specified source group.
            If multiple source groups are provided, then put them into a list inside QueryItems.OR()
            Source group uri for a given name can be obtained using EventRegistry.getSourceGroupUri().
        @param authorUri: find events that contain one or more articles that have been written by a specific author.
            If multiple authors should be considered use QueryItems.OR() or QueryItems.AND() to provide the list of authors.
            Author uri for a given author name can be obtained using EventRegistry.getAuthorUri().
        @param locationUri: find events that occured at a particular location.
            If value can be a string or a list of strings provided in QueryItems.OR().
            Location uri can either be a city or a country. Location uri for a given name can be obtained using EventRegistry.getLocationUri().
        @param lang: find events for which we found articles in the specified language.
            If more than one language is specified, resulting events has to be reported in *any* of the languages.
        @param dateStart: find events that occured on or after dateStart. Date should be provided in YYYY-MM-DD format, datetime.time or datetime.datetime.
        @param dateEnd: find events that occured before or on dateEnd. Date should be provided in YYYY-MM-DD format, datetime.time or datetime.datetime.
        @param minSentiment: minimum value of the sentiment, that the returned events should have. Range [-1, 1]. Note: setting the value will remove all events that don't have
                a computed value for the sentiment (all events that are not reported in English language)
        @param maxSentiment: maximum value of the sentiment, that the returned events should have. Range [-1, 1]. Note: setting the value will remove all events that don't have
                a computed value for the sentiment (all events that are not reported in English language)
        @param minArticlesInEvent: find events that have been reported in at least minArticlesInEvent articles (regardless of language)
        @param maxArticlesInEvent: find events that have not been reported in more than maxArticlesInEvent articles (regardless of language)
        @param dateMentionStart: find events where articles explicitly mention a date that is equal or greater than dateMentionStart.
        @param dateMentionEnd: find events where articles explicitly mention a date that is lower or equal to dateMentionEnd.
        @param ignoreKeywords: ignore events where articles about the event mention any of the provided keywords
        @param ignoreConceptUri: ignore events that are about any of the provided concepts
        @param ignoreCategoryUri: ignore events that are about any of the provided categories
        @param ignoreSourceUri: ignore events that have have articles which have been written by any of the specified news sources
        @param ignoreSourceLocationUri: ignore events that have articles which been written by sources located at *any* of the specified locations
        @param ignoreSourceGroupUri: ignore events that have articles which have been written by sources in *any* of the specified source groups
        @param ignoreAuthorUri: ignore articles that were written by *any* of the specified authors
        @param ignoreLocationUri: ignore events that occured in any of the provided locations. A location can be a city or a place
        @param ignoreLang: ignore events that are reported in any of the provided languages
        @param keywordsLoc: what data should be used when searching using the keywords provided by "keywords" parameter. "body" (default), "title", or "body,title"
        @param ignoreKeywordsLoc: what data should be used when searching using the keywords provided by "ignoreKeywords" parameter. "body" (default), "title", or "body,title"
        @param requestedResult: the information to return as the result of the query. By default return the list of matching events