gpt4 book ai didi

org.obolibrary.oboformat.model.Xref.getIdref()方法的使用及代码示例

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

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

Xref.getIdref介绍

暂无

代码示例

代码示例来源:origin: net.sourceforge.owlapi/oboformat-included-owlapi

public int compare(Xref x1, Xref x2) {
    String idref1 = x1.getIdref();
    String idref2 = x2.getIdref();
    if (idref1 == null && idref2 == null) {
      return 0;
    }
    if (idref1 == null) {
      return -1;
    }
    if (idref2 == null) {
      return 1;
    }
    return idref1.compareToIgnoreCase(idref2);
  }
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-oboformat

@Override
  public int compare(@Nullable Xref o1, @Nullable Xref o2) {
    String idref1 = checkNotNull(o1).getIdref();
    String idref2 = checkNotNull(o2).getIdref();
    return idref1.compareToIgnoreCase(idref2);
  }
}

代码示例来源:origin: owlcs/owlapi

@Override
  public int compare(@Nullable Xref o1, @Nullable Xref o2) {
    String idref1 = checkNotNull(o1).getIdref();
    String idref2 = checkNotNull(o2).getIdref();
    return idref1.compareToIgnoreCase(idref2);
  }
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-distribution

@Override
  public int compare(@Nullable Xref o1, @Nullable Xref o2) {
    String idref1 = checkNotNull(o1).getIdref();
    String idref2 = checkNotNull(o2).getIdref();
    return idref1.compareToIgnoreCase(idref2);
  }
}

代码示例来源:origin: owlcs/owlapi

@Nullable
protected String handleXref(String id, @Nullable String matchingExpandedId,
  @Nullable Xref xref) {
  if (xref != null) {
    String xid = xref.getIdref();
    if (xid.equals(id)) {
      return matchingExpandedId;
    }
    if (matchingExpandedId == null) {
      return xid;
    }
    // RO and BFO take precedence over others
    if (xid.startsWith("RO") || xid.startsWith("BFO")) {
      return xid;
    }
  }
  return matchingExpandedId;
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-osgidistribution

@Override
  public int compare(@Nullable Xref o1, @Nullable Xref o2) {
    String idref1 = checkNotNull(o1).getIdref();
    String idref2 = checkNotNull(o2).getIdref();
    return idref1.compareToIgnoreCase(idref2);
  }
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-distribution

@Nullable
protected String handleXref(String id, @Nullable String matchingExpandedId,
  @Nullable Xref xref) {
  if (xref != null) {
    String xid = xref.getIdref();
    if (xid.equals(id)) {
      return matchingExpandedId;
    }
    if (matchingExpandedId == null) {
      return xid;
    }
    // RO and BFO take precedence over others
    if (xid.startsWith("RO") || xid.startsWith("BFO")) {
      return xid;
    }
  }
  return matchingExpandedId;
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-oboformat

@Nullable
protected String handleXref(String id, @Nullable String matchingExpandedId,
  @Nullable Xref xref) {
  if (xref != null) {
    String xid = xref.getIdref();
    if (xid.equals(id)) {
      return matchingExpandedId;
    }
    if (matchingExpandedId == null) {
      return xid;
    }
    // RO and BFO take precedence over others
    if (xid.startsWith("RO") || xid.startsWith("BFO")) {
      return xid;
    }
  }
  return matchingExpandedId;
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-osgidistribution

/**
 * @param obj the obj
 * @return toString representation
 */
private static String toStringRepresentation(@Nullable Object obj) {
  if (obj == null) {
    return "";
  }
  if (obj instanceof Xref) {
    Xref xref = (Xref) obj;
    return xref.getIdref() + ' ' + xref.getAnnotation();
  }
  if (obj instanceof String) {
    return (String) obj;
  }
  return obj.toString();
}

代码示例来源:origin: net.sourceforge.owlapi/oboformat-included-owlapi

private String toStringRepresentation(Object obj) {
    String s = null;
    if (obj != null) {
      if (obj instanceof Xref) {
        Xref xref = (Xref) obj;
        s = xref.getIdref()+" "+xref.getAnnotation();
      }
      else if (obj instanceof String) {
        s = (String) obj;
      }
      else {
        s = obj.toString();
      }
    }
    return s;
  }
}

代码示例来源:origin: owlcs/owlapi

/**
 * @param obj the obj
 * @return toString representation
 */
private static String toStringRepresentation(@Nullable Object obj) {
  if (obj == null) {
    return "";
  }
  if (obj instanceof Xref) {
    Xref xref = (Xref) obj;
    return xref.getIdref() + ' ' + xref.getAnnotation();
  }
  if (obj instanceof String) {
    return (String) obj;
  }
  return obj.toString();
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-distribution

/**
 * @param obj the obj
 * @return toString representation
 */
private static String toStringRepresentation(@Nullable Object obj) {
  if (obj == null) {
    return "";
  }
  if (obj instanceof Xref) {
    Xref xref = (Xref) obj;
    return xref.getIdref() + ' ' + xref.getAnnotation();
  }
  if (obj instanceof String) {
    return (String) obj;
  }
  return obj.toString();
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-oboformat

/**
 * @param obj the obj
 * @return toString representation
 */
private static String toStringRepresentation(@Nullable Object obj) {
  if (obj == null) {
    return "";
  }
  if (obj instanceof Xref) {
    Xref xref = (Xref) obj;
    return xref.getIdref() + ' ' + xref.getAnnotation();
  }
  if (obj instanceof String) {
    return (String) obj;
  }
  return obj.toString();
}

代码示例来源:origin: net.sourceforge.owlapi/oboformat-included-owlapi

protected OWLAnnotationValue trLiteral(Object value) {
  if (value instanceof Xref) {
    value = ((Xref)value).getIdref();
  }
  else if (value instanceof Date) {
    // use proper OWL2 data type, write lexical value as ISO 8601 date string 
    String lexicalValue = Obo2OWLConstants.OWL2_DATE_LITERAL_FORMAT.get().format((Date)value);
    return fac.getOWLLiteral(lexicalValue, OWL2Datatype.XSD_DATE_TIME);
  }
  else if (value instanceof Boolean) {
    return fac.getOWLLiteral((Boolean)value);
  }
  else if (! (value instanceof String)) {
    // TODO
    // e.g. boolean
    value = value.toString();
  }
  //System.out.println("v="+value);
  return fac.getOWLLiteral((String)value); // TODO
}

代码示例来源:origin: net.sourceforge.owlapi/oboformat-included-owlapi

public void expandXrefs() {
  for (Frame f : sourceOBODoc.getTermFrames()) {
    String id = f.getTagValue(OboFormatTag.TAG_ID, String.class);
    Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF);
    for (Clause c : clauses) {
      Xref x = c.getValue(Xref.class);
      if (x != null) {
        String xid = x.getIdref();
        String s = getIDSpace(xid);
        if (treatMap.containsKey(s)) {
          treatMap.get(s).expand(f, id, xid);
        }
      }
    }
  }
}

代码示例来源:origin: owlcs/owlapi

/**
 * Expand xrefs.
 */
public void expandXrefs() {
  for (Frame f : sourceOBODoc.getTermFrames()) {
    String id = checkNotNull(f.getTagValue(OboFormatTag.TAG_ID, String.class));
    Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF);
    for (Clause c : clauses) {
      Xref x = c.getValue(Xref.class);
      String xid = x.getIdref();
      String s = getIDSpace(xid);
      if (treatMap.containsKey(s)) {
        treatMap.get(s).expand(f, id, xid);
      }
    }
  }
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-distribution

/**
 * Expand xrefs.
 */
public void expandXrefs() {
  for (Frame f : sourceOBODoc.getTermFrames()) {
    String id = checkNotNull(f.getTagValue(OboFormatTag.TAG_ID, String.class));
    Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF);
    for (Clause c : clauses) {
      Xref x = c.getValue(Xref.class);
      String xid = x.getIdref();
      String s = getIDSpace(xid);
      if (treatMap.containsKey(s)) {
        treatMap.get(s).expand(f, id, xid);
      }
    }
  }
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-osgidistribution

/**
 * Expand xrefs.
 */
public void expandXrefs() {
  for (Frame f : sourceOBODoc.getTermFrames()) {
    String id = checkNotNull(f.getTagValue(OboFormatTag.TAG_ID, String.class));
    Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF);
    for (Clause c : clauses) {
      Xref x = c.getValue(Xref.class);
      String xid = x.getIdref();
      String s = getIDSpace(xid);
      if (treatMap.containsKey(s)) {
        treatMap.get(s).expand(f, id, xid);
      }
    }
  }
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-oboformat

/**
 * Expand xrefs.
 */
public void expandXrefs() {
  for (Frame f : sourceOBODoc.getTermFrames()) {
    String id = checkNotNull(f.getTagValue(OboFormatTag.TAG_ID, String.class));
    Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF);
    for (Clause c : clauses) {
      Xref x = c.getValue(Xref.class);
      String xid = x.getIdref();
      String s = getIDSpace(xid);
      if (treatMap.containsKey(s)) {
        treatMap.get(s).expand(f, id, xid);
      }
    }
  }
}

代码示例来源:origin: owlcs/owlapi

/**
 * See section "header macros" and treat-xrefs-as-equivalent.
 *
 * @param id the id
 * @return mapped id
 */
protected String mapPropId(String id) {
  Frame f = obodoc.getTypedefFrame(id);
  if (f != null) {
    Collection<Xref> xrefs = f.getTagValues(OboFormatTag.TAG_XREF, Xref.class);
    for (Xref x : xrefs) {
      String xid = x.getIdref();
      if (OBODoc.isTreatXrefsAsEquivalent(getIdPrefix(xid))) {
        return xid;
      }
    }
  }
  return id;
}

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