controllers.py 文件源码

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

项目:RO2SHARE 作者: LinkingDataIO 项目源码 文件源码
def claim(research_object, orcid):
    if not person_exist(orcid):
        req = urllib2.Request('http://orcid.org/' + orcid)
        req.add_header('Accept', 'text/turtle')
        response = urllib2.urlopen(req)
        file_path = os.path.join(current_app.root_path, conf.TMP_DIR) + orcid + '.ttl'
        load_turtle(file_path, response.read())
    if research_object['type'] == 'repo':
        ro_ttl = create_repo(research_object, orcid)
    elif research_object['type'] == 'presentation':
        ro_ttl = create_presentation(research_object, orcid)
    else:
        ro_ttl = create_creative_work(research_object, orcid)
    file_path = os.path.join(current_app.root_path, conf.TMP_DIR) + str(research_object['id']) + '.ttl'
    load_turtle(file_path, ro_ttl)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号