UphenoOboParser.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:boqa 作者:
/**
 * Parse OBO file into {@link UphenoOntology} object.
 *
 * @return {@link UphenoOntology} from parsing OBO file.
 * @throws IOException In case of problems with file I/O.
 */
@SuppressWarnings("unchecked")
public UphenoOntology parse() throws IOException {
  final OboImmutableOntologyLoader<UphenoTerm, UphenoTermRelation> loader =
      new OboImmutableOntologyLoader<>(oboFile, debug);
  final UphenoOboFactory factory = new UphenoOboFactory();
  final ImmutableOntology<UphenoTerm, UphenoTermRelation> o = loader.load(factory);

  // Convert ImmutableOntology into UberphenoOntology. The casts here are ugly and require the
  // @SuppressWarnings above but this saves us one factory layer of indirection.
  return new UphenoOntology((ImmutableSortedMap<String, String>) o.getMetaInfo(),
      (ImmutableDirectedGraph<TermId, ImmutableEdge<TermId>>) o.getGraph(), o.getRootTermId(),
      o.getNonObsoleteTermIds(), o.getObsoleteTermIds(),
      (ImmutableMap<TermId, UphenoTerm>) o.getTermMap(),
      (ImmutableMap<Integer, UphenoTermRelation>) o.getRelationMap());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号