fastobo-owl 0.1.2

OWL language mapping for ontologies in the OBO flat file format 1.4
Documentation
use fastobo::ast as obo;
use horned_owl::model as owl;

use super::Context;
use super::IntoOwlCtx;
use crate::constants::property;

impl IntoOwlCtx for obo::Definition {
    type Owl = owl::AnnotatedAxiom;
    fn into_owl(mut self, ctx: &mut Context) -> Self::Owl {
        let xrefs = std::mem::take(self.xrefs_mut());
        owl::AnnotatedAxiom::new(
            owl::AnnotationAssertion::new(
                owl::Individual::from(&ctx.current_frame),
                owl::Annotation {
                    ap: ctx.build.annotation_property(property::iao::DEFINITION),
                    av: owl::AnnotationValue::Literal(owl::Literal::Simple {
                        literal: self.text().as_str().to_string(),
                    }),
                },
            ),
            xrefs.into_owl(ctx),
        )
    }
}