gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 16:32:40 27 4
gpt4 key购买 nike

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

YRelation.setTarget介绍

暂无

代码示例

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

private List<YRelation> toYRelations(final List<DocReference> references) {
  final List<YRelation> relationsFromMetadata = new ArrayList<YRelation>();
  for (final DocReference reference : references) {
    final YRelation yRelation = new YRelation();
    yRelation.setType(YConstants.RL_REFERENCE_TO);
    yRelation.addAttribute(YConstants.AT_REFERENCE_TEXT, reference.getText());
    final List<DocId> hits = reference.getMatches();
    if (hits != null && !hits.isEmpty()) {
      final DocId match = hits.get(0);
      yRelation.setTarget(new YId(match.getDomain(), match.getId()));
      if (hits.size() > 1) {
        log.info(
            "There are several documents matching reference {} of document {}. Presenting only first. All found:{}.",
            new Object[] { reference.getText(), id, hits });
      }
    }
    relationsFromMetadata.add(yRelation);
  }
  return relationsFromMetadata;
}

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

private void appendBibliography(ResourceData resource, YElement yElement) {
  if (!resource.getBibliography().isEmpty()) {
    for (BibliographyReference bib : resource.getBibliography()) {
      YRelation relation = new YRelation();
      relation.setType(RelationTypes.RL_REFERENCE_TO);
      relation.addAttribute(ReferenceAttributeTypes.AT_REFERENCE_TEXT, bib.getText());
      if (StringUtils.isNotBlank(bib.getAssignedId())) {
        relation.setTarget(new YId(IdSchemaIds.EXT_SCHEME_YADDA, bib.getAssignedId()));
      }
      yElement.addRelation(relation);
    }
  }
}

代码示例来源:origin: pl.edu.icm.synat/synat-process-common

private void addTitleList(YElement element, List<TitleHistoryElement> titles, String relationType) {
  for (TitleHistoryElement titleHistoryElement : titles) {
    YRelation relation = new YRelation();
    relation.setType(relationType);
    if (titleHistoryElement.getId() != null) {
      relation.setTarget(new YId(IdSchemaIds.EXT_SCHEME_YADDA, titleHistoryElement.getId()));
    } else if (titleHistoryElement.getIssn() != null) {
      relation.setTarget(new YId(IdSchemaIds.EXT_SCHEME_ISSN, titleHistoryElement.getIssn()));
    }
    String dateRange = titleHistoryElement.getDateRange();
    if (StringUtils.isNotBlank(dateRange)) {
      relation.addAttribute(ReferenceAttributeTypes.AT_REFERENCE_PARSED_DATE, dateRange);
    }
    String title = titleHistoryElement.getTitleName();
    if (StringUtils.isNotBlank(title)) {
      relation.addAttribute(ReferenceAttributeTypes.AT_REFERENCE_PARSED_TITLE, title);
    }
    element.addRelation(relation);
  }
}

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

relation.setTarget(new YId(YConstants.EXT_SCHEMA_EUDML, eudmlId));

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

yr.setType(RelationTypes.RL_REFERENCE_TO);
if (StringUtils.isNotBlank(rt.getPolindexId())) {
  yr.setTarget(new YId(IdSchemaIds.EXT_SCHEME_POLINDEX, rt.getPolindexId()));

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

relation.setTarget(new YId(IdSchemaIds.EXT_SCHEMA_EUDML, eudmlId));

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