publications.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:rap-etl 作者: RAP-research-output-impact 项目源码 文件源码
def add_grant(grant, pub_uri):
    """
    Create a funder and grant(s).
    """
    g = Graph()
    if grant.get("agency") is None:
        logger.info("No agency found for {} with ids.".format(pub_uri, ";".join(grant.get("ids", []))))
        return g
    slug = slugify(grant["agency"])
    uri = D['funder-' + slug]
    g.add((uri, RDF.type, WOS.Funder))
    g.add((uri, RDFS.label, Literal(grant["agency"])))
    for gid in grant["ids"]:
        label = "{} - {}".format(grant["agency"], gid)
        guri = D['grant-'] + slugify(label)
        g.add((guri, RDF.type, WOS.Grant))
        g.add((guri, RDFS.label, Literal(label)))
        g.add((guri, WOS.grantId, Literal(gid)))
        g.add((guri, VIVO.relates, uri))
        g.add((guri, VIVO.relates, pub_uri))
    return g
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号