Examples of saveOntology()


Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

        OWLOntologyManager manager = m;
        OWLOntology ontology = manager.createOntology(new OWLOntologyID(
                Optional.of(IRI.create(ontologyByName)), Optional.of(IRI
                        .create(ontologyByVersion))));
        manager.saveOntology(ontology, IRI.create(ontologyByName));
        manager.saveOntology(ontology, IRI.create(ontologyByVersion));
        manager.saveOntology(ontology, IRI.create(ontologyByOtherPath));
        manager = m1;
        OWLDataFactory factory = manager.getOWLDataFactory();
        OWLOntology ontology1 = manager.createOntology(IRI
                .create(importsBothNameAndVersion));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

        OWLOntology ontology = manager.createOntology(new OWLOntologyID(
                Optional.of(IRI.create(ontologyByName)), Optional.of(IRI
                        .create(ontologyByVersion))));
        manager.saveOntology(ontology, IRI.create(ontologyByName));
        manager.saveOntology(ontology, IRI.create(ontologyByVersion));
        manager.saveOntology(ontology, IRI.create(ontologyByOtherPath));
        manager = m1;
        OWLDataFactory factory = manager.getOWLDataFactory();
        OWLOntology ontology1 = manager.createOntology(IRI
                .create(importsBothNameAndVersion));
        OWLOntology ontology2 = manager.createOntology(IRI
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

        changes.add(new AddImport(ontology2, factory
                .getOWLImportsDeclaration(IRI.create(ontologyByName))));
        changes.add(new AddImport(ontology2, factory
                .getOWLImportsDeclaration(IRI.create(ontologyByOtherPath))));
        manager.applyChanges(changes);
        manager.saveOntology(ontology1, IRI.create(importsBothNameAndVersion));
        manager.saveOntology(ontology2, IRI.create(importsBothNameAndOther));
        // when
        OWLOntology o1 = m.loadOntology(IRI.create(importsBothNameAndVersion));
        OWLOntology o2 = m1.loadOntology(IRI.create(importsBothNameAndOther));
        // then
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

                .getOWLImportsDeclaration(IRI.create(ontologyByName))));
        changes.add(new AddImport(ontology2, factory
                .getOWLImportsDeclaration(IRI.create(ontologyByOtherPath))));
        manager.applyChanges(changes);
        manager.saveOntology(ontology1, IRI.create(importsBothNameAndVersion));
        manager.saveOntology(ontology2, IRI.create(importsBothNameAndOther));
        // when
        OWLOntology o1 = m.loadOntology(IRI.create(importsBothNameAndVersion));
        OWLOntology o2 = m1.loadOntology(IRI.create(importsBothNameAndOther));
        // then
        assertNotNull(o1);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        OWLOntology pizzaOntology = loadPizza(manager);
        // Now save a local copy of the ontology. (Specify a path appropriate to
        // your setup)
        File file = folder.newFile("owlapiexamples_saving.owl");
        manager.saveOntology(pizzaOntology, IRI.create(file.toURI()));
        // By default ontologies are saved in the format from which they were
        // loaded. In this case the ontology was loaded from an rdf/xml file We
        // can get information about the format of an ontology from its manager
        OWLDocumentFormat format = manager.getOntologyFormat(pizzaOntology);
        // We can save the ontology in a different format Lets save the ontology
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

        // will copy the prefixes over so that we have nicely abbreviated IRIs
        // in the new ontology document
        if (format.isPrefixOWLOntologyFormat()) {
            owlxmlFormat.copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }
        manager.saveOntology(pizzaOntology, owlxmlFormat,
                IRI.create(file.toURI()));
        // We can also dump an ontology to System.out by specifying a different
        // OWLOntologyOutputTarget Note that we can write an ontology to a
        // stream in a similar way using the StreamOutputTarget class
        // OWLOntologyDocumentTarget documentTarget = new
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

        ManchesterSyntaxDocumentFormat manSyntaxFormat = new ManchesterSyntaxDocumentFormat();
        if (format.isPrefixOWLOntologyFormat()) {
            manSyntaxFormat
                    .copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }
        manager.saveOntology(pizzaOntology, manSyntaxFormat,
                new StreamDocumentTarget(new ByteArrayOutputStream()));
    }

    /**
     * This example shows how to get access to objects that represent entities.
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

                .getOWLDatatypeDefinitionAxiom(concessionaryAgeDatatype,
                        concessionaryAge);
        // Add the definition to our ontology
        manager.addAxiom(ontology, datatypeDef);
        // Dump our ontology
        manager.saveOntology(ontology, new StreamDocumentTarget(
                new ByteArrayOutputStream()));
    }

    /**
     * This example shows how to work with dataranges. OWL 1.1 allows data
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

        // }
        // Now save a copy to another location in OWL/XML format (i.e. disregard
        // the format that the ontology was loaded in).
        File f = folder.newFile("owlapiexample_example1.xml");
        IRI documentIRI2 = IRI.create(f);
        manager.saveOntology(ontology, new OWLXMLDocumentFormat(), documentIRI2);
        // Remove the ontology from the manager
        manager.removeOntology(ontology);
    }

    @Test
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.saveOntology()

        Iterable<OWLClassExpression> superClasses = sup(
                ontology.filterAxioms(Filters.subClassWithSub, clsA, INCLUDED),
                OWLClassExpression.class);
        // Now save the ontology. The ontology will be saved to the location
        // where we loaded it from, in the default ontology format
        manager.saveOntology(ontology);
    }

    /**
     * These examples show how to create new ontologies.
     *
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.