@Override public IRI getIRI() { return Profiles.OWL2_QL.getIRI(); }
/** * Set the types of axioms that are generated by giving an OWL profile. * @param owlProfile the OWL profile */ public void setAxiomTypes(OWLProfile owlProfile) { if(owlProfile.equals(Profiles.OWL2_EL.getOWLProfile())){ } else if(owlProfile.equals(Profiles.OWL2_RL.getOWLProfile())){ } else if(owlProfile.equals(Profiles.OWL2_QL.getOWLProfile())){ } else if(owlProfile.equals(Profiles.OWL2_DL.getOWLProfile())){ } else { throw new IllegalArgumentException("OWL profile " + owlProfile.getName() + " not supported."); } }
@Override public List<OWLOntologyChange> applyChanges(OWLOntology o) { T object = buildObject(); if (!(object instanceof OWLAxiom)) { return Collections.emptyList(); } // create and apply the new change AddAxiom change = new AddAxiom(o, (OWLAxiom) object); o.applyChange(change); // check conformity to the profile OWLProfileReport report = Profiles.OWL2_DL.checkOntology(o); // collect all changes to fix the ontology List<OWLOntologyChange> changes = asList( report.getViolations().stream().flatMap(v -> v.repair().stream())); // fix the ontology o.getOWLOntologyManager().applyChanges(changes); // return all applied changes for reference changes.add(change); return changes; } }
/** * @param i IRI to match * @return Profiles with matching IRI, or null if none is found */ public static Profiles valueForIRI(IRI i) { return Stream.of(values()).filter(p -> p.iri.equals(i)).findAny().orElse(null); }
@Override public String getName() { return getOWLProfile().getName(); }
@Override public List<OWLOntologyChange> applyChanges(OWLOntology o) { T object = buildObject(); if (!(object instanceof OWLAxiom)) { return Collections.emptyList(); } // create and apply the new change AddAxiom change = new AddAxiom(o, (OWLAxiom) object); o.applyChange(change); // check conformity to the profile OWLProfileReport report = Profiles.OWL2_DL.checkOntology(o); // collect all changes to fix the ontology List<OWLOntologyChange> changes = asList( report.getViolations().stream().flatMap(v -> v.repair().stream())); // fix the ontology o.getOWLOntologyManager().applyChanges(changes); // return all applied changes for reference changes.add(change); return changes; } }
/** * @param i IRI to match * @return Profiles with matching IRI, or null if none is found */ public static Profiles valueForIRI(IRI i) { return Stream.of(values()).filter(p -> p.iri.equals(i)).findAny().orElse(null); }
@Override public IRI getIRI() { return Profiles.OWL2_FULL.getIRI(); }
@Override public OWLProfileReport checkOntology(OWLOntology ontology) { return getOWLProfile().checkOntology(ontology); }
@Override public List<OWLOntologyChange> applyChanges(OWLOntology o) { T object = buildObject(); if (!(object instanceof OWLAxiom)) { return Collections.emptyList(); } // create and apply the new change AddAxiom change = new AddAxiom(o, (OWLAxiom) object); o.applyChange(change); // check conformity to the profile OWLProfileReport report = Profiles.OWL2_DL.checkOntology(o); // collect all changes to fix the ontology List<OWLOntologyChange> changes = asList(report.getViolations().stream().flatMap(v -> v.repair().stream())); // fix the ontology o.getOWLOntologyManager().applyChanges(changes); // return all applied changes for reference changes.add(change); return changes; } }
/** * @param i IRI to match * @return Profiles with matching IRI, or null if none is found */ public static Profiles valueForIRI(IRI i) { return Stream.of(values()).filter(p -> p.iri.equals(i)).findAny().orElse(null); }
@Override public IRI getIRI() { return Profiles.OWL2_DL.getIRI(); }
@Override public String getName() { return getOWLProfile().getName(); }
@Override public List<OWLOntologyChange> applyChanges(OWLOntology o) { T object = buildObject(); if (!(object instanceof OWLAxiom)) { return Collections.emptyList(); } // create and apply the new change AddAxiom change = new AddAxiom(o, (OWLAxiom) object); o.applyChange(change); // check conformity to the profile OWLProfileReport report = Profiles.OWL2_DL.checkOntology(o); // collect all changes to fix the ontology List<OWLOntologyChange> changes = asList( report.getViolations().stream().flatMap(v -> v.repair().stream())); // fix the ontology o.getOWLOntologyManager().applyChanges(changes); // return all applied changes for reference changes.add(change); return changes; } }
@Override public IRI getIRI() { return Profiles.OWL2_RL.getIRI(); }
@Override public String getName() { return getOWLProfile().getName(); }
@Override public IRI getIRI() { return Profiles.OWL2_QL.getIRI(); }
@Override public OWLProfileReport checkOntology(OWLOntology ontology) { return getOWLProfile().checkOntology(ontology); }
@Override public IRI getIRI() { return Profiles.OWL2_DL.getIRI(); }
@Override public OWLProfileReport checkOntology(OWLOntology ontology) { return getOWLProfile().checkOntology(ontology); }