} else {
Resource indexRoot = graph.syncRequest(new PossibleIndexRoot(resource));
try {
if(indexRoot != null && graph.isInstanceOf(indexRoot, L0.Ontology)) {
TransferableGraph1 tg = ModelingUtils.exportSharedOntology(graph, indexRoot, null, Constants.SHARED_LIBRARY_FORMAT, Constants.SHARED_LIBRARY_CURRENT_VERSION);
GraphRefactoringUtils.fixOntologyExport(tg);
} else {
Resource indexRoot = graph.syncRequest(new PossibleIndexRoot(resource));
try {
if(indexRoot != null && graph.isInstanceOf(indexRoot, L0.Ontology)) {
TransferableGraph1 tg = ModelingUtils.exportSharedOntology(graph, indexRoot, null, Constants.SHARED_LIBRARY_FORMAT, Constants.SHARED_LIBRARY_CURRENT_VERSION);
GraphRefactoringUtils.fixOntologyExport(tg);