| Crates.io | obographs-dev |
| lib.rs | obographs-dev |
| version | 0.2.2 |
| created_at | 2025-02-13 13:42:11.415639+00 |
| updated_at | 2025-02-13 17:00:41.223715+00 |
| description | Load Obographs data files. |
| homepage | https://github.com/ielis/obographs-dev |
| repository | https://github.com/ielis/obographs-dev |
| max_upload_size | |
| id | 1554223 |
| size | 19,944,662 |
Crate with definitions of Obographs types and I/O functions.
Obographs-dev is deployed on crates.io, so including in a project is really easy.
Just add the following into your Cargo.toml file:
obographs-dev = "0.2.1"
Note: Check
crates.iofor the latest version and update0.2.1accordingly.
The Obographs elements can be created programatically.
For instance, the [obographs::model::Edge] can be created as:
use obographs_dev::model::*;
let edge = Edge {
sub: String::from("http://purl.obolibrary.org/obo/HP_0001250"),
pred: String::from("is_a"),
obj: String::from("http://purl.obolibrary.org/obo/HP_0012638"),
meta: None,
};
The serde feature is enabled by default,
to support reading a JSON file into a [obographs::model::GraphDocument]:
use obographs_dev::model::GraphDocument;
let toy_hpo_json = "tests/test_data/hp.mini.json";
let graph_document = GraphDocument::from_path(toy_hpo_json).expect("Read graph document from file path");
assert_eq!(graph_document.graphs.len(), 1);
Run the unit, integration, and documentation tests with:
cargo test
The benchmarks can be run with:
cargo bench
The implementation of the Obographs model is INCOMPLETE. Attributes and components may be missing.