Crate obofoundry
source ·Expand description
Structures to deserialize OBO Foundry listings into.
This library provides structs that can make use of serde_yaml
and
serde_json
to deserialize the table of ontologies provided by the
OBO Foundry. It provides a safe and efficient alternative to manually
parsing the obtained JSON/YAML, which is actually quite tricky since
there is no actual scheme available. Use the Foundry
type as an entry point for deserialization.
Example
Download the ontologies.yml
table from the OBO Foundry and use it to
extract all PURLs to ontologies in the OBO format:
extern crate obofoundry;
extern crate ureq;
extern crate serde_yaml;
use std::io::Read;
const URL: &'static str = "http://www.obofoundry.org/registry/ontologies.yml";
fn main() {
let res = ureq::get(URL).call();
let reader = res.unwrap().into_reader();
let foundry: obofoundry::Foundry = serde_yaml::from_reader(reader).unwrap();
for ontology in &foundry.ontologies {
for product in &ontology.products {
if product.id.ends_with(".obo") {
println!("{} - {}", product.id, product.ontology_purl)
}
}
}
}
Changelog
This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.
Structs
A reference to a browser for the ontology.
Information about the way an ontology is built.
The corresponding editor of an ontology.
Reference to a particular dependency.
Metadata concerning the development of the ontology.
A review document.
A reference to an example usage of the ontology.
An index of ontologies following the OBO Foundry principles.
A funding reference.
A CI/CD job pipeline running for the ontology.
The legal information about an ontology.
A comprehensive table of informations about an ontology.
A released product of an ontology.
A publication relevant to the ontology.
A redirection to another location.
A review for a particular ontology.
A taxon specifically relevant to the ontology.
A relevant project an ontology is used in.
Enums
The current development status of the ontology development.
The build method for an ontology build.
The build system for an ontology build.
The type of a job pipeline.
The way an ontology can be used in a project.