Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1963bdf

Browse files
Merge pull request #55 from renaud/patch-1
enable Topic.addConcept to optionally require the topic
2 parents 46db929 + 7c1d457 commit 1963bdf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎eventregistry/TopicPage.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ def clearLocations(self):
209209
self.topicPage["locations"] = []
210210

211211

212-
def addConcept(self, conceptUri, weight, label = None, conceptType = None):
212+
def addConcept(self, conceptUri, weight, label = None, conceptType = None, required=False):
213213
"""
214214
add a relevant concept to the topic page
215215
@param conceptUri: uri of the concept to be added
216216
@param weight: importance of the provided concept (typically in range 1 - 50)
217217
"""
218218
assert isinstance(weight, (float, int)), "weight value has to be a positive or negative integer"
219-
concept = {"uri": conceptUri, "wgt": weight}
219+
concept = {"uri": conceptUri, "wgt": weight, "required": required}
220220
if label != None: concept["label"] = label
221221
if conceptType != None: concept["type"] = conceptType
222222
self.topicPage["concepts"].append(concept)
@@ -391,4 +391,4 @@ def getEvents(self,
391391
}
392392
params.update(returnInfo.getParams("events"))
393393
params.update(kwargs)
394-
return self.eventRegistry.jsonRequest("/api/v1/event", params)
394+
return self.eventRegistry.jsonRequest("/api/v1/event", params)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /