23 releases

0.8.1 Feb 28, 2024
0.7.4 Dec 5, 2022
0.7.3 Mar 4, 2022
0.6.2 Sep 28, 2020
0.1.0 Mar 31, 2019

#621 in Parser implementations

Download history 9/week @ 2024-07-20 188/week @ 2024-07-27 12/week @ 2024-08-03 14/week @ 2024-08-10 4/week @ 2024-08-17 1/week @ 2024-08-24 16/week @ 2024-09-07 7/week @ 2024-09-14 53/week @ 2024-09-21 18/week @ 2024-09-28 5/week @ 2024-10-05 8/week @ 2024-10-12 26/week @ 2024-10-26 34/week @ 2024-11-02

69 downloads per month
Used in 5 crates (via fastobo)

MIT license

30KB
470 lines

fastobo-syntax Star me

PEG Syntax and pest lexer for the OBO flat file format 1.4.

Actions TravisCI License Source Crate Documentation Changelog GitHub issues DOI

Overview

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 OboLexer from grammar.pest takes some time.

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

Strictness

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 (YYYY-MM-DDTHH:MM:SS) with an optional timezone. Week dates and calendar dates are not supported.
  • Dates in creation_date clauses can be either full ISO-8601 datetimes (as recommended by the format 1.4 specifications) or simply ISO-8601 dates, which is suggested by the format 1.4 guide (albeit non-normative).

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.

Feedback

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.

About

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. Please 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)

Dependencies

~2–2.8MB
~56K SLoC