Examples of containsAxiom()


Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

    @Test
    public void testOntologyContainsPlainAxiom() {
        OWLAxiom axiom = SubClassOf(Class(iri("A")), Class(iri("B")));
        OWLOntology ont = getOWLOntology("testont");
        ont.getOWLOntologyManager().addAxiom(ont, axiom);
        assertTrue(ont.containsAxiom(axiom));
        assertTrue(ont.containsAxiom(axiom, EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
    }

    @Test
    public void testOntologyContainsAnnotatedAxiom() {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

    public void testOntologyContainsPlainAxiom() {
        OWLAxiom axiom = SubClassOf(Class(iri("A")), Class(iri("B")));
        OWLOntology ont = getOWLOntology("testont");
        ont.getOWLOntologyManager().addAxiom(ont, axiom);
        assertTrue(ont.containsAxiom(axiom));
        assertTrue(ont.containsAxiom(axiom, EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
    }

    @Test
    public void testOntologyContainsAnnotatedAxiom() {
        OWLLiteral annoLiteral = Literal("value");
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

        OWLAnnotation anno = Annotation(annoProp, annoLiteral);
        OWLAxiom axiom = SubClassOf(Class(iri("A")), Class(iri("B")),
                singleton(anno));
        OWLOntology ont = getOWLOntology("testont");
        ont.getOWLOntologyManager().addAxiom(ont, axiom);
        assertTrue(ont.containsAxiom(axiom));
        assertTrue(ont.containsAxiom(axiom, EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
        assertFalse(ont.containsAxiom(axiom.getAxiomWithoutAnnotations()));
        assertTrue(ont.containsAxiom(axiom.getAxiomWithoutAnnotations(),
                EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

        OWLAxiom axiom = SubClassOf(Class(iri("A")), Class(iri("B")),
                singleton(anno));
        OWLOntology ont = getOWLOntology("testont");
        ont.getOWLOntologyManager().addAxiom(ont, axiom);
        assertTrue(ont.containsAxiom(axiom));
        assertTrue(ont.containsAxiom(axiom, EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
        assertFalse(ont.containsAxiom(axiom.getAxiomWithoutAnnotations()));
        assertTrue(ont.containsAxiom(axiom.getAxiomWithoutAnnotations(),
                EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

                singleton(anno));
        OWLOntology ont = getOWLOntology("testont");
        ont.getOWLOntologyManager().addAxiom(ont, axiom);
        assertTrue(ont.containsAxiom(axiom));
        assertTrue(ont.containsAxiom(axiom, EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
        assertFalse(ont.containsAxiom(axiom.getAxiomWithoutAnnotations()));
        assertTrue(ont.containsAxiom(axiom.getAxiomWithoutAnnotations(),
                EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
    }

    @Test
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

        OWLOntology ont = getOWLOntology("testont");
        ont.getOWLOntologyManager().addAxiom(ont, axiom);
        assertTrue(ont.containsAxiom(axiom));
        assertTrue(ont.containsAxiom(axiom, EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
        assertFalse(ont.containsAxiom(axiom.getAxiomWithoutAnnotations()));
        assertTrue(ont.containsAxiom(axiom.getAxiomWithoutAnnotations(),
                EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
    }

    @Test
    public void testOntologyContainsAxiomsForRDFXML1() throws Exception {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

    }

    @Test
    public void shouldRoundTripAnnotation() throws Exception {
        OWLOntology ontology = createOntology();
        assertTrue(ontology.containsAxiom(axiom));
        ontology = loadOntologyFromString(saveOntology(ontology));
        assertTrue(ontology.containsAxiom(axiom));
    }

    public OWLOntology createOntology() throws OWLOntologyCreationException {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

    @Test
    public void shouldRoundTripAnnotation() throws Exception {
        OWLOntology ontology = createOntology();
        assertTrue(ontology.containsAxiom(axiom));
        ontology = loadOntologyFromString(saveOntology(ontology));
        assertTrue(ontology.containsAxiom(axiom));
    }

    public OWLOntology createOntology() throws OWLOntologyCreationException {
        OWLOntology ontology = m.createOntology(IRI(NS));
        List<AddAxiom> changes = new ArrayList<>();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

        OWLOntology ontology = createOntology();
        OWLNamedIndividual subject = NamedIndividual(IRI("http://Example.com#myBuilding"));
        OWLObjectProperty predicate = ObjectProperty(IRI("http://Example.com#located_at"));
        OWLNamedIndividual object = NamedIndividual(IRI("http://Example.com#myLocation"));
        OWLAxiom ax = ObjectPropertyAssertion(predicate, subject, object);
        assertTrue(ontology.containsAxiom(ax, EXCLUDED,
                AxiomAnnotations.IGNORE_AXIOM_ANNOTATIONS));
        Set<OWLAxiom> axioms = ontology
                .getAxiomsIgnoreAnnotations(ax, EXCLUDED);
        assertEquals(1, axioms.size());
        OWLAxiom theAxiom = axioms.iterator().next();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntology.containsAxiom()

        // when
        addAxioms(wrongAxiom, validAxiom);
        OWLOntology reloaded = saveAndReload();
        // then
        assertNotNull(reloaded);
        assertTrue(reloaded.containsAxiom(validAxiom));
        assertFalse(reloaded.containsAxiom(wrongAxiom));
        assertEquals(1, reloaded.getLogicalAxiomCount());
    }

    @Test
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.