if (person.getAddresses() != null) { checkAndFilter(orcid, person.getAddresses().getAddress(), READ_BIO_REQUIRED_SCOPE, true); if (person.getBiography() != null) { try { checkAndFilter(orcid, person.getBiography(), READ_BIO_REQUIRED_SCOPE, true); } catch (Exception e) { person.setBiography(null); if (person.getEmails() != null) { checkAndFilter(orcid, person.getEmails().getEmails(), READ_BIO_REQUIRED_SCOPE, true); if (person.getExternalIdentifiers() != null) { checkAndFilter(orcid, person.getExternalIdentifiers().getExternalIdentifiers(), READ_BIO_REQUIRED_SCOPE, true); if (person.getKeywords() != null) { checkAndFilter(orcid, person.getKeywords().getKeywords(), READ_BIO_REQUIRED_SCOPE, true); if (person.getName() != null) { try { checkAndFilter(orcid, person.getName(), READ_BIO_REQUIRED_SCOPE, true); } catch (Exception e) { person.setName(null); if (person.getOtherNames() != null) { checkAndFilter(orcid, person.getOtherNames().getOtherNames(), READ_BIO_REQUIRED_SCOPE, true); if (person.getResearcherUrls() != null) { checkAndFilter(orcid, person.getResearcherUrls().getResearcherUrls(), READ_BIO_REQUIRED_SCOPE, true);
/** * Create an instance of {@link Person } * */ public Person createPerson() { return new Person(); }
public void setSourceName(Person person) { if (person == null) { return; } if (person.getAddresses() != null) { Addresses addresses = person.getAddresses(); setSourceName(addresses); } if (person.getEmails() != null) { Emails emails = person.getEmails(); setSourceName(emails); } if (person.getExternalIdentifiers() != null) { PersonExternalIdentifiers extIds = person.getExternalIdentifiers(); setSourceName(extIds); } if (person.getKeywords() != null) { Keywords keywords = person.getKeywords(); setSourceName(keywords); } if (person.getOtherNames() != null) { OtherNames otherNames = person.getOtherNames(); setSourceName(otherNames); } if (person.getResearcherUrls() != null) { ResearcherUrls researcherUrls = person.getResearcherUrls(); setSourceName(researcherUrls); } }
public static void setPathToPerson(Person person, String orcid) { if (person != null) { person.setPath(PERSON.replace("{orcid}", orcid)); if (person.getAddresses() != null) { setPathToAddresses(person.getAddresses(), orcid); } if (person.getBiography() != null) { setPathToBiography(person.getBiography(), orcid); } if (person.getEmails() != null) { setPathToEmail(person.getEmails(), orcid); } if (person.getExternalIdentifiers() != null) { setPathToExternalIdentifiers(person.getExternalIdentifiers(), orcid); } if (person.getKeywords() != null) { setPathToKeywords(person.getKeywords(), orcid); } if (person.getOtherNames() != null) { setPathToOtherNames(person.getOtherNames(), orcid); } if (person.getResearcherUrls() != null) { setPathToResearcherUrls(person.getResearcherUrls(), orcid); } } }
theLastModifiedDate = this.getLastModifiedDate(); strategy.appendField(locator, this, "lastModifiedDate", buffer, theLastModifiedDate); theName = this.getName(); strategy.appendField(locator, this, "name", buffer, theName); theOtherNames = this.getOtherNames(); strategy.appendField(locator, this, "otherNames", buffer, theOtherNames); theBiography = this.getBiography(); strategy.appendField(locator, this, "biography", buffer, theBiography); theResearcherUrls = this.getResearcherUrls(); strategy.appendField(locator, this, "researcherUrls", buffer, theResearcherUrls); theEmails = this.getEmails(); strategy.appendField(locator, this, "emails", buffer, theEmails); theAddresses = this.getAddresses(); strategy.appendField(locator, this, "addresses", buffer, theAddresses); theKeywords = this.getKeywords(); strategy.appendField(locator, this, "keywords", buffer, theKeywords); theExternalIdentifiers = this.getExternalIdentifiers(); strategy.appendField(locator, this, "externalIdentifiers", buffer, theExternalIdentifiers); thePath = this.getPath(); strategy.appendField(locator, this, "path", buffer, thePath);
NameType name = person.getName(); if (person.getKeywords() != null) { for (KeywordType keyword : person.getKeywords().getKeyword()) { if (this.isNewMetadata("keyword", keyword.getContent())) { this.addOtherMetadata("keyword", keyword.getContent()); ExternalIdentifiers externalIdentifiers = person.getExternalIdentifiers(); if (externalIdentifiers != null) { for (ExternalId externalIdentifier : externalIdentifiers.getExternalIdentifier()) { if (person.getResearcherUrls() != null) { for (ResearcherUrlType researcherUrl : person.getResearcherUrls().getResearcherUrl()) { if (this.isNewMetadata("researcher_url", researcherUrl.getUrl().getValue())) { this.addOtherMetadata("researcher_url", researcherUrl.getUrl().getValue()); if (person.getBiography() != null) { if (this.isNewMetadata("biography", person.getBiography().getContent())) { this.addOtherMetadata("biography", person.getBiography().getContent());
if (r.getPerson().getName() != null) { if (r.getPerson().getName().getCreditName() != null) doc.name = r.getPerson().getName().getCreditName().getContent(); if (r.getPerson().getName().getGivenNames() != null) doc.givenName = r.getPerson().getName().getGivenNames().getContent(); if (r.getPerson().getName().getFamilyName() != null) doc.familyName = r.getPerson().getName().getFamilyName().getContent(); if (r.getPerson().getOtherNames() != null && r.getPerson().getOtherNames().getOtherNames() != null) for (OtherName n : r.getPerson().getOtherNames().getOtherNames()) { doc.alternateName.add(n.getContent()); if (r.getPerson().getAddresses() != null && r.getPerson().getAddresses().getAddress() != null) for (Address a : r.getPerson().getAddresses().getAddress()) { if (a.getCountry() != null && a.getCountry().getValue() !=null) doc.address.add(new SchemaOrgAddress(a.getCountry().getValue().toString())); if (r.getPerson().getResearcherUrls() != null && r.getPerson().getResearcherUrls().getResearcherUrls() != null) for (ResearcherUrl u : r.getPerson().getResearcherUrls().getResearcherUrls()) { doc.url.add(u.getUrl().getValue()); if (r.getPerson().getExternalIdentifiers() != null && r.getPerson().getExternalIdentifiers().getExternalIdentifiers() != null) for (PersonExternalIdentifier i : r.getPerson().getExternalIdentifiers().getExternalIdentifiers()) { doc.identifier.add(new SchemaOrgExternalID(i.getType(), i.getValue()));
@Override public Person getPersonDetails(String orcid) { Person person = new Person(); person.setName(recordNameManager.getRecordName(orcid)); person.setBiography(biographyManager.getBiography(orcid)); Addresses filteredAddresses = new Addresses(); filteredAddresses.setAddress(new ArrayList<Address>(addresses.getAddress())); person.setAddresses(filteredAddresses); PersonExternalIdentifiers filteredExtIds = new PersonExternalIdentifiers(); filteredExtIds.setExternalIdentifiers(new ArrayList<PersonExternalIdentifier>(extIds.getExternalIdentifiers())); person.setExternalIdentifiers(filteredExtIds); Keywords filteredKeywords = new Keywords(); filteredKeywords.setKeywords(new ArrayList<Keyword>(keywords.getKeywords())); person.setKeywords(filteredKeywords); OtherNames filteredOtherNames = new OtherNames(); filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames())); person.setOtherNames(filteredOtherNames); ResearcherUrls filteredRUrls = new ResearcherUrls(); filteredRUrls.setResearcherUrls(new ArrayList<ResearcherUrl>(rUrls.getResearcherUrls())); person.setResearcherUrls(filteredRUrls); Emails filteredEmails = new Emails(); filteredEmails.setEmails(new ArrayList<Email>(emails.getEmails())); person.setEmails(filteredEmails);
private Individual describePerson(Record record, OntModel m) { String orcidUri = record.getOrcidIdentifier().getUri(); Individual person = m.createIndividual(orcidUri, FOAF.Person); person.addRDFType(PROV.Person); if (record.getPerson() == null) { return person; } describePersonalDetails(record.getPerson().getName(), person, m); describeContactDetails(record.getPerson(), person, m); describeBiography(record.getPerson().getBiography(), person, m); describeResearcherUrls(record.getPerson().getResearcherUrls(), person, m); return person; }
Emails emails = orcidPerson.getEmails(); if (emails != null) { for (Email email : emails.getEmails()) { Addresses addresses = orcidPerson.getAddresses(); Address addr = (addresses != null && addresses.getAddress().size()>0)?addresses.getAddress().get(0):null; if (addr != null) {
if (person.getName() != null) { if (person.getName().getCreditName() != null) { claims.claim("name", person.getName().getCreditName().getContent()); if (person.getName().getFamilyName() != null) { claims.claim("family_name", person.getName().getFamilyName().getContent()); if (person.getName().getGivenNames() != null) { claims.claim("given_name", person.getName().getGivenNames().getContent());
public static void calculateLastModified(Person person) { if (person != null) { calculateLastModified(person.getAddresses()); calculateLastModified(person.getEmails()); calculateLastModified(person.getExternalIdentifiers()); calculateLastModified(person.getKeywords()); calculateLastModified(person.getOtherNames()); calculateLastModified(person.getResearcherUrls()); LastModifiedDate l1 = person.getAddresses() == null ? null : person.getAddresses().getLastModifiedDate(); LastModifiedDate l2 = person.getEmails() == null ? null : person.getEmails().getLastModifiedDate(); LastModifiedDate l3 = person.getExternalIdentifiers() == null ? null : person.getExternalIdentifiers().getLastModifiedDate(); LastModifiedDate l4 = person.getKeywords() == null ? null : person.getKeywords().getLastModifiedDate(); LastModifiedDate l5 = person.getOtherNames() == null ? null : person.getOtherNames().getLastModifiedDate(); LastModifiedDate l6 = person.getResearcherUrls() == null ? null : person.getResearcherUrls().getLastModifiedDate(); LastModifiedDate globalLatest = calculateLatest(l1, l2, l3, l4, l5, l6); person.setLastModifiedDate(globalLatest); } }
@Override public Person getPublicPersonDetails(String orcid) { Person person = new Person(); person.setName(name); person.setBiography(bio); Addresses filteredAddresses = new Addresses(); filteredAddresses.setAddress(new ArrayList<Address>(addresses.getAddress())); person.setAddresses(filteredAddresses); PersonExternalIdentifiers filteredExtIds = new PersonExternalIdentifiers(); filteredExtIds.setExternalIdentifiers(new ArrayList<PersonExternalIdentifier>(extIds.getExternalIdentifiers())); person.setExternalIdentifiers(filteredExtIds); Keywords filteredKeywords = new Keywords(); filteredKeywords.setKeywords(new ArrayList<Keyword>(keywords.getKeywords())); person.setKeywords(filteredKeywords); OtherNames filteredOtherNames = new OtherNames(); filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames())); person.setOtherNames(filteredOtherNames); ResearcherUrls filteredRUrls = new ResearcherUrls(); filteredRUrls.setResearcherUrls(new ArrayList<ResearcherUrl>(rUrls.getResearcherUrls())); person.setResearcherUrls(filteredRUrls); Emails filteredEmails = new Emails(); filteredEmails.setEmails(new ArrayList<Email>(emails.getEmails()));