obofoundry.rs
Structures to deserialize [OBO Foundry] listings into.
Add the obofoundry
crate to the Cargo.toml
manifest, as well as either
serde_yaml
or serde_json
:
toml
[dependencies]
obofoundry = "0.7"
serde_yaml = "0.8"
Then use the serde
framework to load the listings:
```rust extern crate obofoundry; extern crate serde_yaml;
let yamldata = includestr!("..."); let foundry: obofoundry::Foundry = serdeyaml::fromstr(&yml).unwrap(); ```
It's also possible to use an HTTP library to load the listings from the OBO Foundry
website directly, for instance using ureq
:
```rust extern crate obofoundry; extern crate ureq; extern crate serde_yaml;
let url = "http://www.obofoundry.org/registry/ontologies.yml";
let res = ureq::get(url).call(); let reader = res.intoreader(); let foundry: obofoundry::Foundry = serdeyaml::from_reader(reader).unwrap(); ```
See the online documentation at docs.rs
for more examples.
This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.