Package org.semanticweb.owlapi.profiles

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile


    @Test
    public void testCheckProfile() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = m.createOntology(KOALA_IRI);
        // Available profiles: DL, EL, QL, RL, OWL2 (Full)
        OWL2DLProfile profile = new OWL2DLProfile();
        OWLProfileReport report = profile.checkOntology(o);
        for (OWLProfileViolation v : report.getViolations()) {
            // deal with violations
            System.out.println(v);
        }
    }
View Full Code Here


        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

        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,
                UseOfBuiltInDatatypeInDatatypeDefinition.class };
View Full Code Here

            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()));
View Full Code Here

        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,
                IllegalPunning.class };
View Full Code Here

    @Tests(method = "public Object visit(OWLDataProperty property)")
    public void shouldCreateViolationForOWLDataPropertyInOWL2DLProfile1()
            throws Exception {
        OWLOntology o = createOnto();
        declare(o, DataProperty(IRI(START + "fail")));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 0;
        Class[] expectedViolations = {};
        runAssert(o, profile, expected, expectedViolations);
    }
View Full Code Here

    public void shouldCreateViolationForOWLDataPropertyInOWL2DLProfile2()
            throws Exception {
        OWLOntology o = createOnto();
        OWLOntologyManager m = o.getOWLOntologyManager();
        m.addAxiom(o, FunctionalDataProperty(DATAP));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 1;
        Class[] expectedViolations = { UseOfUndeclaredDataProperty.class };
        runAssert(o, profile, expected, expectedViolations);
    }
View Full Code Here

    @Tests(method = "public Object visit(OWLDataProperty property)")
    public void shouldCreateViolationForOWLDataPropertyInOWL2DLProfile3()
            throws Exception {
        OWLOntology o = createOnto();
        declare(o, DATAP, AnnotationProperty(DATAP.getIRI()));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 0;
        Class[] expectedViolations = {};
        runAssert(o, profile, expected, expectedViolations);
    }
View Full Code Here

    @Tests(method = "public Object visit(OWLDataProperty property)")
    public void shouldCreateViolationForOWLDataPropertyInOWL2DLProfile4()
            throws Exception {
        OWLOntology o = createOnto();
        declare(o, DATAP, ObjectProperty(DATAP.getIRI()));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 0;
        Class[] expectedViolations = {};
        runAssert(o, profile, expected, expectedViolations);
    }
View Full Code Here

                AnnotationProperty(iri));
        m.addAxiom(
                o,
                SubAnnotationPropertyOf(AnnotationProperty(IRI("urn:test#t")),
                        AnnotationProperty(iri)));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 4;
        Class[] expectedViolations = {
                UseOfReservedVocabularyForAnnotationPropertyIRI.class,
                UseOfUndeclaredAnnotationProperty.class, IllegalPunning.class,
                IllegalPunning.class };
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.profiles.OWL2DLProfile

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.