Package org.obolibrary.obo2owl

Source Code of org.obolibrary.obo2owl.GCIQualifierTest

package org.obolibrary.obo2owl;

import static org.junit.Assert.*;

import java.util.Collection;
import java.util.Set;

import org.junit.Test;
import org.obolibrary.oboformat.model.Clause;
import org.obolibrary.oboformat.model.Frame;
import org.obolibrary.oboformat.model.OBODoc;
import org.obolibrary.oboformat.parser.OBOFormatConstants.OboFormatTag;
import org.semanticweb.owlapi.model.AxiomType;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLSubClassOfAxiom;

/** @author cjm see 5.9.3 and 8.2.2 of spec */
@SuppressWarnings({ "javadoc", "null" })
public class GCIQualifierTest extends OboFormatTestBasics {

    @Test
    public void testConvert() {
        // PARSE TEST FILE, CONVERT TO OWL, AND WRITE TO OWL FILE
        OWLOntology ontology = convert(parseOBOFile("gci_qualifier_test.obo"));
        Set<OWLSubClassOfAxiom> scas = ontology
                .getAxioms(AxiomType.SUBCLASS_OF);
        boolean ok = !scas.isEmpty();
        assertTrue(ok);
        // CONVERT BACK TO OBO
        OBODoc obodoc = convert(ontology);
        // test that relation IDs are converted back to symbolic form
        Frame tf = obodoc.getTermFrame("X:1");
        Collection<Clause> clauses = tf
                .getClauses(OboFormatTag.TAG_RELATIONSHIP);
        assertEquals(2, clauses.size());
    }
}
TOP

Related Classes of org.obolibrary.obo2owl.GCIQualifierTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.