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)
评论列表
文章目录