public void setPhysicalURI(OWLOntology ontology, URI physicalURI) { manager.setOntologyDocumentIRI(ontology, IRI.create(physicalURI)); }
@Override public void setOntologyDocumentIRI(OWLOntology ontology, IRI documentIRI) throws UnknownOWLOntologyException { if (sealed) { throw new DocumentIRIChangeNotAllowedException(); } delegate.setOntologyDocumentIRI(ontology, documentIRI); }
public void setPhysicalURI(OWLOntology ontology, URI physicalURI) { manager.setOntologyDocumentIRI(ontology, IRI.create(physicalURI)); }
private static synchronized void cacheOntology(URI physicalRemoteUri, File file, OWLOntology ont) throws UnknownOWLOntologyException, OWLOntologyStorageException { uris.put(physicalRemoteUri, file); oiri.put(physicalRemoteUri, ont.getOntologyID().getOntologyIRI()); manager.setOntologyDocumentIRI(ont, IRI.create(file)); manager.saveOntology(ont, new RDFXMLOntologyFormat(), IRI.create(file)); }
private static synchronized void cacheOntology(URI physicalRemoteUri, File file, OWLOntology ont) throws UnknownOWLOntologyException, OWLOntologyStorageException { uris.put(physicalRemoteUri, file); oiri.put(physicalRemoteUri, ont.getOntologyID().getOntologyIRI()); manager.setOntologyDocumentIRI(ont, IRI.create(file)); manager.saveOntology(ont, new RDFXMLOntologyFormat(), IRI.create(file)); }
reloadingManager.setOntologyDocumentIRI(o, manager.getOntologyDocumentIRI(o)); Set<OWLDeclarationAxiom> axioms = o.getAxioms(AxiomType.DECLARATION); logger.info("Copying {} declaration axioms from {} for reloading", axioms.size(), o.getOntologyID());
reloadingManager.setOntologyDocumentIRI(odecl, manager.getOntologyDocumentIRI(o)); Set<OWLDeclarationAxiom> axioms = o.getAxioms(AxiomType.DECLARATION); logger.info("Copying {} declaration axioms from {} for reloading", axioms.size(), o.getOntologyID());
@Override public void execute() throws OWLServerException, OWLOntologyCreationException, OWLOntologyStorageException, IOException { Client client = getClientRegistry().connectToServer(serverIRI); if (client != null) { OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); RemoteOntologyDocument doc = (RemoteOntologyDocument) client.getServerDocument(serverIRI); VersionedOntologyDocument vont = ClientUtilities.loadOntology(client, manager, doc, revision); IRI ontologyIRI = IRI.create(savedLocation); manager.saveOntology(vont.getOntology(), format, ontologyIRI); System.out.println("Ontology saved to " + savedLocation); manager.setOntologyDocumentIRI(vont.getOntology(), ontologyIRI); if (!vont.saveMetaData()) { System.out.println("Ontology saved but meta data was not included."); } } else { System.out.println("Could not open connection to client"); } }
manager.setOntologyDocumentIRI(outputOntology, IRI.create(rlDocumentIRI));
if (merge) try { root = mgr.createOntology(idd, closure); mgr.setOntologyDocumentIRI(root, location); return root; } catch (OWLOntologyCreationException e1) { mgr.setOntologyDocumentIRI(o1, location); if (idd.equals(id2)) root = o1; } catch (OWLOntologyAlreadyExistsException e) { try { OWLOntology o1 = mgr.createOntology(id2, Collections.singleton(o)); mgr.setOntologyDocumentIRI(o1, location); if (idd.equals(id2)) root = o1; } catch (OWLOntologyCreationException e1) { try { OWLOntology o1 = mgr.createOntology(id2, Collections.singleton(o)); mgr.setOntologyDocumentIRI(o1, location); if (idd.equals(id2)) root = o1; } catch (OWLOntologyCreationException e1) {
if (file != null) { man.setOntologyFormat(ont, format.get()); man.setOntologyDocumentIRI(ont, IRI.create(file)); getModelManager().save(ont); addRecent(file.toURI());
if (file != null) { man.setOntologyFormat(ont, format.get()); man.setOntologyDocumentIRI(ont, IRI.create(file)); getModelManager().save(ont); addRecent(file.toURI());
if (file != null){ man.setOntologyFormat(ont, format); man.setOntologyDocumentIRI(ont, IRI.create(file)); getModelManager().save(ont); addRecent(file.toURI());
public void save(OWLOntology ont) throws OWLOntologyStorageException { final URI documentURI = manager.getOntologyDocumentIRI(ont).toURI(); fireBeforeSaveEvent(ont.getOntologyID(), documentURI); final OWLDocumentFormat format; final OWLDocumentFormat previousFormat = manager.getOntologyFormat(ont); if(previousFormat == null) { format = new RDFXMLDocumentFormat(); logger.info("No document format for {} has been found. " + "Using the {} format.", ont.getOntologyID(), format); } else { format = previousFormat; } /* * Using the addMissingTypes call here for RDF/XML files can result in OWL Full output * and can also result in data corruption. * * See http://protegewiki.stanford.edu/wiki/OWL2RDFParserDeclarationRequirement */ IRI documentIRI = IRI.create(documentURI); OntologySaver saver = OntologySaver.builder().addOntology(ont, format, documentIRI).build(); saver.saveOntologies(); manager.setOntologyDocumentIRI(ont, documentIRI); logger.info("Saved ontology {} to {} in {} format", ont.getOntologyID(), documentIRI, format); dirtyOntologies.remove(ont.getOntologyID()); fireEvent(EventType.ONTOLOGY_SAVED); fireAfterSaveEvent(ont.getOntologyID(), documentURI); }
if (file != null) { man.setOntologyFormat(ont, format); man.setOntologyDocumentIRI(ont, IRI.create(file)); getModelManager().save(ont); addRecent(file.toURI());
saver.saveOntologies(); ensureCatalogFileExists(); manager.setOntologyDocumentIRI(ont, documentIRI); logger.info("Saved ontology {} to {} in {} format", ont.getOntologyID(), documentIRI, format);
outputOntology = inputOntology; if (outputIRI != null) { outputOntology.getOWLOntologyManager().setOntologyDocumentIRI(outputOntology, outputIRI);