/** http://www.w3.org/ns/owl-profile/DL. **/ OWL2_DL ("DL", FaCTPlusPlus, HermiT, JFact, TrOWL, Pellet, MORe){ @Override public OWLProfile getOWLProfile() { return new OWL2DLProfile();} }, /** http://www.w3.org/ns/owl-profile/QL. **/ OWL2_QL ("QL", FaCTPlusPlus, HermiT, JFact, TrOWL, Pellet, MORe){ @Override public OWLProfile getOWLProfile() { return new OWL2QLProfile();} },
/** http://www.w3.org/ns/owl-profile/DL. **/ OWL2_DL ("DL", FaCTPlusPlus, HermiT, JFact, TrOWL, Pellet, MORe){ @Override public OWLProfile getOWLProfile() { return new OWL2DLProfile();} }, /** http://www.w3.org/ns/owl-profile/QL. **/ OWL2_QL ("QL", FaCTPlusPlus, HermiT, JFact, TrOWL, Pellet, MORe){ @Override public OWLProfile getOWLProfile() { return new OWL2QLProfile();} },
/** http://www.w3.org/ns/owl-profile/DL. **/ OWL2_DL ("DL", FaCTPlusPlus, HermiT, JFact, TrOWL, Pellet, MORe){ @Override public OWLProfile getOWLProfile() { return new OWL2DLProfile();} }, /** http://www.w3.org/ns/owl-profile/QL. **/ OWL2_QL ("QL", FaCTPlusPlus, HermiT, JFact, TrOWL, Pellet, MORe){ @Override public OWLProfile getOWLProfile() { return new OWL2QLProfile();} },
private OWLProfile getSelectedProfile() { if (owl2Button.isSelected()){ return new OWL2Profile(); } else if (owlDLButton.isSelected()){ return new OWL2DLProfile(); } else if (elPPButton.isSelected()){ return new OWL2ELProfile(); } return null; } }
private OWLProfile getSelectedProfile() { if (owl2Button.isSelected()){ return new OWL2Profile(); } else if (owlDLButton.isSelected()){ return new OWL2DLProfile(); } else if (elPPButton.isSelected()){ return new OWL2ELProfile(); } return null; } }
private OWLProfile getSelectedProfile() { if (owl2Button.isSelected()){ return new OWL2Profile(); } else if (owlDLButton.isSelected()){ return new OWL2DLProfile(); } else if (elPPButton.isSelected()){ return new OWL2ELProfile(); } return null; } }
private OWLProfile getSelectedProfile() { if (owl2Button.isSelected()){ return new OWL2Profile(); } else if (owlDLButton.isSelected()){ return new OWL2DLProfile(); } else if (elPPButton.isSelected()){ return new OWL2ELProfile(); } return null; } }
private String getOWL2DLProfileViolations(final OWLOntology ontology) { final OWL2DLProfile owl2Profile = new OWL2DLProfile(); final OWLProfileReport profileReport = owl2Profile.checkOntology(ontology); if (profileReport.isInProfile()) return "No OWL 2 DL violations found for ontology " + ontology.getOntologyID().toString(); final StringBuffer result = new StringBuffer(); result.append("\n=========================================================\n"); result.append("OWL 2 DL violations found for ontology ").append(ontology.getOntologyID().toString()).append(":\n"); for (final OWLProfileViolation violation : profileReport.getViolations()) { result.append(violation.toString()); result.append("\n"); } return result.toString(); }
/** * Check OWL2DL profile. * * @param directOntology the direct ontology * @throws Exception the exception */ public static void checkOWL2DLProfile(OWLOntology directOntology) throws Exception { // // Compliance testing - OWL 2 DL // OWL2DLProfile profile = new OWL2DLProfile(); OWLProfileReport report = profile.checkOntology(directOntology); if (!report.isInProfile()) { boolean flag = false; for (OWLProfileViolation violation : report.getViolations()) { // Allow violation: Use of undeclared annotation property if (violation.toString().indexOf( "Use of undeclared annotation property") == -1) { flag = true; break; } } if (flag) { throw new Exception("OWL is not in expected profile OWL DL 2 - " + report); } } }
public OWLProfileReport checkOntology(OWLOntology ontology) { this.ont = ontology; OWL2DLProfile profile = new OWL2DLProfile(); OWLProfileReport report = profile.checkOntology(ontology); Set<OWLProfileViolation> violations = new HashSet<OWLProfileViolation>(); violations.addAll(report.getViolations()); OWLOntologyWalker ontologyWalker = new OWLOntologyWalker(ontology.getImportsClosure()); OWL2ELProfileObjectVisitor visitor = new OWL2ELProfileObjectVisitor(ontologyWalker, ontology.getOWLOntologyManager()); ontologyWalker.walkStructure(visitor); violations.addAll(visitor.getProfileViolations()); return new OWLProfileReport(this, violations); }
/** * Checks an ontology and its import closure to see if it is within * this profile. * @param ontology The ontology to be checked. * @return An <code>OWLProfileReport</code> that describes whether or not the * ontology is within this profile. */ public OWLProfileReport checkOntology(OWLOntology ontology) { OWL2DLProfile profile = new OWL2DLProfile(); OWLProfileReport report = profile.checkOntology(ontology); Set<OWLProfileViolation> violations = new HashSet<OWLProfileViolation>(); violations.addAll(report.getViolations()); OWLOntologyWalker walker = new OWLOntologyWalker(ontology.getImportsClosure()); OWL2RLObjectVisitor visitor = new OWL2RLObjectVisitor(walker); walker.walkStructure(visitor); violations.addAll(visitor.getProfileViolations()); return new OWLProfileReport(this, violations); }
/** * Checks an ontology and its import closure to see if it is within * this profile. * @param ontology The ontology to be checked. * @return An <code>OWLProfileReport</code> that describes whether or not the * ontology is within this profile. */ public OWLProfileReport checkOntology(OWLOntology ontology) { OWL2DLProfile profile = new OWL2DLProfile(); OWLProfileReport report = profile.checkOntology(ontology); Set<OWLProfileViolation> violations = new HashSet<OWLProfileViolation>(); violations.addAll(report.getViolations()); OWLOntologyWalker walker = new OWLOntologyWalker(ontology.getImportsClosure()); OWL2QLObjectVisitor visitor = new OWL2QLObjectVisitor(walker); walker.walkStructure(visitor); violations.addAll(visitor.getProfileViolations()); return new OWLProfileReport(this, violations); }
metrics.add(new ProfileMetricCalculator(rootOntology, new OWL2DLProfile())); metrics.add(new ProfileMetricCalculator(rootOntology, new OWL2ELProfile())); metrics.add(new ProfileMetricCalculator(rootOntology, new OWL2QLProfile()));
@Test public void testCorrectOntology() throws OWLOntologyCreationException { final OWLOntology ontology = OWL._manager.loadOntologyFromOntologyDocument(new File("test/data/misc/agencies.owl")); try { final OWL2DLProfile owl2Profile = new OWL2DLProfile(); assertTrue(owl2Profile.checkOntology(ontology).isInProfile()); } finally { OWL._manager.removeOntology(ontology); } }
@Test public void testInvalidTransitivity() throws OWLOntologyCreationException { final OWLOntology ontology = OWL._manager.loadOntologyFromOntologyDocument(new File("test/data/misc/invalidTransitivity.owl")); try { final OWL2DLProfile owl2Profile = new OWL2DLProfile(); assertFalse(owl2Profile.checkOntology(ontology).isInProfile()); } finally { OWL._manager.removeOntology(ontology); } } }
public static void main(String[] args) { try { DefaultPrefixManager pm = new DefaultPrefixManager("http://protege.cim3.net/file/pub/ontologies/tambis/tambis-full.owl#"); SimpleShortFormProvider sfp = new SimpleShortFormProvider(); // SimpleRenderer ren = new SimpleRenderer(); ManchesterOWLSyntaxOWLObjectRendererImpl ren = new ManchesterOWLSyntaxOWLObjectRendererImpl(); ren.setShortFormProvider(sfp); ToStringRenderer.getInstance().setRenderer(ren); OWLOntologyManager man = OWLManager.createOWLOntologyManager(); // OWLOntology ont = man.loadOntologyFromOntologyDocument(URI.create("http://www.co-ode.org/ontologies/pizza/pizza.owl")); OWLOntology ont = man.loadOntologyFromOntologyDocument(IRI.create("http://owl.cs.manchester.ac.uk/repository/download?ontology=http://protege.cim3.net/file/pub/ontologies/tambis/tambis-full.owl&format=RDF/XML")); System.out.println("Loaded ontology"); check(ont, new OWL2Profile()); check(ont, new OWL2DLProfile()); check(ont, new OWL2ELProfile()); check(ont, new OWL2QLProfile()); check(ont, new OWL2RLProfile()); } catch (OWLOntologyCreationException e) { e.printStackTrace(); } }
@Test public void testSuperPropertyTopDataProperty() throws OWLOntologyCreationException { final OWLOntology ontology = OWL._manager.createOntology(); try { final OWLDataProperty property = OWL._factory.getOWLDataProperty(IRI.create("tag:clarkparsia.com,2008:pellint:test:superProperty")); final OWLDataProperty topProperty = OWL._factory.getOWLTopDataProperty(); final OWLAxiom axiom = OWL._factory.getOWLSubDataPropertyOfAxiom(topProperty, property); OWL._manager.addAxiom(ontology, axiom); final OWL2DLProfile owl2Profile = new OWL2DLProfile(); assertFalse(owl2Profile.checkOntology(ontology).isInProfile()); } finally { OWL._manager.removeOntology(ontology); } }