pl.edu.icm.model.bwmeta.y.YAttribute.getValue()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中pl.edu.icm.model.bwmeta.y.YAttribute.getValue()方法的一些代码示例,展示了YAttribute.getValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAttribute.getValue()方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YAttribute
类名称:YAttribute
方法名:getValue

YAttribute.getValue介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

private Set<String> getAffiliationsNamesFromAttributes(List<YAttribute> attributes) {
    Set<String> affNames = new HashSet<>();

    for (YAttribute attribute : attributes) {
      String name = attribute.getValue();
      if (StringUtils.isNotBlank(name)) {
        affNames.add(name);
      }
    }
    return affNames;
  }
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

public boolean updateWithAttribute(YRelation rel, Map<String, String> relfields, String attrName, String fieldName) {
  List<YAttribute> attrs = rel.getAttributes(attrName);
  if (attrs != null && attrs.size() > 0) {
    relfields.put(fieldName, attrs.get(0).getValue().trim());
    return true;
  }
  
  return false;
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

public void updateWithAttribute(YAttribute src, Map<String, String> relfields, String attrName, String fieldName) {
  List<YAttribute> attrs = src.getAttributes(attrName);
  if (attrs != null && attrs.size() > 0) {
    relfields.put(fieldName, attrs.get(0).getValue().trim());
  }
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

public void updateWithAttribute(YRelation rel, Map<String, String> relfields, String attrName, String fieldName) {
  List<YAttribute> attrs = rel.getAttributes(attrName);
  if (attrs != null && attrs.size() > 0) {
    relfields.put(fieldName, attrs.get(0).getValue().trim());
  }
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

public void updateWithAttribute(YAttribute src, Map<String, String> relfields, String attrName, String fieldName) {
  List<YAttribute> attrs = src.getAttributes(attrName);
  if (attrs != null && attrs.size() > 0) {
    relfields.put(fieldName, attrs.get(0).getValue().trim());
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

private void proceedReferenceAuthorZblFingerPrint(YAttribute ya,
    LinkedList<PredicateAndObject> pao) {
  for(YAttribute inner : ya.getAttributes()){
    if(YConstants.AT_ZBL_AUTHOR_FINGERPRINT.equals(inner.getKey()) && !"-".equals(inner.getValue())){/*5.1*/
      String zblfingerprint=inner.getValue();
      pao.add(new PredicateAndObject(RelConstants.RL_IS_PERSON, RelConstants.NS_ZBL_PERSON + zblfingerprint)); 
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

public void updateWithAuthorFields(YRelation rel, Map<String, String> relfields, String fieldName) {
  List<YAttribute> attrs = rel.getAttributes(YConstants.AT_REFERENCE_PARSED_AUTHOR);
  if (attrs != null && attrs.size() > 0) {
    StringBuilder strb = new StringBuilder();
    for (YAttribute au : attrs) {
      strb.append(au.getValue().trim());
      strb.append(" & ");
    }
    // YAttribute auAttr = attrs.get(0);
    // updateWithAttribute(auAttr, relfields,
    // YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES, "af");
    // updateWithAttribute(auAttr, relfields,
    // YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME, "as");
    relfields.put(fieldName.trim(), strb.toString().trim());
  }
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

public void updateWithAuthorFields(YRelation rel, Map<String, String> relfields, String fieldName) {
  List<YAttribute> attrs = rel.getAttributes(YConstants.AT_REFERENCE_PARSED_AUTHOR);
  if (attrs != null && attrs.size() > 0) {
    StringBuilder strb = new StringBuilder();
    for (YAttribute au : attrs) {
      strb.append(au.getValue().trim());
      strb.append(" & ");
    }
    // YAttribute auAttr = attrs.get(0);
    // updateWithAttribute(auAttr, relfields,
    // YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES, "af");
    // updateWithAttribute(auAttr, relfields,
    // YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME, "as");
    relfields.put(fieldName.trim(), strb.toString().trim());
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

/**
 * transplantation form RelationStatementBuilder 
 * @param ya
 * @param paos_ref
 * @param refno
 * @param sb 
 * @return
 * @throws YaddaException 
 */
private boolean parseReferenceText(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno, StringBuffer sb) throws YaddaException {
  if(YConstants.AT_REFERENCE_TEXT.equals(ya.getKey())){/*3*/
    sb.append(ya.getValue().toString());
    paos_ref.add(new PredicateAndObject(RelConstants.RL_TEXT, ya.getValue().toString()));
    //further parsing of reference-parsed-text is done in parseReferences() method, 
    //hence parsing here is not allowed
    return true;
  }else return false;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private List<String> getAddresses(YInstitution inst, IFilteringContext fc) {
  List<String> result = new ArrayList<String>();
  for (YAttribute attr : inst.getAttributes(YConstants.AT_CONTACT_LOCATION)) {
    result.add(detailsFilter.filter(attr.getValue(), InputType.RICH_TEXT, fc));
  }
  return result;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

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()));
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

/**
 * transplantation form RelationStatementBuilder 
 * @param ya
 * @param paos_ref
 * @param refno
 * @return
 */
private boolean parseReferenceText(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
  if(YConstants.AT_REFERENCE_TEXT.equals(ya.getKey())){/*3*/
    parseReferenceText(ya.getValue(), paos_ref, refno);
    return true;
  }else return false;
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

@Override
public String constructFieldValue(List<YElement> yelements) {
  List<YElement> articles = YElementsParsingToolbox.filterYElementsOfStructureLevel(yelements, YConstants.EXT_LEVEL_JOURNAL_ARTICLE);
  if (articles.size() == 0) {
    return null;
  }
  if (articles.size() > 1) {
    log.error("More than one article found in package of yelements!");
  }       
  YElement article = articles.get(0);
  List<YAttribute> attrs = article.getAttributes(YConstants.AT_ZBL_LANG_DESCRIPTION);
  if (attrs==null || attrs.size() == 0) {
    return null;
  }
  
  return YElementsParsingToolbox.removeEmptyValues(attrs.get(0).getValue());
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

@Override
public String constructFieldValue(List<YElement> yelements) {
  List<YElement> journals = YElementsParsingToolbox.filterYElementsOfStructureLevel(yelements,
      YConstants.EXT_LEVEL_JOURNAL_JOURNAL);
  if (journals.size() == 0) {
    return null;
  }
  if (journals.size() > 1) {
    log.error("More than one journal found in package of yelements!");
  }
  YElement journal = journals.get(0);
  List<YAttribute> fingerprints = journal.getAttributes(YConstants.AT_ZBL_JOURNAL_FINGERPRINT);
  for (YAttribute fingerprint : fingerprints) {
    if (fingerprint != null) {
      return (fingerprint.getValue());
    }
  }
  return null;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

/**
 * accomplished
 * @param ya
 * @param paos_ref
 * @param refno
 * @param refid 
 * @return
 */
private boolean parseReferenceId(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
  if(YConstants.AT_REFERENCE_PARSED_ID_MR.equals(ya.getKey())){/*1.1*/
    paos_ref.add(new PredicateAndObject(RelConstants.RL_IS_DOCUMENT, RelConstants.NS_MR_DOCUMENT+ ya.getValue()));
    return true;
  }else if(YConstants.AT_REFERENCE_PARSED_ID_ZBL.equals(ya.getKey())){/*1.2*/
    paos_ref.add(new PredicateAndObject(RelConstants.RL_IS_DOCUMENT, RelConstants.NS_ZBL_DOCUMENT+ ya.getValue()));
    return true;
  }else if(YConstants.AT_REFERENCE_PARSED_ID_ISBN.equals(ya.getKey())){
    paos_ref.add(new PredicateAndObject(RelConstants.RL_HAS_ISBN, RelConstants.NS_ISBN+ ya.getValue()));
    return true;
  }else return false;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

protected List<String> resolveAddresses(final YContributor contributor, final IFilteringContext filteringContext) {
  final List<String> addresses = new LinkedList<String>();
  if (contributor.isInstitution()) {
    final YAttribute institution = contributor.getOneAttribute(YConstants.AT_INSTITUTION);
    if (institution != null) {
      for (final YAttribute address : institution.getAttributes(YConstants.AT_INSTITUTION_ADDRESS)) {
        addresses.add(detailsFilter.filter(address.getValue(), InputType.RICH_TEXT, filteringContext));
      }
    }
  }
  return addresses;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

/**
 * accomplished
 * @param ya
 * @param paos_ref
 * @param refno
 * @return
 */
private boolean parseReferenceName(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
  if(YConstants.AT_ENHANCED_FROM_ZBL_NAME.equals(ya.getKey())){/*8*/
    for(YAttribute inner : ya.getAttributes()){
      if(YConstants.AT_ENHANCED_FROM_ZBL_TYPE.equals(inner.getKey())){/*8.1*/
        
      }else if(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE.equals(inner.getKey())){/*8.2*/
        
      }else if(YConstants.AT_ENHANCED_FROM_ZBL_VALUE.equals(inner.getKey())){/*8.3*/
        paos_ref.add(new PredicateAndObject(RelConstants.RL_TITLE, inner.getValue()));
      }
    }
    return true;
  }else return false;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

/**
 * accomplished
 * @param ya
 * @param paos_ref
 * @param refno
 * @return
 */
private boolean parseReferenceName(YAttribute ya, LinkedList<PredicateAndObject> paos_ref, int refno) {
  if(YConstants.AT_ENHANCED_FROM_ZBL_NAME.equals(ya.getKey())){/*8*/
    for(YAttribute inner : ya.getAttributes()){
      if(YConstants.AT_ENHANCED_FROM_ZBL_TYPE.equals(inner.getKey())){/*8.1*/
        
      }else if(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE.equals(inner.getKey())){/*8.2*/
        
      }else if(YConstants.AT_ENHANCED_FROM_ZBL_VALUE.equals(inner.getKey())){/*8.3*/
        paos_ref.add(new PredicateAndObject(RelConstants.RL_TITLE, inner.getValue()));
      }
    }
    return true;
  }else return false;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

@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);
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

/**
 * Creates PublisherData using YElement
 *
 * @param yElement
 *            metadata element used to create object
 */
public PublisherData createPublisherData(YContributor contributor) {
  PublisherData pd = new PublisherData();
  populateBaseProperties(contributor, pd);
  if (contributor.getOneAttribute(CommonAttributeTypes.AT_CONTACT_URL) != null) {
    pd.setUrl(contributor.getOneAttribute(CommonAttributeTypes.AT_CONTACT_URL).getValue());
  }
  final String email = contributor.getOneAttributeSimpleValue(CommonAttributeTypes.AT_CONTACT_EMAIL);
  if (StringUtils.isNotBlank(email)) {
    pd.setEmail(email);
  }
  return pd;
}

相关文章