gpt4 book ai didi

pl.edu.icm.model.bwmeta.YElement类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 23:23:31 28 4
gpt4 key购买 nike

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

YElement介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

public YElement convert(YElement yElement, String collection) {
  
  //normalizacja kontrybutorów
  if (yElement.getContributors() != null) {
    Iterator<YContributor> contributors = yElement.getContributors().iterator();
    
    while (contributors.hasNext()) {
      
      YContributor contributor = contributors.next();
      
      fixContributor(contributor);
      
      if (isEmpty(contributor)) {
        logger.warn("Bwmeta warning: empty contributor skipped in article "+yElement.getId());
        contributors.remove();
      }
      
    }
  }
  normalizeReferences(yElement);
  
  if (isBazhumCollection(collection)) {
    normalizeBazhumArticle(yElement);
  }
  
  return yElement;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

protected YElement toYModel(Entity entity, String defaultName) {
  YElement result = new YElement(entity.getId());
  
  result.addName(new YName(YLanguage.Undetermined, defaultName, NM_CANONICAL));		
  result.addStructure(new YStructure(EXT_HIERARCHY_JOURNAL));
  
  return result;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

protected void addAttributeIfTrue(YElement element, String name, boolean value) {
  if (value) {
    element.addAttribute(name, String.valueOf(value));
  }
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

Journal convert(YElement yJournal) {
  Preconditions.checkArgument(yJournal.getStructure(EXT_HIERARCHY_JOURNAL)!= null);
  Preconditions.checkArgument(yJournal.getStructure(EXT_HIERARCHY_JOURNAL).getCurrent().getLevel().equals(EXT_LEVEL_JOURNAL_JOURNAL));
  
  Journal result = new Journal(yJournal.getId());
  setTitleAndIssns(yJournal, result);
  result.setPbnId(yJournal.getId(IdSchemes.PBN_ID));
  //publisher
  if (yJournal.getContributors() != null) {
    for (YContributor contrib : yJournal.getContributors()) {
      if (CR_PUBLISHER.equals(contrib.getRole())) {
        result.setPublisherName(BWMetaUtil.getCanonicalName(contrib));
      }
    }
  }
  // approved flag
  String attribute = getAttribute(PciBwmetaConstants.ATTR_APPROVED, yJournal);
  if (StringUtils.isNotEmpty(attribute)) {
    result.setApproved(Boolean.parseBoolean(attribute));
  }
  
  return result;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

Article convert(YElement yElement) {
  YStructure struct = yElement.getStructure(EXT_HIERARCHY_JOURNAL);
  Article result = new Article(yElement.getId(), issueConverter.convertIssueStub(struct));
  List<YName> yNames = yElement.getNames();
  for(YName yName : yNames) {
    if (isNotBlank(yName) && NM_ALTERNATIVE.equals(yName.getType())) {

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

JournalIssue convert(YElement yIssue) {
  Preconditions.checkArgument(yIssue.getStructure(EXT_HIERARCHY_JOURNAL)!= null);
  
  JournalIssue result = new JournalIssue(yIssue.getId());
      
  YStructure struct = yIssue.getStructure(EXT_HIERARCHY_JOURNAL);
  Preconditions.checkArgument(struct.getCurrent().getLevel().equals(EXT_LEVEL_JOURNAL_ISSUE));
  result.setJournal(journalConverter.convertJournalStub(struct));
  setYearVolume(struct, result);
  
  String numberName = BWMetaUtil.getCanonicalName(yIssue);
  if (StringUtils.isNotBlank(numberName)) {
    result.setNumber(numberName);
  }
  
  return result;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

yElement.addName(new YName(YLanguage.Undetermined, title, NM_ALTERNATIVE));
  yElement.addAttribute(PciBwmetaConstants.ATTR_TYPE, article.getType().name());
  yElement.addLanguage(YLanguage.byCode(article.getLanguageCode()));
  yElement.addAttribute(PciBwmetaConstants.ATTR_SOURCE_COLLECTION, article.getSourceCollection());
yCurrent.setPosition(article.getPagesFromTo());
YStructure struct = yElement.getStructure(EXT_HIERARCHY_JOURNAL);
struct.setCurrent(yCurrent);

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

void convert(YElement element, Article result) {
  InstitutionBuilder builder = new InstitutionBuilder(result, true);
  
  if (element.getAffiliations() != null) {
    for (YAffiliation yAff : element.getAffiliations()) {
      if (StringUtils.isBlank(yAff.getSimpleText())) {
        logger.warn("Empty affiliation text in article "+element.getId()+" (affiliation id: "+yAff.getId()+")");
      } else {
        builder.addInstitution(yAff.getId(), yAff.getSimpleText());
      }
    }
  }
      
  for (YContributor yContributor : getContributors(element)) {
    convert(yContributor, result, builder);
  }
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

private List<YContributor> getContributors(YElement element) {
  List<YContributor> result = Lists.newArrayList();
  
  if (element.getContributors() != null) {
    for (YContributor contributor : element.getContributors()) {
      if (contributor.isInstitution()) {
        continue;
      }
      
      result.add(contributor);
    }
  }
  
  return result;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

void toYModel(Article article, YElement element) {
  for (Institution inst : article.getInstitutions()) {
    element.addAffiliation(toYModel(inst));
  }
  
  for (Contributor contrib : article.getContributors()) {
    element.addContributor(toYModel(contrib));
  }
}

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

@Override
  public BwmetaToHBaseDocumentMetadata yelementToDocumentMetadata(final YElement yElement, final String collection) {
    final DocumentMetadata documentMetadata = MetadataToProtoMetadataParser.yelementToDocumentMetadata(
        yElement, null, yElement.getId(), collection);
    if (null == documentMetadata) {
      return null;
    }
    return new BwmetaToHBaseDocumentMetadataImpl(documentMetadata);
  }
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

YElement toYModel(Journal journal) {
  YElement yElement = super.toYModel(journal, journal.getTitle());
  
  addIdIfNotBlank(yElement, journal.getIssn(), EXT_SCHEME_ISSN);
  addIdIfNotBlank(yElement, journal.getEissn(), EXT_SCHEME_EISSN);
  addIdIfNotBlank(yElement, journal.getPbnId(), IdSchemes.PBN_ID);
  //publisher
  if (StringUtils.isNotBlank(journal.getPublisherName())) {
    YContributor yContributor = new YContributor(CR_PUBLISHER, true);
    
    yContributor.addName(new YName(YLanguage.Undetermined, journal.getPublisherName(), NM_CANONICAL));
    
    yElement.addContributor(yContributor);
  }
  //structure
  YCurrent yCurrent = new YCurrent(EXT_LEVEL_JOURNAL_JOURNAL);
  yElement.getStructure(EXT_HIERARCHY_JOURNAL).setCurrent(yCurrent);
  //approved flag
  addAttributeIfTrue(yElement, PciBwmetaConstants.ATTR_APPROVED, journal.isApproved());
  
  return yElement;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

private void addIdIfNotBlank(YElement element, String id, String scheme) {
  if (StringUtils.isNotBlank(id)) {
    element.addId(new YId(scheme, id));
  }
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

void toYModel(Article article, YElement element) {
  for (Reference ref : article.getReferences()) {
    element.addRelation(toYModel(ref));
  }
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

YStructure struct = yArticle.getStructure(YConstants.EXT_HIERARCHY_JOURNAL);
  logger.info("Skipping bwmeta record at level {} (id: {})", currentLevel(struct), yArticle.getId());
  result = null;
} else {
  Journal journalStub = issueStub==null ? null : issueStub.getJournal();
  InboundArticle item = new InboundArticle(totalCount.get(), yArticle.getId(), article, journalStub, issueStub);
  item.setResourcePath(resourcePath);
  result = new SingleItemIterator(item);

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

private boolean isYElementPutable(final YElement yElement) {
  final List<YContributor> authorNodeList = yElement.getContributors();
  for (int i = 0; i < authorNodeList.size(); i++) {
    final YContributor currentNode = authorNodeList.get(i);
    if (currentNode != null && currentNode.isPerson() && AUTHOR.equals(currentNode.getRole())) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

void toYModel(Article article, YElement element) {
  for (Identifier id : article.getIdentifiers()) {
    element.addId(new YId(id.getType(), id.getValue()));
  }
  
  if (StringUtils.isNotEmpty(article.getSourceId())) {
    element.addId(new YId(IdSchemes.SOURCE_ID, article.getSourceId()));
  }
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com