/** * Adds the ontology annotation. * * @param annotation the annotation */ protected void addOntologyAnnotation(OWLAnnotation annotation) { ontology.applyChange(new AddOntologyAnnotation(ontology, annotation)); }
/** * Adds the ontology annotation. * * @param annotation the annotation */ protected void addOntologyAnnotation(OWLAnnotation annotation) { ontology.applyChange(new AddOntologyAnnotation(ontology, annotation)); }
/** * Adds the import. * * @param declaration the declaration */ protected void addImport(OWLImportsDeclaration declaration) { ontology.applyChange(new AddImport(ontology, declaration)); }
/** * Adds the ontology annotation. * * @param annotation the annotation */ protected void addOntologyAnnotation(OWLAnnotation annotation) { ontology.applyChange(new AddOntologyAnnotation(ontology, annotation)); }
/** * Adds the import. * * @param declaration the declaration */ protected void addImport(OWLImportsDeclaration declaration) { ontology.applyChange(new AddImport(ontology, declaration)); }
/** * Adds the ontology annotation. * * @param annotation the annotation */ protected void addOntologyAnnotation(OWLAnnotation annotation) { ontology.applyChange(new AddOntologyAnnotation(ontology, annotation)); }
/** * Adds the import. * * @param declaration the declaration */ protected void addImport(OWLImportsDeclaration declaration) { ontology.applyChange(new AddImport(ontology, declaration)); }
/** * Adds the import. * * @param declaration the declaration */ protected void addImport(OWLImportsDeclaration declaration) { ontology.applyChange(new AddImport(ontology, declaration)); }
@Override void handleChild(AnnEH h) { OWLOntology o = handler.getOntology(); o.applyChange(new AddOntologyAnnotation(o, h.getOWLObject())); }
@Override void handleChild(AnnEH h) { OWLOntology o = handler.getOntology(); o.applyChange(new AddOntologyAnnotation(o, h.getOWLObject())); }
@Override void handleChild(AnnEH h) { OWLOntology o = handler.getOntology(); o.applyChange(new AddOntologyAnnotation(o, h.getOWLObject())); }
@Override void handleChild(AnnEH h) { OWLOntology o = handler.getOntology(); o.applyChange(new AddOntologyAnnotation(o, h.getOWLObject())); }
@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 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 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 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 void attribute(String localName, String value) { OWLOntology o = handler.getOntology(); if ("ontologyIRI".equals(localName)) { o.applyChange(new SetOntologyID(o, new OWLOntologyID(optional(IRI.create(value)), o.getOntologyID().getVersionIRI()))); } if ("versionIRI".equals(localName)) { o.applyChange(new SetOntologyID(o, new OWLOntologyID(o.getOntologyID().getOntologyIRI(), optional(IRI.create(value))))); } }
@Override void attribute(String localName, String value) { OWLOntology o = handler.getOntology(); if ("ontologyIRI".equals(localName)) { o.applyChange(new SetOntologyID(o, new OWLOntologyID(optional(IRI.create(value)), o.getOntologyID().getVersionIRI()))); } if ("versionIRI".equals(localName)) { o.applyChange(new SetOntologyID(o, new OWLOntologyID(o.getOntologyID().getOntologyIRI(), optional(IRI.create(value))))); } }
@Override void attribute(String localName, String value) { OWLOntology o = handler.getOntology(); if ("ontologyIRI".equals(localName)) { o.applyChange(new SetOntologyID(o, new OWLOntologyID(optional(IRI.create(value)), o.getOntologyID().getVersionIRI()))); } if ("versionIRI".equals(localName)) { o.applyChange(new SetOntologyID(o, new OWLOntologyID(o.getOntologyID().getOntologyIRI(), optional(IRI.create(value))))); } }
@Override void attribute(String localName, String value) { OWLOntology o = handler.getOntology(); if ("ontologyIRI".equals(localName)) { o.applyChange(new SetOntologyID(o, new OWLOntologyID(optional(IRI.create(value)), o.getOntologyID().getVersionIRI()))); } if ("versionIRI".equals(localName)) { o.applyChange(new SetOntologyID(o, new OWLOntologyID(o.getOntologyID().getOntologyIRI(), optional(IRI.create(value))))); } }