gyorilab / indra_db

A Database-based knowledge back-end built on and for INDRA. The INDRA Database is a service that can be set up by any user with their own content and knowledge access. Our implementation of the database is the back-end to many of our projects, providing a vast and detailed knowledge base derived from many resources.
GNU General Public License v3.0
16 stars 10 forks source link

Fix condition in checking for trid_list #154

Closed bgyori closed 3 years ago

bgyori commented 3 years ago

I tried get_content_by_refs to fetch some text content and ran into and issue with passing only a trid_list that this PR fixes. But then found that this function doesn't return for a really long time (maybe deprecated?) so as an alternative, I'm using TextContentSessionHandler.get_text_content_from_text_refs, which seems to work well.

pagreene commented 3 years ago

I think in general TextContentSessionHandler is the more modern tool. I think the other is a holdover short-cut function that is pretty deprecated in it methodology.

bgyori commented 3 years ago

So should this function be removed if this fix is not meged?

pagreene commented 3 years ago

That is a good point, it probably should be. Let us double check and make sure no one is using it. I believe it was Albert that initially created the function for use with Adeft (or else I did at his request), and has since abandoned it in favor of TextContentSessionHandler.

johnbachman commented 3 years ago

We should keep this open until it is resolved or we will forget!

dianakolusheva commented 3 years ago

Found this PR because also tried using get_content_by_refs and had similar issues. TextContentSessionHandler works but doesn't allow to specify text type (for the case when we're only interested in one type of content, e.g. title).

pagreene commented 3 years ago

I will merge this fix once Klas's PR is merged. We can come back to optimizing access to the text content in the database at a later date.