Example #1
0
def citations(recid):
    """Display citations."""
    from invenio.legacy.bibrank.citation_searcher import calculate_cited_by_list,\
        get_self_cited_by, calculate_co_cited_with_list
    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('records/citations.html', citations=citations)
Example #2
0
def citations(recid):
    from invenio.legacy.bibrank.citation_searcher import calculate_cited_by_list,\
        get_self_cited_by, calculate_co_cited_with_list
    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('records/citations.html',
                           citations=citations)
Example #3
0
def citations(recid):
    """Display citations."""
    from invenio.legacy.bibrank.citation_searcher import (
        calculate_cited_by_list,
        get_self_cited_by,
        calculate_co_cited_with_list,
    )

    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("records/citations.html", citations=citations)
Example #4
0
def search_unit(query, f, m, wl=None):
    """Search for records in citation index."""
    from invenio.legacy.search_engine import record_exists
    from invenio.legacy.bibrank.citation_searcher import \
        calculate_co_cited_with_list

    results = intbitset([])

    if query:
        if isinstance(query, intbitset):
            ahitset = query
        else:
            recid = int(query)
            ahitset = [recid] if record_exists(recid) == 1 else []

        if len(ahitset):
            for recid in ahitset:
                results |= intbitset([
                    x[0] for x in calculate_co_cited_with_list(recid)])

    return results