OpenTreeOfLife / otindex

opentree index using postgres and pyramid
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

return all studies curated by a user #33

Open kcranston opened 8 years ago

kcranston commented 8 years ago

Need this to complete profile pages.

kcranston commented 8 years ago

doh - already implemented with find_studies and ot:curatorName property

jimallman commented 6 years ago

Is this fix running anywhere? I'm testing find_studies in the v3 API, and it still returns at most a single string value for ot:tag and ot:curatorName. (Apologies if we're still in transition from oti to otindex -- if so, let me know if I can help move that along.)

mtholder commented 6 years ago

My impression was that we were still using oti on tree+api.

jimallman commented 6 years ago

Drat. I was hoping to clean up the curator profile page with accurate study counts (added/curated/in-synthesis).

jimallman commented 6 years ago

Incidentally, it looks like this force-to-unique-list trick can have the unwanted(?) side effect of re-ordering the list of curator names. We depend on the first listed name to identify the user who first added the study. Is this information stored elsewhere, short of digging up GitHub versions and backtracking to the first entry?

mtholder commented 6 years ago

good catch that would definitely not be order preserving. I think the nexSON has a ot:curatorName field that is the unaltered list. So it may be OK that the index does not know the order.

I think:

cur_set, cur_list = set(), []
for c in curators:
    if c not in cur_set:
       cur_set.add(c)
       cur_list.append(c)
curators = cur_list

is the efficient way to be order preserving.

jimallman commented 6 years ago

Yes, not a major problem, but I was hoping to use this distinction in the curator-profile page, to show "added" vs. "curated" studies. (As an aside, feedback is welcome on how I'm describing these roles, and whether it's worth pointing out the distinction.) You can see this in the existing information about a curator's tree collections:

screen shot 2018-04-17 at 5 23 24 pm
jimallman commented 6 years ago

And to clarify, I get this information by walking the response to find_studies