robot-core/src/main/java/org/obolibrary/robot/RenameOperation.java
public static void renameFull(
      OWLOntology ontology, IOHelper ioHelper, Map<String, String> mappings) throws Exception {
    OWLOntologyManager manager = ontology.getOWLOntologyManager();
    OWLEntityRenamer entityRenamer = new OWLEntityRenamer(manager, Sets.newHashSet(ontology));
    for (Map.Entry<String, String> mapping : mappings.entrySet()) {
      IRI oldIRI = ioHelper.createIRI(mapping.getKey());
      IRI newIRI = ioHelper.createIRI(mapping.getValue());
      if (!ontology.containsEntityInSignature(oldIRI)) {
        throw new Exception(String.format(missingEntityError, oldIRI.toString()));
      }
      manager.applyChanges(entityRenamer.changeIRI(oldIRI, newIRI));
    }
  }
/**
   * Given an ontology, an IOHelper, and a map of old IRIs to new IRIs, rename each old IRI with the
   * new IRI.
   *
   * @param ontology OWLOntology to rename entities in
   * @param ioHelper IOHelper to create IRIs
   * @param mappings map of old IRI to new IRI
   * @throws Exception if the old IRI in a mapping does not exist
   */
Given an ontology, an IOHelper, and a map of old IRIs to new IRIs, rename each old IRI with the
new IRI.

@param ontology OWLOntology to rename entities in
@param ioHelper IOHelper to create IRIs
@param mappings map of old IRI to new IRI
@throws Exception if the old IRI in a mapping does not exist
Given an ontology an IOHelper and a map of old IRIs to new IRIs rename each old IRI with the new IRI . @param ontology OWLOntology to rename entities in @param ioHelper IOHelper to create IRIs @param mappings map of old IRI to new IRI @throws Exception if the old IRI in a mapping does not exist
public static void renameFull(
      OWLOntology ontology, IOHelper ioHelper, Map<String, String> mappings) throws Exception {
    OWLOntologyManager manager = ontology.getOWLOntologyManager();
    OWLEntityRenamer entityRenamer = new OWLEntityRenamer(manager, Sets.newHashSet(ontology));
    for (Map.Entry<String, String> mapping : mappings.entrySet()) {
      IRI oldIRI = ioHelper.createIRI(mapping.getKey());
      IRI newIRI = ioHelper.createIRI(mapping.getValue());
      if (!ontology.containsEntityInSignature(oldIRI)) {
        throw new Exception(String.format(missingEntityError, oldIRI.toString()));
      }
      manager.applyChanges(entityRenamer.changeIRI(oldIRI, newIRI));
    }
  }
public static void renameFull ( OWLOntology ontology , IOHelper ioHelper , Map < String , String > mappings ) throws Exception { OWLOntologyManager manager = ontology . getOWLOntologyManager ( ) ; OWLEntityRenamer entityRenamer = new OWLEntityRenamer ( manager , Sets . newHashSet ( ontology ) ) ; for ( Map . Entry < String , String > mapping : mappings . entrySet ( ) ) { IRI oldIRI = ioHelper . createIRI ( mapping . getKey ( ) ) ; IRI newIRI = ioHelper . createIRI ( mapping . getValue ( ) ) ; if ( ! ontology . containsEntityInSignature ( oldIRI ) ) { throw new Exception ( String . format ( missingEntityError , oldIRI . toString ( ) ) ) ; } manager . applyChanges ( entityRenamer . changeIRI ( oldIRI , newIRI ) ) ; } }
Given an ontology, an IOHelper, and a map of old IRIs to new IRIs, rename each old IRI with the
 new IRI.
Given an ontology an IOHelper and a map of old IRIs to new IRIs rename each old IRI with the new IRI .