You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Added**
- added file `QueryMentions` that can be used to query mentions of specific event types. The class is currently in beta and not available to users unless they have permissions to use this endpoint. The classes `QueryMentions` and `QueryMentionsIter` can be used in the same way as classes for querying articles and events, except that some query parameters are addded and some removed. Examples for the classes were also added.
**Updated**
- When using method `initWithComplexQuery` we now check if the provided json is valid json object and report error in case it is not
- some bugs that appeared in edge cases when querying Event Registry using `EventRegistry` class have been fixed.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,15 @@
1
1
# Change Log
2
2
3
+
## [v8.10]() (2021-08-16)
4
+
5
+
**Added**
6
+
7
+
- added file `QueryMentions` that can be used to query mentions of specific event types. The class is currently in beta and not available to users unless they have permissions to use this endpoint. The classes `QueryMentions` and `QueryMentionsIter` can be used in the same way as classes for querying articles and events, except that some query parameters are addded and some removed. Examples for the classes were also added.
8
+
9
+
**Updated**
10
+
- When using method `initWithComplexQuery` we now check if the provided json is valid json object and report error in case it is not
11
+
- some bugs that appeared in edge cases when querying Event Registry using `EventRegistry` class have been fixed.
Copy file name to clipboardExpand all lines: eventregistry/EventRegistry.py
+26-25Lines changed: 26 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -25,17 +25,21 @@ def __init__(self,
25
25
printHostInfo=True,
26
26
settingsFName=None):
27
27
"""
28
-
@param apiKey: API key that should be used to make the requests to the Event Registry. API key is assigned to each user account and can be obtained on this page: http://eventregistry.org/me?tab=settings
28
+
@param apiKey: API key that should be used to make the requests to the Event Registry. API key is assigned to each user account and can be obtained on
29
+
this page: http://eventregistry.org/me?tab=settings
29
30
@param host: host to use to access the Event Registry backend. Use None to use the default host.
30
31
@param hostAnalytics: the host address to use to perform the analytics api calls
31
32
@param logging: log all requests made to a 'requests_log.txt' file
32
33
@param minDelayBetweenRequests: the minimum number of seconds between individual api calls
33
-
@param repeatFailedRequestCount: if a request fails (for example, because ER is down), what is the max number of times the request should be repeated (-1 for indefinitely)
34
-
@param allowUseOfArchive: default is True. Determines if the queries made should potentially be executed on the archive data. If False, all queries (regardless how the date conditions are set) will be
35
-
executed on data from the last 31 days. Queries executed on the archive are more expensive so set it to False if you are just interested in recent data
36
-
@param verboseOutput: if True, additional info about query times etc will be printed to console
34
+
@param repeatFailedRequestCount: if a request fails (for example, because ER is down), what is the max number of times the request
35
+
should be repeated (-1 for indefinitely)
36
+
@param allowUseOfArchive: default is True. Determines if the queries made should potentially be executed on the archive data.
37
+
If False, all queries (regardless how the date conditions are set) will be executed on data from the last 31 days.
38
+
Queries executed on the archive are more expensive so set it to False if you are just interested in recent data
39
+
@param verboseOutput: if True, additional info about errors etc will be printed to console
37
40
@param printHostInfo: print which urls are used as the hosts
38
-
@param settingsFName: If provided it should be a full path to 'settings.json' file where apiKey an/or host can be loaded from. If None, we will look for the settings file in the eventregistry module folder
41
+
@param settingsFName: If provided it should be a full path to 'settings.json' file where apiKey an/or host can be loaded from.
42
+
If None, we will look for the settings file in the eventregistry module folder
return a list of concepts that contain the given prefix. returned matching concepts are sorted based on their frequency of occurence in news (from most to least frequent)
374
+
return a list of concepts that contain the given prefix. returned matching concepts are sorted based on their
375
+
frequency of occurence in news (from most to least frequent)
375
376
@param prefix: input text that should be contained in the concept
376
-
@param sources: what types of concepts should be returned. valid values are person, loc, org, wiki, entities (== person + loc + org), concepts (== entities + wiki), conceptClass, conceptFolder
377
+
@param sources: what types of concepts should be returned. valid values are person, loc, org, wiki, entities (== person + loc + org), concepts (== entities + wiki)
377
378
@param lang: language in which the prefix is specified
378
379
@param conceptLang: languages in which the label(s) for the concepts are to be returned
return a concept uri that is the best match for the given concept label
540
541
if there are multiple matches for the given conceptLabel, they are sorted based on their frequency of occurence in news (most to least frequent)
541
542
@param conceptLabel: partial or full name of the concept for which to return the concept uri
542
-
@param sources: what types of concepts should be returned. valid values are person, loc, org, wiki, entities (== person + loc + org), concepts (== entities + wiki), conceptClass, conceptFolder
543
+
@param sources: what types of concepts should be returned. valid values are person, loc, org, wiki, entities (== person + loc + org), concepts (== entities + wiki)
# provided query as a string containing the json object
227
227
elifisinstance(query, six.string_types):
228
-
foo=json.loads(query)
228
+
try:
229
+
foo=json.loads(query)
230
+
except:
231
+
raiseException("Failed to parse the provided string content as a JSON object. Please check the content provided as a parameter to the initWithComplexQuery() method")
# provided query as a string containing the json object
200
200
elifisinstance(query, six.string_types):
201
-
foo=json.loads(query)
201
+
try:
202
+
foo=json.loads(query)
203
+
except:
204
+
raiseException("Failed to parse the provided string content as a JSON object. Please check the content provided as a parameter to the initWithComplexQuery() method")
0 commit comments