def get_cited_by_count(recid): """ Return how many records cite given record. @param recid: @return: Number of records citing given record """ from invenio.legacy.bibrank.citation_searcher import get_cited_by_count if recid: return get_cited_by_count(recid)
def citations_nb_counts(): """Get number of citations for the record `recid`.""" recid = request.view_args.get('recid') if recid is None: return from intbitset import intbitset from invenio.legacy.bibrank.citation_searcher import (get_cited_by, get_cited_by_count) if CFG_BIBRANK_SHOW_CITATION_LINKS: if CFG_INSPIRE_SITE: from invenio.legacy.search_engine import search_unit citers_recids = intbitset(get_cited_by(recid)) citeable_recids = search_unit(p='citeable', f='collection') return len(citers_recids & citeable_recids) else: return get_cited_by_count(recid) return 0
def citations_nb_counts(): """Get number of citations for the record `recid`.""" recid = request.view_args.get("recid") if recid is None: return from intbitset import intbitset from invenio.legacy.bibrank.citation_searcher import get_cited_by, get_cited_by_count if CFG_BIBRANK_SHOW_CITATION_LINKS: if CFG_INSPIRE_SITE: from invenio.legacy.search_engine import search_unit citers_recids = intbitset(get_cited_by(recid)) citeable_recids = search_unit(p="citeable", f="collection") return len(citers_recids & citeable_recids) else: return get_cited_by_count(recid) return 0