Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLOntologyManager


    public void testNegativeObjectPropertyAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLObjectProperty prop = ObjectProperty(iri("prop"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLNamedIndividual indB = NamedIndividual(iri("indB"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLNegativeObjectPropertyAssertionAxiom ax = NegativeObjectPropertyAssertion(
                prop, indA, indB);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getNegativeObjectPropertyAssertionAxioms(indA).contains(
                ax));
        assertTrue(ont.getAxioms(indA, EXCLUDED).contains(ax));
    }
View Full Code Here


    public void testDataPropertyAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLLiteral lit = Literal(3);
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLDataPropertyAssertionAxiom ax = DataPropertyAssertion(prop, indA,
                lit);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getDataPropertyAssertionAxioms(indA).contains(ax));
        assertTrue(ont.getAxioms(indA, EXCLUDED).contains(ax));
    }
View Full Code Here

    public void testNegativeDataPropertyAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLLiteral lit = Literal(3);
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLNegativeDataPropertyAssertionAxiom ax = NegativeDataPropertyAssertion(
                prop, indA, lit);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getNegativeDataPropertyAssertionAxioms(indA)
                .contains(ax));
        assertTrue(ont.getAxioms(indA, EXCLUDED).contains(ax));
    }
View Full Code Here

    public void testSameIndividualAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLNamedIndividual indB = NamedIndividual(iri("indB"));
        OWLNamedIndividual indC = NamedIndividual(iri("indC"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLSameIndividualAxiom ax = SameIndividual(indA, indB, indC);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getSameIndividualAxioms(indA).contains(ax));
        assertTrue(ont.getSameIndividualAxioms(indB).contains(ax));
        assertTrue(ont.getSameIndividualAxioms(indC).contains(ax));
        assertTrue(ont.getAxioms(indA, EXCLUDED).contains(ax));
View Full Code Here

    public void testDifferentIndividualsAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLNamedIndividual indB = NamedIndividual(iri("indB"));
        OWLNamedIndividual indC = NamedIndividual(iri("indC"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLDifferentIndividualsAxiom ax = DifferentIndividuals(indA, indB, indC);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getDifferentIndividualAxioms(indA).contains(ax));
        assertTrue(ont.getDifferentIndividualAxioms(indB).contains(ax));
        assertTrue(ont.getDifferentIndividualAxioms(indC).contains(ax));
        assertTrue(ont.getAxioms(indA, EXCLUDED).contains(ax));
View Full Code Here

    private static final OWLDataFactory DF = OWLManager.getOWLDataFactory();
    @Nonnull
    private static final OWLObjectProperty P = ObjectProperty(IRI("urn:test#objectproperty"));

    public void declare(@Nonnull OWLOntology o, @Nonnull OWLEntity... entities) {
        OWLOntologyManager m = o.getOWLOntologyManager();
        for (OWLEntity e : entities) {
            assert e != null;
            m.addAxiom(o, Declaration(e));
        }
    }
View Full Code Here

    @Test
    @Tests(method = "public Object visit(OWLDatatype datatype)")
    public void shouldCreateViolationForOWLDatatypeInOWL2DLProfile()
            throws Exception {
        OWLOntology o = createOnto();
        OWLOntologyManager m = o.getOWLOntologyManager();
        declare(o, UNKNOWNFAKEDATATYPE, FAKEDATATYPE,
                Class(FAKEDATATYPE.getIRI()), DATAP);
        m.addAxiom(o, DataPropertyRange(DATAP, FAKEUNDECLAREDDATATYPE));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 1;
        Class[] expectedViolations = { UseOfUndeclaredDatatype.class };
        runAssert(o, profile, expected, expectedViolations);
    }
View Full Code Here

    @Tests(method = "public Object visit(OWLDatatypeDefinitionAxiom axiom)")
    public void
            shouldCreateViolationForOWLDatatypeDefinitionAxiomInOWL2DLProfile()
                    throws Exception {
        OWLOntology o = createOnto();
        OWLOntologyManager m = o.getOWLOntologyManager();
        declare(o, Integer(), Boolean(), FAKEDATATYPE);
        m.addAxiom(o, DatatypeDefinition(Boolean(), Integer()));
        m.addAxiom(o, DatatypeDefinition(FAKEDATATYPE, Integer()));
        m.addAxiom(o, DatatypeDefinition(Integer(), FAKEDATATYPE));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 4;
        Class[] expectedViolations = { CycleInDatatypeDefinition.class,
                CycleInDatatypeDefinition.class,
                UseOfBuiltInDatatypeInDatatypeDefinition.class,
View Full Code Here

    public
            void
            shouldCreateViolationForOWLDatatypeDefinitionAxiomInOWL2DLProfileCycles()
                    throws Exception {
        OWLOntology o = createOnto();
        OWLOntologyManager m = o.getOWLOntologyManager();
        OWL2DLProfile profile = new OWL2DLProfile();
        OWLDatatype d = Datatype(IRI(START + "test"));
        declare(o, d, Integer(), Boolean(), FAKEDATATYPE);
        m.addAxiom(o, DatatypeDefinition(d, Boolean()));
        m.addAxiom(o, DatatypeDefinition(Boolean(), d));
        m.addAxiom(o, DatatypeDefinition(FAKEDATATYPE, Integer()));
        m.addAxiom(o, DatatypeDefinition(Integer(), FAKEDATATYPE));
        int expected = 9;
        Class[] expectedViolations = { CycleInDatatypeDefinition.class,
                CycleInDatatypeDefinition.class,
                CycleInDatatypeDefinition.class,
                CycleInDatatypeDefinition.class,
View Full Code Here

    @Test
    @Tests(method = "public Object visit(OWLObjectProperty property)")
    public void shouldCreateViolationForOWLObjectPropertyInOWL2DLProfile()
            throws Exception {
        OWLOntology o = createOnto();
        OWLOntologyManager m = o.getOWLOntologyManager();
        IRI iri = IRI(START + "test");
        declare(o, ObjectProperty(iri), DataProperty(iri),
                AnnotationProperty(iri));
        m.addAxiom(o, SubObjectPropertyOf(OP, ObjectProperty(iri)));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 4;
        Class[] expectedViolations = {
                UseOfReservedVocabularyForObjectPropertyIRI.class,
                UseOfUndeclaredObjectProperty.class, IllegalPunning.class,
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLOntologyManager

Copyright © 2018 www.massapicom. 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.