def calculate_citation_history_coordinates(recid): """Return a list of citation graph coordinates for RECID, sorted by year.""" result = [] dbg = "" initial_result = get_initial_result( calculate_citation_graphe_x_coordinates(recid)) citlist = calculate_cited_by_list(recid) for rec_id, cit_weight in citlist: cit_year = get_field_values(rec_id, '773__y') if not cit_year: cit_year = get_field_values(rec_id, '260__c') if not cit_year: cit_year = get_field_values(rec_id, '269__c') #some records simlpy do not have these fields if cit_year: #maybe cit_year[0][0:4] has a typo and cannot #be converted to an int numeric = 1 try: tmpval = int(cit_year[0][0:4]) except ValueError: numeric = 0 if numeric and initial_result.has_key(int(cit_year[0][0:4])): initial_result[int(cit_year[0][0:4])] += 1 for key, value in initial_result.items(): result.append((key, value)) result.sort() if len(result) < cfg_bibrank_citation_history_min_x_points: # do not generate graphs that have less than X points return [] return result
def calculate_citation_history_coordinates(recid): """Return a list of citation graph coordinates for RECID, sorted by year.""" result = [] dbg = "" initial_result= get_initial_result(calculate_citation_graphe_x_coordinates(recid)) citlist = calculate_cited_by_list(recid) for rec_id, cit_weight in citlist: cit_year = get_field_values(rec_id,'773__y') if not cit_year: cit_year = get_field_values(rec_id, '260__c') if not cit_year: cit_year = get_field_values(rec_id, '269__c') #some records simlpy do not have these fields if cit_year: #maybe cit_year[0][0:4] has a typo and cannot #be converted to an int numeric=1 try: tmpval = int(cit_year[0][0:4]) except ValueError: numeric=0 if numeric and initial_result.has_key(int(cit_year[0][0:4])): initial_result[int(cit_year[0][0:4])] += 1 for key, value in initial_result.items(): result.append((key, value)) result.sort() return result
def citations(recid): citations = dict( citinglist = calculate_cited_by_list(recid), selfcited = get_self_cited_by(recid), co_cited = calculate_co_cited_with_list(recid) ) return render_template('record_citations.html', citations = citations)
def citations(recid): citations = dict(citinglist=calculate_cited_by_list(recid), selfcited=get_self_cited_by(recid), co_cited=calculate_co_cited_with_list(recid)) return render_template('record_citations.html', citations=citations)