Package org.semanticweb.owlapi.profiles

Examples of org.semanticweb.owlapi.profiles.OWL2DLProfile


    private static OWLProfileReport rl(OWLOntology in) {
        return new OWL2RLProfile().checkOntology(in);
    }

    private static OWLProfileReport dl(OWLOntology in) {
        return new OWL2DLProfile().checkOntology(in);
    }
View Full Code Here


    @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

                + "<rdfs:subClassOf><owl:Restriction>\n"
                + "<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());
    }
View Full Code Here

        o.getOWLOntologyManager().addAxiom(o, brokenAxiom2);
        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

                        CollectionFactory.list(father, brother), uncle);
        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

    public void shouldNotCauseViolationsInput1()
            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());
    }
View Full Code Here

    public void shouldNotCauseViolationsInput2()
            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

    }
  }
 
  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

    }
  }
 
  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

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

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.