gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 17:42:40 26 4
gpt4 key购买 nike

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

YId.getValue介绍

暂无

代码示例

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

private String resolveId(YId yId) {
  switch (yId.getScheme()) {
  case IdSchemaIds.EXT_SCHEME_DOI: return resourceIdResolver.byDOI(yId.getValue());
  case IdSchemaIds.EXT_SCHEME_ISBN: return resourceIdResolver.byISBN(yId.getValue());
  case IdSchemaIds.EXT_SCHEME_ISSN: return resourceIdResolver.byISSN(yId.getValue());
  case IdSchemaIds.EXT_SCHEME_EISSN: return resourceIdResolver.byISSN(yId.getValue());
  default: return yId.getValue();
  }
}

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

private static String extractIssnsStr(List<YId> ids) {
  StringBuilder issns = new StringBuilder();
  for(YId id: ids ) {
    if (id.getScheme().equals(YConstants.EXT_SCHEME_ISSN)){
      issns.append(id.getValue());
      issns.append(YElementToZentralBlattConverter.SUGGESTED_MULTIVALUE_FIELD_SEPARATOR);
    }
  }
  String issnsStr = issns.toString();
  return issnsStr;
}

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

private static String extractIssnsStr(List<YId> ids) {
  StringBuilder issns = new StringBuilder();
  for (YId id : ids) {
    if (id == null) {
      continue;
    }
    
    if (id.getScheme().equals(YConstants.EXT_SCHEME_ISSN)) {
      if (id.getValue() == null) {
        continue;
      }
      String issnVal = id.getValue().trim();
      if (issnVal.length() > 0) {
        issns.append(issnVal);
        issns.append(YElementToZentralBlattConverter.SUGGESTED_MULTIVALUE_FIELD_SEPARATOR);
      }
    }
  }
  String issnsStr = issns.toString();
  return issnsStr;
}

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

public static String retrieveYElementZblId(YElement ye) {
  String mainZblExtId = null;
  for (YId yi : ye.getIds()) {
    if (YConstants.EXT_SCHEME_ZBL.equals(yi.getScheme())) {
      mainZblExtId = yi.getValue();
      break;
    }
  }
  return mainZblExtId;
}

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

protected void fillRelations(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  //        relation element
  for (YRelation yRelation : yElement.getRelations()) {
    if (yRelation.getTarget() != null) {
      if (!ret.containsKey(E_RELATION)) {
        ret.put(E_RELATION, new ArrayList<StringWithAttributes>());
      }
      ret.get(E_RELATION).add(new StringWithAttributes(yRelation.getTarget().getValue()));
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

private String getRelationId(YRelation relation){
  if(relation.getTarget()!=null)
    return relation.getTarget().getValue();
  else
    return "";
}

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

/**
 * Removes expected ISSNs from text and adds to list of issns
 * 
 * @param text
 * @param issns
 * @return filtered text (with expected ISSNs removed)
 */
public String filterExpectedIssns(String text, List<String> issns) {
  for (YId yExpectedIssn : jrnlPossibleIds) {
    String expectedIssn = yExpectedIssn.getValue();
    String formattedExpectedIssn = ZentralBlattConverterTools.formatIssn(expectedIssn);
    // System.out.println("[filterExpectedIssns] next expectedIssn="+expectedIssn+" formattedExpectedIssn="+formattedExpectedIssn+" text="+text);
    if (text.contains(expectedIssn)) {
      text = text.replaceAll(expectedIssn, "");
      // System.out.println("[filterExpectedIssns] adding next expectedIssn="+expectedIssn);
      issns.add(expectedIssn);
    }
    if (text.contains(formattedExpectedIssn)) {
      text = text.replaceAll(formattedExpectedIssn, "");
      // System.out.println("[filterExpectedIssns] adding next expectedIssn="+expectedIssn);
      issns.add(expectedIssn);
    }
  } // for
  return ZentralBlattConverterTools.trimSeparators(text, SE_SEPARATORS);
}

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

protected void fillIdentifiers(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  //        identifier element
  ret.put(E_IDENTIFIER, new ArrayList<StringWithAttributes>());
  ret.get(E_IDENTIFIER).add(new StringWithAttributes(yElement.getId()));
  for (YId yId : yElement.getIds()) {
    StringWithAttributes id = new StringWithAttributes(yId.getValue());
    id.getAttributes().put("scheme", yId.getScheme());
    ret.get(E_IDENTIFIER).add(id);
  }
}

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

private String _getTitleElementId(AbstractElementInfo<?> abstractElement, String relationType){
  List<YRelation> relations = abstractElement.getRelations();
  for(YRelation relation: relations){
    if(relationType.equals(relation.getType())){
      return relation.getTarget().getValue();
    }
  }
  return "";
}

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

@Override
  void compare(YElement expected, YElement actual, EvalResult result) {
    Map<String, YId> actYIdMap = new HashMap<String, YId>();
    for (YId yid : actual.getIds()) {
      String scheme = yid.getScheme();
      actYIdMap.put(scheme, yid);
    }
    for (YId yid : expected.getIds()) {
      String scheme = yid.getScheme();
      if (actYIdMap.containsKey(scheme)) {
        if (yid.getValue().equals(actYIdMap.get(scheme).getValue())) {
          result.append(scheme, ResultStatus.RECOGNIZED, 1);
        } else {
          result.append(scheme, ResultStatus.FAILED, 1);
        }
        actYIdMap.remove(scheme);
      } else {
        result.append(scheme, ResultStatus.FAILED, 1);
      }
    }
    for (String scheme : actYIdMap.keySet()) {
      result.append(scheme, ResultStatus.REDUNDANT, 1);
    }
  }
},

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

/**
 * If yelement has EXT_SCHEME_ZBL than id is generated from that. Otherwise
 * UUID is used.
 * 
 * @param yelement
 * @return
 */
private static String generateUidOfZblId(YElement yelement, String prefix) {
  if (yelement.getIds() == null || yelement.getIds().size() <= 0) {
    return UUID.randomUUID().toString();
  }
  for (YId yid : yelement.getIds()) {
    if (yid.getScheme().equals(YConstants.EXT_SCHEME_ZBL)) {
      return "urn:zbl:" + prefix + yid.getValue();
    }
  }
  return UUID.randomUUID().toString();
  // throw new TransformationException("No valid yId found!");
}

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

@Override
protected String buildLink(ElementMetadata metadata) {
  YElement element = (YElement) metadata.getContent();
  Map<String, String> parameters = new HashMap<String, String>();
  for (YId id : element.getIds()) {
    parameters.put(id.getScheme(), id.getValue());
  }
  for (String requiredParameter : requiredParameters) {
    if (!parameters.containsKey(requiredParameter)) {
      return null;
    }
  }
  return StrSubstitutor.replace(pattern, parameters);
}

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

/**
 * Takes all ISSNs in yelement and fixes up formatting.
 * 
 * @param yelement
 */
private void reformatIssns(YElement yelement) {
  for (YId id : yelement.getIds()) {
    if (id.getScheme().equals(YConstants.EXT_SCHEME_ISSN)) {
      String formattedIssn = ZentralBlattConverterTools.formatIssn(id.getValue());
      id.setValue(formattedIssn);
    }
  }
}

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

protected List<ViewIdentifier> prepareIdentifiers(YElement element,
    IFilteringContext filteringContext) {
  List<ViewIdentifier> res = new ArrayList<ViewIdentifier>();
  for (YId id: element.getIds()) {
    String idClassExtId = id.getScheme();
    
    // exclude
    if ("bwmeta1.id-class.BazTech".equalsIgnoreCase(idClassExtId)) {
      continue;
    }
    
    String className = resolveIdentifierName(idClassExtId);
    if (className == null) {
      className = idClassExtId;
    }
    String filteredClass = detailsFilter.filter(className, InputType.IDENTIFIER, filteringContext);
    String filteredId = detailsFilter.filter(id.getValue(), InputType.PLAIN_TEXT, filteringContext);
    String referenceUrl = idUrlResolvers.containsKey(idClassExtId)
        ? idUrlResolvers.get(idClassExtId).resolveUrl(id.getValue())
        : null;
    ViewIdentifier viewIdentifier = new ViewIdentifier(filteredClass, filteredId, referenceUrl);
    res.add(viewIdentifier);
  }
  return res;
  
}

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

protected void fillIdentifiers(HtmlMetaHeaders metadata, YElement yElement) {
  YStructure yStructure = yElement.getStructure(YaddaIdConstants.ID_HIERARACHY_JOURNAL);
  if (yStructure != null) {
    YAncestor yAncestor = yStructure.getAncestor(YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL);
    if (yAncestor != null) {
      for (YId journalYId : yAncestor.getIds()) {
        if (YaddaIdConstants.IDENTIFIER_CLASS_ISSN.equals(journalYId.getScheme())) {
          metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_IDENTIFIER, "ISSN " + journalYId.getValue());
        }
      }
    }
  }
  for (YId yId : yElement.getIds()) {
    if (IdSchemaIds.EXT_SCHEME_DOI.equals(yId.getScheme())) {
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_IDENTIFIER, "DOI " + yId.getValue());
    } else if (IdSchemaIds.EXT_SCHEME_ISBN.equals(yId.getScheme())) {
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_IDENTIFIER, "ISBN " + yId.getValue());
    } else {
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_IDENTIFIER, yId.getValue());
    }
  }
}

代码示例来源: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.synat/synat-portal-core

protected void fillRelations(HtmlMetaHeaders metadata, YElement yElement) {
  for (YRelation yRelation : yElement.getRelations()) {
    if (yRelation.getTarget() != null) {
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_RELATION, yRelation.getTarget().getValue());
    }
  }
}

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

private ElementAncestors<YElement> setJournalIdsInOrigSequence(ElementAncestors<YElement> yElemAncest) throws ModelDataSourceException {
  Ancestor journal = yElemAncest.getAncestors().getAncestorAtLevel(YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL);
  if (journal != null) {
    YElement journalYElem= dataSourcesFactory.getYCatalogDataSource().getElementById(journal.getExtid());
    // Keep ids original order, it decides on citation styling @see YElemToCSLItemConverter
    LinkedHashMap<String, String> idsSorted = new LinkedHashMap<>();
    for (YId yId : journalYElem.getIds()) {
      idsSorted.put(yId.getScheme(), yId.getValue());
    }
    journal.setAdditionalIdentifiers(idsSorted);
  }
  return yElemAncest;
}

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

@Override
protected Object buildElementViewPart(YExportable exp,
    String[] elementTags, Map<String, Object> additionalParameters,
    IFilteringContext filteringContext) {
  YElement element = (YElement) exp;
  List<ViewReference> partModel = new LinkedList<ViewReference>();
  for (YRelation ref : element.getRelations(YConstants.RL_REFERENCE_TO)) {
    String id;
    if (ref.getTarget() != null) {
      id = detailsFilter.filter(ref.getTarget().getValue(),
          InputType.IDENTIFIER, filteringContext);
    } else {
      id = null;
    }
    
    YAttribute attribute = ref.getOneAttribute(YConstants.AT_REFERENCE_TEXT);
    String cite = getXMLFragmentFrom(attribute);
    
    partModel.add(new ViewReference(null,
        cite != null ? detailsFilter.filter(cite,
            InputType.RICH_TEXT, filteringContext) : null, id));
  }
  return partModel;
}

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

private List<DocReference> referencesFromYElement(final YElement element) {
  final List<DocReference> references = new ArrayList<DocReference>();
  for (final YRelation ref : element.getRelations(YConstants.RL_REFERENCE_TO)) {
    final DocReference reference = new DocReference();
    final List<DocId> matches = new ArrayList<DocId>();
    final YId target = ref.getTarget();
    if (target != null && YConstants.EXT_SCHEME_YADDA.equals(target.getScheme())) {
      final String extId = target.getValue();
      matches.add(new DocId(MetadataIndexConstants.D_EXTID, extId));
    }
    reference.setMatches(matches);
    final YAttribute refText = ref.getOneAttribute(YConstants.AT_REFERENCE_TEXT);
    if (refText != null) {
      final String text = refText.getValue();
      reference.setText(text);
      final DocReference parsed = referenceParser.parse(text);
      if (parsed != null && parsed.getParsed() != null) {
        reference.setParsed(parsed.getParsed());
      }
    }
    references.add(reference);
    // TODO What to do with URL references
  }
  return references;
}

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