Skip to content

Commit

Permalink
fix: correct "academia" social link in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Aug 23, 2023
1 parent 614e172 commit 5bda545
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions osf/metadata/osf_gathering.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,22 @@ def gather_user_basics(focus):
if isinstance(focus.dbmodel, osfdb.OSFUser):
yield (RDF.type, FOAF.Person) # note: assumes osf user accounts represent people
yield (FOAF.name, focus.dbmodel.fullname)
for social_link in focus.dbmodel.social_links.values():
if isinstance(social_link, str):
yield (DCTERMS.identifier, social_link)
elif isinstance(social_link, list):
for link in social_link:
yield (DCTERMS.identifier, link)
_social_links = focus.dbmodel.social_links
# special cases abound! do these one-by-one (based on OSFUser.SOCIAL_FIELDS)
yield (DCTERMS.identifier, _social_links.get('github'))
yield (DCTERMS.identifier, _social_links.get('scholar'))
yield (DCTERMS.identifier, _social_links.get('linkedIn'))
yield (DCTERMS.identifier, _social_links.get('impactStory'))
yield (DCTERMS.identifier, _social_links.get('researcherId'))
yield (DCTERMS.identifier, _social_links.get('researchGate'))
yield (DCTERMS.identifier, _social_links.get('baiduScholar'))
yield (DCTERMS.identifier, _social_links.get('ssrn'))
for _url in _social_links.get('profileWebsites', ()):
yield (DCTERMS.identifier, _url)
_academia_institution = _social_links.get('academiaInstitution')
_academia_profile_id = _social_links.get('academiaProfileID')
if _academia_institution and _academia_profile_id:
yield (DCTERMS.identifier, ''.join((_academia_institution, _academia_profile_id)))
orcid = focus.dbmodel.get_verified_external_id('ORCID', verified_only=True)
if orcid:
orcid_iri = ORCID[orcid]
Expand Down

0 comments on commit 5bda545

Please sign in to comment.