gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-16 20:58:40 26 4
gpt4 key购买 nike

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

YElement.addRelation介绍

暂无

代码示例

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

public void updateElementExtLinks(org.jdom.Element ameta, YElement article) {
    List<org.jdom.Element> extLinks = JDOMHelper.getChildren(ameta, "ext-link");
    YRelation relation = new YRelation().setType(RelationTypes.RL_SAME_AS);
    for (org.jdom.Element extLink : extLinks) {
      String href = extLink.getAttributeValue("href", XLINK_NAMESPACE);

      if ("mr-item-id".equals(extLink.getAttributeValue("ext-link-type"))) {
        article.addId(new YId(IdSchemaIds.EXT_SCHEMA_MR, extLink.getTextTrim()));
        if (JDOMHelper.toNull(href) != null) {

          relation.addAttribute(JatsSpecificAttributeTypes.AT_NLM_ARTICLE_MR_URL, href);

        }
      } else if ("zbl-item-id".equals(extLink.getAttributeValue("ext-link-type"))) {
        article.addId(new YId(IdSchemaIds.EXT_SCHEME_ZBL, extLink.getTextTrim()));
        if (JDOMHelper.toNull(href) != null) {

          relation.addAttribute(JatsSpecificAttributeTypes.AT_NLM_ARTICLE_ZBL_URL, href);

        }
      }

    }
    if (relation.getAttributes().size() > 0) {
      article.addRelation(relation);
    }
  }
}

代码示例来源: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

@Override
public EnrichedPayload<YElement> process(EnrichedPayload<BxDocument> input, ProcessContext ctx) throws Exception {
  YElement yElement = metadataExtractor.extractMetadata(input.getObject());
  String[] references = bibReferenceExtractor.extractBibReferences(input.getObject());
  for(String reference : references) {
    YRelation yRelation = new YRelation().setType(YConstants.RL_REFERENCE_TO);
    yRelation.addAttribute(YConstants.AT_REFERENCE_TEXT, reference);
    yElement.addRelation(yRelation);
  }
  return new EnrichedPayload(input.getId(), yElement, input.getCollections(), input.getLicenses());
}

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

text = formatElementCitation(ref.getChild("element-citation"));
article.addRelation(new YRelation().setType(RelationTypes.RL_REFERENCE_TO).addAttribute(ReferenceAttributeTypes.AT_REFERENCE_TEXT, text));

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

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

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

article.addRelation(yr);

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

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

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