public static void cleanEmptyFields(Funding funding) { if(funding != null && funding.getContributors() != null && !funding.getContributors().getContributor().isEmpty()) { for(FundingContributor c : funding.getContributors().getContributor()) { if(c.getCreditName() != null && PojoUtil.isEmpty(c.getCreditName().getContent())) { c.setCreditName(null); } } } } }
if (work.getWorkContributors() != null && work.getWorkContributors().getContributor() != null) { for (Contributor c : work.getWorkContributors().getContributor()) { if (c.getCreditName() != null && c.getCreditName().getContent() != null) { names.add(c.getCreditName().getContent());
if (PojoUtil.isEmpty(contributor.getCreditName().getContent())) { throw new OrcidValidationException("Please specify a contributor credit name or remove the empty tag");
if (person.getName() != null) { if (person.getName().getCreditName() != null) { claims.claim("name", person.getName().getCreditName().getContent());
if (work.getWorkContributors() != null && work.getWorkContributors().getContributor() != null) { for (Contributor c : work.getWorkContributors().getContributor()) { if (c.getCreditName() != null && c.getCreditName().getContent() != null) { names.add(StringUtils.stripAccents(c.getCreditName().getContent()));
private void describePersonalDetails(Name name, Individual person, OntModel m) { if (name.getCreditName() != null) { // User has provided full name String creditName = name.getCreditName().getContent(); person.addProperty(FOAF.name, creditName); person.addLabel(creditName, null); } else if (name.getGivenNames() != null && name.getFamilyName() != null) { //@formatter:off // Naive fallback assuming givenNames ~= first name and familyName ~= lastName // See http://www.w3.org/International/questions/qa-personal-names for further // considerations -- we don't report this as foaf:name as we can't be sure of the ordering. //@formatter:on // NOTE: ORCID gui is westernized asking for "First name" and // "Last name" and assuming the above mapping String label = name.getGivenNames().getContent() + " " + name.getFamilyName().getContent(); person.addLabel(label, null); } if (name.getGivenNames() != null) { person.addProperty(FOAF.givenName, name.getGivenNames().getContent()); } if (name.getFamilyName() != null) { person.addProperty(FOAF.familyName, name.getFamilyName().getContent()); } }
doc.name = r.getPerson().getName().getCreditName().getContent(); if (r.getPerson().getName().getGivenNames() != null) doc.givenName = r.getPerson().getName().getGivenNames().getContent();
public static void cleanEmptyFields(Work work) { if(work != null) { if(work.getWorkCitation() != null) { if(PojoUtil.isEmpty(work.getWorkCitation().getCitation())) { work.setWorkCitation(null); } } if(work.getWorkTitle() != null) { if(work.getWorkTitle().getTranslatedTitle() != null) { if(PojoUtil.isEmpty(work.getWorkTitle().getTranslatedTitle().getContent())) { work.getWorkTitle().setTranslatedTitle(null); } } } if(work.getWorkContributors() != null && work.getWorkContributors().getContributor() != null) { for(Contributor c : work.getWorkContributors().getContributor()) { if(c.getCreditName() != null && PojoUtil.isEmpty(c.getCreditName().getContent())) { c.setCreditName(null); } } } } }
public static Contributor valueOf(org.orcid.jaxb.model.common_v2.Contributor contributor) { Contributor c = new Contributor(); if (contributor != null) { if (contributor.getContributorAttributes() != null) { contributor.getContributorAttributes(); if (contributor.getContributorAttributes().getContributorRole() != null) c.setContributorRole(Text.valueOf(contributor.getContributorAttributes().getContributorRole().value())); if (contributor.getContributorAttributes().getContributorSequence() != null) c.setContributorSequence(Text.valueOf(contributor.getContributorAttributes().getContributorSequence().value())); } if (contributor.getContributorOrcid() != null) { c.setOrcid(Text.valueOf(contributor.getContributorOrcid().getPath())); c.setUri(Text.valueOf(contributor.getContributorOrcid().getUri())); } //Set default values that must be overwritten by the controller if (contributor.getCreditName() != null) { c.setCreditName(Text.valueOf(contributor.getCreditName().getContent())); } } return c; }