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

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

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

YAttribute.addAttribute介绍

暂无

代码示例

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

public static void updateYRelationWithZblIds(YRelation relye, YElement zblye) {
  YAttribute ya = new YAttribute(YConstants.TG_CATEGORY, "");
  for (YId i : zblye.getIds()) {
    if (i.getScheme().equals(YConstants.EXT_SCHEME_ISSN)) {
      ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ISSN, i.getValue()));
    } else if (i.getScheme().equals(YConstants.EXT_SCHEME_ISBN)) {
      ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ISBN, i.getValue()));
    } else if (i.getScheme().equals(YConstants.EXT_SCHEME_ZBL)) {
      ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ZBL, i.getValue()));
    } else if (i.getScheme().equals(YConstants.EXT_SCHEME_ZBL)) {
      ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ZBL, i.getValue()));
    }
  }
  relye.addAttribute(ya);
}

代码示例来源: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.yadda/yadda-analysis-impl

public static void updateYRelationWithZblNames(YRelation relye, YElement zblye) {
  for (YName n : zblye.getNames()) {
    YAttribute ya = new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_NAME, "");
    ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE, n.getLanguage().getName()));
    ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE, n.getType()));
    ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_VALUE, n.getText()));
    relye.addAttribute(ya);
  }
}

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

public static void updateYRelationWithZblTags(YRelation relye, YElement zblye) {
  for (YTagList tl : zblye.getTagLists()) {
    YAttribute ya = new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TAG, "");
    ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE, tl.getType()));
    ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE, tl.getLanguage().getName()));
    for (String t : tl.getValues()) {
      ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_VALUE, t));
    }
    relye.addAttribute(ya);
  }
}

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

ya.setValue(separateAuthorForenamesList.get(s1)+" "+separateAuthorSurnamesList.get(s1));
ya.setKey(YConstants.AT_REFERENCE_PARSED_AUTHOR);
if(separateAuthorForenamesList.get(s1)!=null && separateAuthorForenamesList.get(s1).length()>0) ya.addAttribute(new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES, separateAuthorForenamesList.get(s1).toString()));
if(separateAuthorSurnamesList.get(s1)!=null && separateAuthorSurnamesList.get(s1).length()>0) ya.addAttribute(new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME, separateAuthorSurnamesList.get(s1)));
parsed.addAttribute(ya);

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

public static boolean sanitizeCategoryRefs(YElement article) {
  if (article == null || article.getCategoryRefs().isEmpty())
    return false;
  
  boolean warning = false;
  List<YCategoryRef> cleanRefs = new ArrayList<YCategoryRef>();
  for (YCategoryRef ref : article.getCategoryRefs()) {
    if (ref == null || ref.getCode() == null || ref.getCode().trim().isEmpty())
      continue;
    ref.setCode(ref.getCode().trim());
    List<YCategoryRef> refs = sanitizeCategoryRef(ref);
    warning = warning || isChanged(ref, refs);
    cleanRefs.addAll(refs);
  }
  article.setCategoryRefs(cleanRefs);
  
  if (!warning)
    return false;
  YAttribute attr = article.getOneAttribute(Warnings.WARNINGS);
  if (attr == null) {
    attr = new YAttribute(Warnings.WARNINGS, (String) null);
    article.addAttribute(attr);
  }
  if (attr.getOneAttribute(Warnings.WARNINGS_CHECK_CATEGORY_REFS) == null)
    attr.addAttribute(Warnings.WARNINGS_CHECK_CATEGORY_REFS, "");
  
  return true;
}

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

author.addAttribute(AT_REFERENCE_PARSED_AUTHOR_SURNAME, surname);
if (!givenNames.isEmpty()) {
  author.addAttribute(AT_REFERENCE_PARSED_AUTHOR_FORENAMES, givenNames);

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

public static void updateYRelationWithZblClassificationCodes(YRelation relye, YElement zblye) {
  YAttribute ya;
  ya = new YAttribute(YConstants.TG_CATEGORY, "");
  for (YCategoryRef r : zblye.getCategoryRefs()) {
    ya.addAttribute(new YAttribute(r.getClassification(), r.getCode()));
  }
  relye.addAttribute(ya);
}

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

ya = new YAttribute(YConstants.TG_CATEGORY,"");
for(YCategoryRef r : zblye.getCategoryRefs()){
  ya.addAttribute(new YAttribute(r.getClassification(), r.getCode()));
    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);
for(YId i : zblye.getIds()){
  if(i.getScheme().equals(YConstants.EXT_SCHEME_ISSN)){
    ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ISSN, i.getValue()));
  }else if(i.getScheme().equals(YConstants.EXT_SCHEME_ISBN)){
    ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ISBN, i.getValue()));
  } else if(i.getScheme().equals(YConstants.EXT_SCHEME_ZBL)){
    ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ZBL, i.getValue()));
  } else if(i.getScheme().equals(YConstants.EXT_SCHEME_ZBL)){
    ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ZBL, i.getValue()));
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE,n.getLanguage().getName()));
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE,n.getType()));
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_VALUE,n.getText()));
  relye.addAttribute(ya);
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE, tl.getType()));
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE, tl.getLanguage().getName()));

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

ya = new YAttribute(YConstants.TG_CATEGORY,"");
for(YCategoryRef r : zblye.getCategoryRefs()){
  ya.addAttribute(new YAttribute(r.getClassification(), r.getCode()));
    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);
for(YId i : zblye.getIds()){
  if(i.getScheme().equals(YConstants.EXT_SCHEME_ISSN)){
    ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ISSN, i.getValue()));
  }else if(i.getScheme().equals(YConstants.EXT_SCHEME_ISBN)){
    ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ISBN, i.getValue()));
  } else if(i.getScheme().equals(YConstants.EXT_SCHEME_ZBL)){
    ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ZBL, i.getValue()));
  } else if(i.getScheme().equals(YConstants.EXT_SCHEME_ZBL)){
    ya.addAttribute(new YAttribute(YConstants.EXT_SCHEME_ZBL, i.getValue()));
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE,n.getLanguage().getName()));
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE,n.getType()));
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_VALUE,n.getText()));
  relye.addAttribute(ya);
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE, tl.getType()));
  ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE, tl.getLanguage().getName()));

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

author.addAttribute(ReferenceAttributeTypes.AT_REFERENCE_PARSED_PERSON_SURNAME, surname);
if (!givenNames.isEmpty()) {
  author.addAttribute(ReferenceAttributeTypes.AT_REFERENCE_PARSED_PERSON_FORENAMES, givenNames);

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

if(forename!=null && surname!=null &&  forename.length()>0 && surname.length()>0){
  ya.setValue(forename+" "+surname);
  ya.addAttribute(new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES, forename));
  ya.addAttribute(new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME, surname));
} else if(surname!=null && forename.length()==0 && surname.length()>0){
  ya.setValue(surname);
  ya.addAttribute(new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME, surname));
} else if(forename!=null && forename.length()>0 && surname.length()==0){
  ya.setValue(forename);
  ya.addAttribute(new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES, forename));
} else ya.setValue("");
parsed.addAttribute(ya);

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

yAuthor.setKey(YConstants.AT_REFERENCE_PARSED_AUTHOR);
yAuthor.addAttribute(ySurname);
yAuthor.addAttribute(yForenames);

相关文章