Examples of OWLOntology


Examples of org.semanticweb.owlapi.model.OWLOntology

            @Nonnull IRI iri, int superClassLevel, int subClassLevel,
            OWLReasoner reasoner, boolean verbose)
            throws OWLOntologyCreationException {
        Set<OWLAxiom> axs = extract(signature, superClassLevel, subClassLevel,
                reasoner, verbose);
        OWLOntology newOnt = manager.createOntology(iri);
        LinkedList<AddAxiom> addaxs = new LinkedList<>();
        for (OWLAxiom ax : axs) {
            assert ax != null;
            addaxs.add(new AddAxiom(newOnt, ax));
        }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

    }

    @Nonnull
    protected OWLOntology getOntologyWithPunnedInvalidDeclarations()
            throws OWLOntologyCreationException {
        OWLOntology o = m.createOntology(IRI
                .create("urn:forbiddenPunningNotRedeclared"));
        OWLObjectProperty op = df.getOWLObjectProperty(iri("testProperty"));
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testProperty"));
        m.addAxiom(o, df.getOWLDeclarationAxiom(op));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

    }

    @Nonnull
    protected OWLOntology getOntologyWithMissingDeclarations()
            throws OWLOntologyCreationException {
        OWLOntology o = m.createOntology(IRI.create("urn:missingDeclarations"));
        OWLObjectProperty op = df
                .getOWLObjectProperty(iri("testObjectProperty"));
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testAnnotationProperty"));
        m.addAxiom(o, df.getOWLTransitiveObjectPropertyAxiom(op));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

    }

    @Test
    public void shouldNotAddDeclarationsForIllegalPunnings()
            throws OWLOntologyCreationException, OWLOntologyStorageException {
        OWLOntology o = getOntologyWithPunnedInvalidDeclarations();
        OWLOntology reloaded = roundTrip(o, format);
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testProperty"));
        OWLDeclarationAxiom ax = df.getOWLDeclarationAxiom(ap);
        assertFalse("ap testProperty should not have been declared",
                reloaded.containsAxiom(ax));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

    }

    @Test
    public void shouldDeclareMissingEntities()
            throws OWLOntologyCreationException, OWLOntologyStorageException {
        OWLOntology o = getOntologyWithMissingDeclarations();
        OWLOntology reloaded = roundTrip(o, format);
        OWLObjectProperty op = df
                .getOWLObjectProperty(iri("testObjectProperty"));
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testAnnotationProperty"));
        assertTrue(reloaded.containsAxiom(df.getOWLDeclarationAxiom(ap)));
        assertTrue(reloaded.containsAxiom(df.getOWLDeclarationAxiom(op)));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

        // create minimal ontology
        OBODoc oboDocSource = parseOBOFile("roundtrip_cardinality.obo");
        // convert to OWL and retrieve def
        OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(
                OWLManager.createOWLOntologyManager());
        OWLOntology owlOntology = bridge.convert(oboDocSource);
        OWLDataFactory factory = owlOntology.getOWLOntologyManager()
                .getOWLDataFactory();
        OWLClass c = factory.getOWLClass(bridge.oboIdToIRI("PR:000027136"));
        // Relations
        boolean foundRel1 = false;
        boolean foundRel2 = false;
        Set<OWLSubClassOfAxiom> axioms = owlOntology
                .getSubClassAxiomsForSubClass(c);
        assertEquals(3, axioms.size());
        for (OWLSubClassOfAxiom axiom : axioms) {
            OWLClassExpression superClass = axiom.getSuperClass();
            if (superClass instanceof OWLObjectExactCardinality) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

@SuppressWarnings({ "javadoc", "null" })
public class DanglingRoundTripTest extends OboFormatTestBasics {

    @Test
    public void testConvertXPs() throws Exception {
        OWLOntology owlOnt = convertOBOFile("dangling_roundtrip_test.obo");
        OWLAPIOwl2Obo revbridge = new OWLAPIOwl2Obo(
                OWLManager.createOWLOntologyManager());
        OBODoc d2 = revbridge.convert(owlOnt);
        Frame f = d2.getTermFrame("UBERON:0000020");
        Clause rc = f.getClause(OboFormatTag.TAG_NAME);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

        roundTripOBOFile("multiple_def_xref_test.obo", true);
    }

    @Test
    public void testDefinitions() {
        OWLOntology owlOnt = convertOBOFile("multiple_def_xref_test.obo");
        int n = 0;
        for (OWLAxiom ax : owlOnt.getAxioms()) {
            // System.out.println(ax);
            for (OWLAnnotation ann : ax.getAnnotations()) {
                OWLAnnotationProperty p = ann.getProperty();
                if (p.getIRI()
                        .equals(IRI
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

@SuppressWarnings("javadoc")
public class XrefIRITest extends OboFormatTestBasics {

    @Test
    public void testConversion() throws Exception {
        OWLOntology ontology = parseOWLFile("xrefIRItest.owl");
        OBODoc doc = convert(ontology);
        doc.getTermFrame("FOO:1");
        writeOBO(doc);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology

        roundTripOBOFile("version_iri_test.obo", true);
    }

    @Test
    public void testConvert() {
        OWLOntology owlOnt = convertOBOFile("version_iri_test.obo");
        assertNotNull(owlOnt);
        IRI v = owlOnt.getOntologyID().getVersionIRI().get();
        assertEquals("http://purl.obolibrary.org/obo/go/2012-01-01/go.owl",
                v.toString());
    }
View Full Code Here
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.