Search in sources :

Example 1 with BinaryOWLOntologyDocumentFormat

use of org.semanticweb.binaryowl.owlapi.BinaryOWLOntologyDocumentFormat in project webprotege by protegeproject.

the class WebProtegeOntologyManagerSaveBinaryDocumentTestCase method shouldSaveOntologyToBinaryDocumentFile.

/**
 * Ensures that an ontology can be saved in the binary ontology format.  This doesn't test the format serialization,
 * it tests that the {@link WebProtegeOWLManager} is configured
 * with the ability to save an ontology in that format.
 */
@Test
public void shouldSaveOntologyToBinaryDocumentFile() throws OWLOntologyCreationException, OWLOntologyStorageException {
    OWLOntologyManager manager = WebProtegeOWLManager.createOWLOntologyManager();
    OWLOntology ontology = manager.createOntology();
    BinaryOWLOntologyDocumentFormat format = new BinaryOWLOntologyDocumentFormat();
    manager.saveOntology(ontology, format, IRI.create(ontologyDocumentFile));
}
Also used : BinaryOWLOntologyDocumentFormat(org.semanticweb.binaryowl.owlapi.BinaryOWLOntologyDocumentFormat) Test(org.junit.Test)

Example 2 with BinaryOWLOntologyDocumentFormat

use of org.semanticweb.binaryowl.owlapi.BinaryOWLOntologyDocumentFormat in project webprotege by protegeproject.

the class ProjectDocumentStore method writeNewProject.

private void writeNewProject(OWLOntologyManager rootOntologyManager, OWLOntology ontology) throws OWLOntologyStorageException {
    rootOntologyDocument.getParentFile().mkdirs();
    rootOntologyManager.saveOntology(ontology, new BinaryOWLOntologyDocumentFormat(), IRI.create(rootOntologyDocument));
    ImportsCacheManager cacheManager = importsCacheManagerProvider.get();
    cacheManager.cacheImports(ontology);
}
Also used : BinaryOWLOntologyDocumentFormat(org.semanticweb.binaryowl.owlapi.BinaryOWLOntologyDocumentFormat)

Example 3 with BinaryOWLOntologyDocumentFormat

use of org.semanticweb.binaryowl.owlapi.BinaryOWLOntologyDocumentFormat in project webprotege by protegeproject.

the class ProjectImporter method writeNewProject.

private void writeNewProject(OWLOntologyManager rootOntologyManager, OWLOntology ontology) throws OWLOntologyStorageException {
    rootOntologyDocument.getParentFile().mkdirs();
    rootOntologyManager.saveOntology(ontology, new BinaryOWLOntologyDocumentFormat(), IRI.create(rootOntologyDocument));
    ImportsCacheManager importsCacheManager = new ImportsCacheManager(projectId, new ImportsCacheDirectoryProvider(new ProjectDirectoryProvider(new ProjectDirectoryFactory(dataDirectory), projectId)));
    importsCacheManager.cacheImports(ontology);
}
Also used : BinaryOWLOntologyDocumentFormat(org.semanticweb.binaryowl.owlapi.BinaryOWLOntologyDocumentFormat)

Aggregations

BinaryOWLOntologyDocumentFormat (org.semanticweb.binaryowl.owlapi.BinaryOWLOntologyDocumentFormat)3 Test (org.junit.Test)1