Commit 45cc46fc authored by Romain Loth's avatar Romain Loth

fix map filter sql query (*left* join on optional hashtags)

parent acd30c13
...@@ -525,7 +525,7 @@ class BipartiteExtractor: ...@@ -525,7 +525,7 @@ class BipartiteExtractor:
) AS scholars_and_orgs ) AS scholars_and_orgs
LEFT JOIN sch_ht LEFT JOIN sch_ht
ON uid = luid ON uid = luid
JOIN hashtags LEFT JOIN hashtags
ON sch_ht.htid = hashtags.htid ON sch_ht.htid = hashtags.htid
GROUP BY luid GROUP BY luid
) AS sch_org_n_tags ) AS sch_org_n_tags
...@@ -533,6 +533,7 @@ class BipartiteExtractor: ...@@ -533,6 +533,7 @@ class BipartiteExtractor:
-- two step JOIN for keywords -- two step JOIN for keywords
LEFT JOIN sch_kw LEFT JOIN sch_kw
ON uid = luid ON uid = luid
-- we directly exclude scholars with no keywords here
JOIN keywords JOIN keywords
ON sch_kw.kwid = keywords.kwid ON sch_kw.kwid = keywords.kwid
...@@ -558,6 +559,9 @@ class BipartiteExtractor: ...@@ -558,6 +559,9 @@ class BipartiteExtractor:
for row in scholar_rows: for row in scholar_rows:
scholar_array[ row['luid'] ] = 1 scholar_array[ row['luid'] ] = 1
# mlog("DEBUG", "getScholarsList: total scholars in subset = ", len(scholar_array))
return scholar_array return scholar_array
except Exception as error: except Exception as error:
...@@ -660,10 +664,8 @@ class BipartiteExtractor: ...@@ -660,10 +664,8 @@ class BipartiteExtractor:
lambda arr: Org(arr, org_class='insts'), lambda arr: Org(arr, org_class='insts'),
loads('['+res3['insts_list']+']') loads('['+res3['insts_list']+']')
)) ))
mlog("DEBUGSQL", "main lab:", labs[0]) # mlog("DEBUGSQL", "res main lab:", labs[0].label)
mlog("DEBUGSQL", "main inst:", insts[0]) # mlog("DEBUGSQL", "res main inst:", insts[0].label)
# each lab is an array [name, acronym, location]
# all detailed node data # all detailed node data
ide="D::"+res3['initials']+("/%05i"%int(res3['luid'])); ide="D::"+res3['initials']+("/%05i"%int(res3['luid']));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment