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

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

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

YElement.addId介绍

暂无

代码示例

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

@Override
  protected boolean enhanceMetadata(MatchResult result, YElement metadata) {
    metadata.addId(new YId(YConstants.EXT_SCHEME_ISSN, result.group(1)));
    return true;
  }
}

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

@Override
protected boolean enhanceMetadata(MatchResult result, YElement metadata) {
  // FIXME: Scheme for urn?
  metadata.addId(new YId("urn", result.group(1)));
  return true;
}

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

@Override
  protected boolean enhanceMetadata(MatchResult result, YElement metadata) {
    metadata.addId(new YId(YConstants.EXT_SCHEME_DOI, result.group(1)));
    return true;
  }
}

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

/**
 * While mizar id is inserted bydegreuter as keyword, 
 * we are making special traslation
 * @param kg
 * @param article 
 */
void updateMizarID(org.jdom.Element kg, YElement article){
  List<org.jdom.Element> ks = JDOMHelper.getChildren(kg, "kwd");
  for (org.jdom.Element k : ks) {
     String t=k.getText();
    if (t.toLowerCase().contains("identifier") && t.toLowerCase().contains((":"))){
      String id=t.split(":")[1].trim();
      article.addId(new YId(IdSchemaIds.EXT_SCHEME_MIZAR_MATHEMATICAL_LIBRARY, id));
    }
  }
}

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

private void updateJournalIssns(org.jdom.Element jmeta, YElement journal) {
  // journal.addId(y.id(EXT_SCHEME_ISSN, jmeta.getChildTextTrim("issn")));
  List<org.jdom.Element> issns = JDOMHelper.getChildren(jmeta, "issn");
  for (org.jdom.Element issn : issns) {
    String issnValue = issn.getValue().trim();
    // System.out.println("[NlmToYTransformer] Adding next issn:" +
    // issnValue);
    if (StringUtils.isNotBlank(issnValue)) {
     journal.addId(new YId(EXT_SCHEME_ISSN, issnValue));
    }
  }
}

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

private void updateJournalAids(org.jdom.Element jmeta, YElement journal) {
    List<org.jdom.Element> aids = JDOMHelper.getChildren(jmeta, "journal-id");
    for (org.jdom.Element aid : aids) {
      String journalIdType = aid.getAttributeValue("journal-id-type");
      String idVal = aid.getTextNormalize();

      if ("eudml-id".equalsIgnoreCase(journalIdType)) {
        journal.addId(new YId(IdSchemaIds.EXT_SCHEMA_EUDML, idVal));
      } else if ("doi".equalsIgnoreCase(journalIdType)) {
        journal.addId(new YId(IdSchemaIds.EXT_SCHEME_DOI, idVal));
      } else if ("issn".equalsIgnoreCase(journalIdType)) {
        journal.addId(new YId(IdSchemaIds.EXT_SCHEME_ISSN, idVal));
      } else if ("pubmed".equalsIgnoreCase(journalIdType)) {
        journal.addId(new YId(IdSchemaIds.EXT_SCHEME_PMID, idVal));
      } else if ("cedram-id".equalsIgnoreCase(journalIdType)) {
        journal.addId(new YId(IdSchemaIds.EXT_SCHEME_CEDRAM, idVal));
      }else {
        journal.addAttribute( journalIdType, idVal);
      }
    }
  }
//?? do we need this?

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

public void updateElementIds(org.jdom.Element ameta, YElement article, String idElementName) {
  List<org.jdom.Element> aids = JDOMHelper.getChildren(ameta, idElementName);
  for (org.jdom.Element aid : aids) {
    if ("eudml-id".equalsIgnoreCase(aid.getAttributeValue("pub-id-type"))) {
      article.addId(new YId(IdSchemaIds.EXT_SCHEMA_EUDML, aid.getTextTrim()));
    } else if ("doi".equalsIgnoreCase(aid.getAttributeValue("pub-id-type"))) {
      article.addId(new YId(IdSchemaIds.EXT_SCHEME_DOI, aid.getTextTrim()));
    } else if ("cedram-id".equalsIgnoreCase(aid.getAttributeValue("pub-id-type"))) {
      article.addId(new YId(IdSchemaIds.EXT_SCHEME_CEDRAM, aid.getTextTrim()));
    } else if ("gdz-id".equalsIgnoreCase(aid.getAttributeValue("pub-id-type"))) {
      article.addId(new YId("bwmeta1.id-class." + aid.getAttributeValue("pub-id-type"), aid.getTextTrim()));
    }  else if ("dmlcz-id".equalsIgnoreCase(aid.getAttributeValue("pub-id-type"))) {
      article.addId(new YId("bwmeta1.id-class." + aid.getAttributeValue("pub-id-type"), aid.getTextTrim()));
    }  else {
      article.addAttribute("bwmeta1.id-class." + aid.getAttributeValue("pub-id-type"), aid.getTextTrim());
    }
  }
}

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

protected void convertIds(BibEntry source, YElement yElement) {
  String doi = source.getFirstFieldValue(BibEntry.FIELD_DOI);
  if (doi != null) {
    yElement.addId(new YId(YConstants.EXT_SCHEME_DOI, doi));
  }
  String issn = source.getFirstFieldValue(BibEntry.FIELD_ISSN);
  if (issn != null) {
    yElement.addId(new YId(YConstants.EXT_SCHEME_ISSN, issn));
  }
  String isbn = source.getFirstFieldValue(BibEntry.FIELD_ISBN);
  if (isbn != null) {
    yElement.addId(new YId(YConstants.EXT_SCHEME_ISBN, isbn));
  }
}

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

private static void updateYElementIdsWithZblIds(YElement ye, YElement zblye) {
  for (YId i : zblye.getIds())
    if (ye.getId(i.getScheme()) == null)
      ye.addId(i);
}

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

String idValue = attributes.iterator().next().getValue();
if (StringUtils.isNotBlank(idValue)) {
  element.addId(new YId(idSchema, idValue));
  fixed = true;

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

/**
 * Adds next ISSN number safely (checking if it is not already added).
 * 
 * @param yelement
 * @param issn
 */
private void appendNextIssn(YElement yelement, String issn) {
  YId id = new YId(YConstants.EXT_SCHEME_ISSN, issn);
  YId formattedId = new YId(YConstants.EXT_SCHEME_ISSN, ZentralBlattConverterTools.formatIssn(issn));
  // make sure that is not already added from other field
  if (!yelement.getIds().contains(id) && !yelement.getIds().contains(formattedId)) {
    yelement.addId(id);
  }
}

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

/**
 * Processes <code>article-meta</code> metadata creating an issue element.
 *
 * @param ameta the metadata element to extract issue info from
 * @param parent parent element for the created element
 * @return the created issue element
 */
private YElement processIssue(org.jdom.Element ameta, YElement parent) {
  String name = getTextTrim(optDescendant(ameta, "issue"));
  YElement issue = y.element(EXT_LEVEL_JOURNAL_ISSUE,
      y.canonicalName(YLanguage.NoLinguisticContent, name),
      parent);
  List<org.jdom.Element> aids = ameta.getChildren("issue-id");
  for (org.jdom.Element aid : aids) {
    if ("eudml-id".equalsIgnoreCase(aid.getAttributeValue("pub-id-type"))) {
      issue.addId(new YId(YConstants.EXT_SCHEMA_EUDML, aid.getText()));
    } else {
      issue.addId(new YId("bwmeta1.id-class." + aid.getAttributeValue("pub-id-type"), aid.getText()));
    }
  }
  return issue;
}

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

public boolean updateJournalId(ZentralBlattSeFieldParser.SeFieldData seData, YAncestor ancestor) {
  // ZBL-ID:
  if (seData.jrnlId != null && seData.jrnlId.length() > 0) {
    YId zblId = new YId(YConstants.EXT_SCHEME_ZBL, seData.jrnlId);
    yJournal.addId(zblId);
    updateYElementIdBasingOnZblId(yJournal, "jrnl:");
    ancestor.setIdentity(yJournal.getId());
    ancestor.addId(zblId);
    return true;
  }
  return false;
}

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

/**
 * Processes <code>article-meta</code> metadata creating an issue element.
 *
 * @param ameta the metadata element to extract issue info from
 * @param parent parent element for the created element
 * @return the created issue element
 */
private YElement processIssue(Element ameta, YElement parent) {
  String name = getTextTrim(optDescendant(ameta,"issue"));
   YElement issue = y.element(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ISSUE,
      y.canonicalName(YLanguage.NoLinguisticContent, name),
      parent);
  List<Element> aids = ameta.getChildren("issue-id");
  for (Element aid : aids) {
    if ("eudml-id".equalsIgnoreCase(aid.getAttributeValue("pub-id-type"))) {
      issue.addId(new YId(IdSchemaIds.EXT_SCHEMA_EUDML, aid.getText()));
    }
  }
  return issue;
}

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

journal.addId(new YId(IdSchemaIds.EXT_SCHEME_ISSN, issn));

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

/**
 * Processes <code>journal-meta</code> metadata creating a journal element.
 *
 * @param jmeta the metadata element to extract journal info from
 * @param parent parent element for the created element
 * @return the created journal element
 */
private YElement processJournal(org.jdom.Element jmeta, YElement parent) {
  org.jdom.Element jtitles = jmeta.getChild("journal-title-group");
  List<org.jdom.Element> aids = jmeta.getChildren("journal-id");
  YElement journal = y.element(EXT_LEVEL_JOURNAL_JOURNAL,
      y.canonicalName(YLanguage.Undetermined, jtitles.getChildTextTrim("journal-title")),
      parent).addName(y.name(YLanguage.Undetermined, jtitles.getChildTextTrim("abbrev-journal-title"), NM_ABBREVIATION)).addId(y.id(EXT_SCHEME_ISSN, jmeta.getChildTextTrim("issn")));
  for (org.jdom.Element aid : aids) {
    if ("eudml-id".equalsIgnoreCase(aid.getAttributeValue("journal-id-type"))) {
      journal.addId(new YId(YConstants.EXT_SCHEMA_EUDML, aid.getText()));
    } else {
      journal.addId(new YId("bwmeta1.id-class." + aid.getAttributeValue("journal-id-type"), aid.getText()));
    }
  }
  YName pname = y.canonicalName(YLanguage.Undetermined, getTextTrim(optDescendant(jmeta, "publisher", "publisher-name")));
  journal.addContributor(new YContributor(CR_PUBLISHER, true).addName(pname));
  return journal;
}

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

issue.addId(new YId(IdSchemaIds.EXT_SCHEMA_EUDML, aid.getText())); ///TODO sprawdzic, gdzie to jest uzywane i we wszstkich tych miejscach trzeba to zmienic
} else if ("cedram-id".equalsIgnoreCase(aid.getAttributeValue("pub-id-type"))) {
  issue.addId(new YId(IdSchemaIds.EXT_SCHEME_CEDRAM, aid.getText())); ///TODO sprawdzic, gdzie to jest uzywane i we wszstkich tych miejscach trzeba to zmienic
} else {
  issue.addAttribute(new YAttribute(aid.getAttributeValue("pub-id-type"), aid.getText()));

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

journal.addId(y.id(IdSchemaIds.EXT_SCHEME_ISSN, jmeta.getChildTextTrim("issn")));
    journal.addId(new YId(IdSchemaIds.EXT_SCHEMA_EUDML, aid.getText()));

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

/**
 * Creates yElement object and sets two things: UID &
 * ZentralBlattIdentifier.
 * 
 * @param src
 * @return
 * @throws TransformationException
 */
private YElement initArticle(ZentralBlattRecord src) {
  YElement yelement = new YElement();
  if (src.hasField(ZentralBlattRecord.ID_FIELD_NAME)) {
    YId zblId = new YId(YConstants.EXT_SCHEME_ZBL, extractZBLId(src));
    yelement.addId(zblId);
  }
  yelement.setId(generateUidOfZblId(yelement, ""));
  return yelement;
}

相关文章