Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Faultless AST for Open Biomedical Ontologies.

License

NotificationsYou must be signed in to change notification settings

fastobo/fastobo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Faultless AST for Open Biomedical Ontologies.

ActionsCodecovLicenseSourceCrateDocumentationChangelogGitHub issuesDOI

Overview

This library provides a mostly-complete implementation of theOBO flat file format 1.4.

  • Data structures -fastobo provides a complete owned AST for theOBO language, with constructors and covenience traits where applicable.There is a plan to provide borrowed data structures as well, to be ableto build a view of an OBO document from borrowed data.
  • Parsing - The parser is implemented usingpest,and is reexported from thefastobo-syntaxcrate. Most structures implement theFromPairtrait which allows to build a data structure from a stream of pest tokens.
  • Errors - All functions in that crate that return aResult willalways use theError struct defined in theerror module. Errorsreported by pest are very meaningful, and can give the exact locationof a syntax error encountered by the parser.
  • Semantics - This library exports specific methods that can be usedto edit an OBO syntax tree with the semantics expected in the formatguide: mapping identifiers to URLs, adding default namespaces, orexpanding entity frames usingtreat-xrefs macros.

Warning: this project adheres toSemantic Versioning,but the API is likely to change a lot before the release of a stable 1.0.

Features

All the following features are enabled by default, but can be disabled andcherry-picked using thedefault-features = false option in theCargo.tomlmanifest of your project:

  • memchr - Use thememchr library to improveparser speed when searching for a particular character in a buffer.
  • threading - Use a multi-threaded parser (additionally depending oncrossbeam-channel), which can greatlyimprove the parser speed if parsing is CPU-bound.
  • smartstring - Use thesmartstringlibrary to reduce heap allocation for identifiers and string data.

Usage

Addfastobo to the[dependencies] sections of yourCargo.toml manifest:

[dependencies]fastobo ="0.15.2"

The top-levelfastobo module provides several functions to parse anOboDoc.Usefastobo::from_reader to load an OBO document from aBufRead implementor(usestd::io::BufReaderif needed):

externcrate fastobo;externcrate ureq;fnmain(){letmut response = ureq::get("http://purl.obolibrary.org/obo/ms.obo").call().unwrap();letmut reader = std::io::BufReader::new(response.body_mut().as_reader());match fastobo::from_reader(&mut reader){Ok(doc) =>println!("Number of MS entities: {}", doc.entities().len()),Err(e) =>panic!("Could not parse the Mass-Spec Ontology: {}", e),}}

See also

  • fastobo-syntax: Standalonepest parserfor the OBO format version 1.4.
  • fastobo-graphs: Data model andserdeimplementation of the OBO graphs specification, with conversion traits from and to OBO.
  • fastobo-py: Idiomatic Python bindings tothis crate.
  • fastobo-validator: Standalone CLIto validate OBO files against the specification.
  • horned-functional: Parser forOWL2 Functional Syntax (can be used to parseowl-axioms clauses).

Feedback

Found a bug ? Have an enhancement request ? Head over to theGitHub issue tracker of the project ifyou need to report or ask something. If you are filling in on a bug, please include as muchinformation as you can about the issue, and try to recreate the same bug in a simple, easilyreproducible situation.

About

This project was developed byMartin Larraldeas part of a Master's Degree internship in theBBOP team of theLawrence Berkeley National Laboratory, under the supervision ofChris Mungall. Cite this project as:

Larralde M.Developing Python and Rust libraries to improve the ontology ecosystem[version 1; not peer reviewed]. F1000Research 2019, 8(ISCB Comm J):1500 (poster)(https://doi.org/10.7490/f1000research.1117405.1)


[8]ページ先頭

©2009-2025 Movatter.jp