#obo #ontology #syntax #parser #obofoundry


PEG Syntax and pest parser for the OBO flat file format 1.4

11 releases

✓ Uses Rust 2018 edition

0.3.8 Jan 23, 2020
0.3.6 Oct 5, 2019
0.3.3 Jul 23, 2019
0.1.0 Mar 31, 2019

#5 in #syntax

Download history 38/week @ 2020-03-03 33/week @ 2020-03-10 76/week @ 2020-03-17 55/week @ 2020-03-24 29/week @ 2020-03-31 96/week @ 2020-04-07 86/week @ 2020-04-14 61/week @ 2020-04-21 32/week @ 2020-04-28 80/week @ 2020-05-05 94/week @ 2020-05-12 40/week @ 2020-05-19 88/week @ 2020-05-26 51/week @ 2020-06-02 505/week @ 2020-06-09 78/week @ 2020-06-16

320 downloads per month
Used in 3 crates (via fastobo)

MIT license

400 lines

fastobo-syntax Star me

PEG Syntax and pest parser for the OBO flat file format 1.4

TravisCI Codecov License Source Crate Documentation Changelog GitHub issues DOI


This library is a strict implementation of the OBO flat file format 1.4 syntax using the pest parser generator. It was outsourced from fastobo to reduce compilation time, since deriving the OboParser from grammar.pest takes some time.

The parser itself is reexported in fastobo::parser, so there is probably no need to depend on this crate directly.


The syntax is a strict implementation of the 1.4 format, with the following exceptions:

  • property_value clauses can have a value with is not quote-enclosed. This is a workaround to support some ontology files using obo2owl or the owlapi to generate their OBO counterpart, which does not quote-enclose property values (owlcs/owlapi#833).
  • ISO-8601 datetimes can only be parsed from the canonical format (ỲYYY-MM-DDTHH:MM:SS) with an optional timezone. Week dates and calendar dates are not supported.

See also

  • fastobo: Abstract Syntax Tree and data structures for the OBO format version 1.4.
  • fastobo-py: Idiomatic Python bindings to the fastobo crate.


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


This project was developed by Martin Larralde as part of a Master's Degree internship in the BBOP team of the Lawrence Berkeley National Laboratory, under the supervision of Chris 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)


~40K SLoC