static List<YContributor> filterContributorsWithoutZblId(List<YContributor> contribs) { List<YContributor> selected = new ArrayList<YContributor>(); for (YContributor c: contribs) { List<YAttribute> fingerprints = c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT); if (fingerprints==null || fingerprints.size()==0) { selected.add(c); } } return selected; }
static List<YContributor> filterContributorsWithZblId(List<YContributor> contribs) { List<YContributor> selected = new ArrayList<YContributor>(); for (YContributor c: contribs) { List<YAttribute> fingerprints = c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT); if (fingerprints!=null && fingerprints.size()>0) { selected.add(c); } } return selected; }
private Set<String> getAffiliationNamesFromContactLocation(YContributor contributor) { List<YAttribute> attributes = contributor.getAttributes(YConstants.AT_CONTACT_LOCATION); return getAffiliationsNamesFromAttributes(attributes); }
/** * * @param contributors all contributors * @return contributors' zbl fingerprints */ private List<String> extractAuthorsFingerprints(List<YContributor> contributors) { List<String> fingerprints = new ArrayList<String>(); for (YContributor contributor: contributors) { List<YAttribute> attrs = contributor.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT); if (attrs.size() == 0) { continue; } if (attrs.size() > 1) { log.warn("More than one author-identifier(fingerprint) found for contributor=[{}]",contributor); } fingerprints.add(attrs.get(0).getValue()); } return fingerprints; }
private static void proceedEmail(YContributor yc, LinkedList<PredicateAndObject> pao) { for(YAttribute ya : yc.getAttributes(YConstants.AT_CONTACT_EMAIL)) pao.add(new PredicateAndObject(RelConstants.RL_CONTACT_EMAIL,ya.getValue())); }
List<YAttribute> fingerprints = c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT); if (fingerprints == null || fingerprints.size() == 0) { ai.append("-");
@SuppressWarnings("deprecation") public static void updateYRelationWithZblContributor(YRelation relye, YContributor c) { YAttribute ya = null; if (c.getOneName("canonical") != null) ya = new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR, c.getOneName("canonical").getText().toString()); if (c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).size() > 0) ya.addAttribute(YConstants.AT_ZBL_AUTHOR_FINGERPRINT, c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT) .get(0).getValue()); if (c.getOneName("forenames") != null) ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES, c.getOneName("forenames").getText() .toString()); ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME, c.getOneName("surname").getText().toString()); relye.addAttribute(ya); }
final String newEmail = StringUtils.removePattern(email, "E[-]?mail:"); if (!StringUtils.equals(email, newEmail)) { Iterator<YAttribute> itr = contributor.getAttributes().iterator(); while (itr.hasNext()) { if (CommonAttributeTypes.AT_CONTACT_EMAIL.equals(itr.next().getKey())) {
for(YAttribute ya : yc.getAttributes(YConstants.AT_CONTACT_EMAIL)) pao.add(new PredicateAndObject(RelConstants.RL_CONTACT_EMAIL,ya.getValue()));
protected List<ViewContact> resolveContributorContacts(final YContributor contributor, final IFilteringContext filteringContext) { final List<ViewContact> contacts = new LinkedList<ViewContact>(); for (final YAttribute contact : contributor.getAttributes()) { if (contact.getKey().equals(YConstants.AT_AC_CONTACT_EMAIL)) { final ViewContact viewContact = new ViewContact(YConstants.AT_CONTACT_EMAIL, filterEmail(contact.getValue(), filteringContext)); contacts.add(viewContact); } else if (contact.getKey().equals(YConstants.AT_INSTITUTION)) { for (final YAttribute contact2 : contact.getAttributes()) { if (contact2.getKey().equals(YConstants.AT_INSTITUTION_MAIL)) { final ViewContact viewContact = new ViewContact(YConstants.AT_CONTACT_EMAIL, filterEmail(contact2.getValue(), filteringContext)); contacts.add(viewContact); } else if (contact2.getKey().equals(YConstants.AT_INSTITUTION_WWW)) { final ViewContact viewContact = new ViewContact(YConstants.AT_CONTACT_URL, detailsFilter.filter(contact2.getValue(), InputType.RICH_TEXT, filteringContext)); contacts.add(viewContact); } else if (contact2.getKey().equals(YConstants.AT_INSTITUTION_PHONE)) { final ViewContact viewContact = new ViewContact(YConstants.AT_CONTACT_PHONE, detailsFilter.filter(contact2.getValue(), InputType.RICH_TEXT, filteringContext)); contacts.add(viewContact); } } } } return contacts; }
nc.setNames(ynames); for(YAttribute a : zblc.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT)){ nc.addAttribute(a);
nc.setNames(ynames); for(YAttribute a : zblc.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT)){ nc.addAttribute(a);
indexDocument.setUserId(identity); for (YAttribute attribute : contributor.getAttributes(ApplicationConstants.COANSYS_ID_SCHEMA)) { indexDocument.setPersonId(attribute.getValue());
for (YAttribute a : zblc.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT)) { nc.addAttribute(a);
if(c.getOneName("canonical")!=null) ya = new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR,c.getOneName("canonical").getText().toString()); if(c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).size()>0) ya.addAttribute(YConstants.AT_ZBL_AUTHOR_FINGERPRINT , c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).get(0).getValue()); if(c.getOneName("forenames")!=null) ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES , c.getOneName("forenames").getText().toString() );
if(c.getOneName("canonical")!=null) ya = new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR,c.getOneName("canonical").getText().toString()); if(c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).size()>0) ya.addAttribute(YConstants.AT_ZBL_AUTHOR_FINGERPRINT , c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).get(0).getValue()); if(c.getOneName("forenames")!=null) ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES , c.getOneName("forenames").getText().toString() );