Examples of checkOntology()


Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

    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

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

    @Test
    public void shouldFindViolation() throws Exception {
        String input = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" ><owl:Ontology rdf:about=\"\"/>\n<owl:Class rdf:about=\"http://phenomebrowser.net/cellphenotype.owl#C3PO:000000015\"><rdf:Description rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">Any.</rdf:Description></owl:Class></rdf:RDF>";
        OWLOntology o = loadOntologyFromString(input);
        OWL2DLProfile p = new OWL2DLProfile();
        OWLProfileReport checkOntology = p.checkOntology(o);
        assertEquals(2, checkOntology.getViolations().size());
        OWLProfileViolation v = checkOntology.getViolations().get(0);
        assertTrue(v instanceof UseOfUndeclaredAnnotationProperty
                || v instanceof UseOfReservedVocabularyForAnnotationPropertyIRI);
        v = checkOntology.getViolations().get(1);
View Full Code Here

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

                + "<owl:onProperty rdf:resource=\"http://www.co-ode.org/ontologies/galen#hasQuantity\"/>\n"
                + "<owl:someValuesFrom><owl:Class rdf:about=\"http://www.co-ode.org/ontologies/galen#anotherTest\"/></owl:someValuesFrom>\n"
                + "</owl:Restriction></rdfs:subClassOf></owl:Class></rdf:RDF>";
        OWLOntology o = loadOntologyFromString(test);
        OWL2DLProfile profile = new OWL2DLProfile();
        OWLProfileReport report = profile.checkOntology(o);
        assertTrue(report.isInProfile());
    }

    @Test
    public void testOWLEL() throws OWLOntologyCreationException {
View Full Code Here

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

        assertTrue(manager.isLessThan(brother, uncle));
        assertTrue(manager.isLessThan(uncle, brother));
        assertTrue(manager.isLessThan(brother, brother));
        assertTrue(manager.isLessThan(uncle, uncle));
        OWL2DLProfile profile = new OWL2DLProfile();
        List<OWLProfileViolation> violations = profile.checkOntology(o)
                .getViolations();
        assertFalse(violations.isEmpty());
        for (OWLProfileViolation v : violations) {
            assertTrue(brokenAxiom1.equals(v.getAxiom())
                    || brokenAxiom2.equals(v.getAxiom()));
View Full Code Here

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

        OWLObjectPropertyManager manager = new OWLObjectPropertyManager(
                o.getOWLOntologyManager(), o);
        o.getOWLOntologyManager().addAxiom(o, brokenAxiom1);
        assertTrue(manager.isLessThan(brother, uncle));
        OWL2DLProfile profile = new OWL2DLProfile();
        List<OWLProfileViolation> violations = profile.checkOntology(o)
                .getViolations();
        assertTrue(violations.isEmpty());
        for (OWLProfileViolation v : violations) {
            assertEquals(brokenAxiom1, v.getAxiom());
        }
View Full Code Here

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

            throws OWLOntologyCreationException {
        OWLOntology o = OWLManager.createOWLOntologyManager()
                .loadOntologyFromOntologyDocument(
                        new ByteArrayInputStream(input1.getBytes()));
        OWL2DLProfile profile = new OWL2DLProfile();
        List<OWLProfileViolation> violations = profile.checkOntology(o)
                .getViolations();
        assertTrue(violations.isEmpty());
    }

    @Test
View Full Code Here

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

            throws OWLOntologyCreationException {
        OWLOntology o = OWLManager.createOWLOntologyManager()
                .loadOntologyFromOntologyDocument(
                        new ByteArrayInputStream(input2.getBytes()));
        OWL2DLProfile profile = new OWL2DLProfile();
        List<OWLProfileViolation> violations = profile.checkOntology(o)
                .getViolations();
        assertTrue(violations.isEmpty());
    }
}
View Full Code Here

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

    }
  }
 
  private String getOWL2DLProfileViolations( OWLOntology ontology ) {
    OWL2DLProfile owl2Profile = new OWL2DLProfile();
    OWLProfileReport profileReport = owl2Profile.checkOntology( ontology );
   
    if( profileReport.isInProfile() ) {
      return "No OWL 2 DL violations found for ontology " + ontology.getOntologyID().toString();
    }
   
View Full Code Here

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

    }
  }
 
  private String getOWL2DLProfileViolations( OWLOntology ontology ) {
    OWL2DLProfile owl2Profile = new OWL2DLProfile();
    OWLProfileReport profileReport = owl2Profile.checkOntology( ontology );
   
    if( profileReport.isInProfile() ) {
      return "No OWL 2 DL violations found for ontology " + ontology.getOntologyID().toString();
    }
   
View Full Code Here

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile.checkOntology()

  public void testCorrectOntology() throws OWLOntologyCreationException {
    OWLOntology ontology = OWL.manager.loadOntologyFromOntologyDocument(new File("test/data/misc/agencies.owl"));
   
    try {
      OWL2DLProfile owl2Profile = new OWL2DLProfile();
      assertTrue( owl2Profile.checkOntology( ontology ).isInProfile() );     
    }
    finally {
      OWL.manager.removeOntology(ontology);
    }
  }
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.