[][src]Crate obofoundry

Structures to deserialize OBO Foundry listings into.

TravisCI Codecov License Source Crate Documentation Changelog

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 reqwest;
extern crate serde_yaml;
use std::io::Read;

const URL: &'static str = "http://www.obofoundry.org/registry/ontologies.yml";

fn main() {

    let mut res = reqwest::get(URL).expect("could not get YAML file");
    let mut yml = String::new();
    res.read_to_string(&mut yml).expect("could not read response");

    let foundry: obofoundry::Foundry = serde_yaml::from_str(&yml).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

Browser

A reference to a browser for the ontology.

Build

Information about the way an ontology is built.

Contact

The corresponding editor of an ontology.

Dependency

Reference to a particular dependency.

Development

Metadata concerning the development of the ontology.

Example

A reference to an example usage of the ontology.

Foundry

An index of ontologies following the OBO Foundry principles.

Job

A CI/CD job pipeline running for the ontology.

License

The legal information about an ontology.

Ontology

A comprehensive table of informations about an ontology.

Product

A released product of an ontology.

Publication

A publication relevant to the ontology.

Redirect

A redirection to another location.

Taxon

A taxon specifically relevant to the ontology.

Usage

A relevant project an ontology is used in.

Enums

ActivityStatus

The current development status of the ontology development.

BuildMethod

The build method for an ontology build.

BuildSystem

The build system for an ontology build.

JobType

The type of a job pipeline.

UsageType

The way an ontology can be used in a project.