Examples of saveOntology()


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

        m.saveOntology(o, new OWLXMLDocumentFormat(), documentIRI2);
        // save in RDF/XML
        m.saveOntology(o, documentIRI2);
        // print out the ontology
        StringDocumentTarget target = new StringDocumentTarget();
        m.saveOntology(o, target);
        // Remove the ontology from the manager
        m.removeOntology(o);
    }

    @Test
View Full Code Here

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

        // localFolder first for a local copy, checking its subfolders as well
        m.getIRIMappers().add(new AutoIRIMapper(localFolder, true));
        // Create the ontology - we use the ontology IRI (not the physical URI)
        OWLOntology o = m.createOntology(EXAMPLE_SAVE_IRI);
        // save the ontology to its physical location - documentIRI
        m.saveOntology(o);
        assertNotNull(o);
    }

    @Test
    public void testAddAxioms() throws OWLException {
View Full Code Here

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

        // Add the class assertion
        m.addAxiom(o, classAssertion);
        // Dump the ontology
        StreamDocumentTarget target = new StreamDocumentTarget(
                new ByteArrayOutputStream());
        m.saveOntology(o, target);
    }

    @SuppressWarnings("unused")
    @Test
    public void testDataRanges() throws OWLException {
View Full Code Here

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

        // Add the definition to our ontology
        m.addAxiom(o, datatypeDef);
        // Dump our ontology
        StreamDocumentTarget target = new StreamDocumentTarget(
                new ByteArrayOutputStream());
        m.saveOntology(o, target);
    }

    @Test
    public void testPropertyAssertions() throws OWLException {
        // how to specify various property assertions for individuals
View Full Code Here

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

        // Register the ontology storer with the manager
        m.getOntologyStorers().add(new TutorialSyntaxStorerFactory());
        // Save using a different format
        StreamDocumentTarget target = new StreamDocumentTarget(
                new ByteArrayOutputStream());
        m.saveOntology(o, new OWLTutorialSyntaxOntologyFormat(), target);
    }

    @Test
    public void testCheckProfile() throws OWLException {
        OWLOntologyManager m = create();
View Full Code Here

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

        // Create the property assertion and add it to the ontology
        OWLAxiom ax = factory.getOWLDataPropertyAssertionAxiom(hasAge, john,
                literal);
        manager.addAxiom(ontology, ax);
        // Dump the ontology to System.out
        manager.saveOntology(ontology, new StreamDocumentTarget(
                new ByteArrayOutputStream()));
    }

    /**
     * @throws Exception
View Full Code Here

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

        // specify that :Mary is a :Person
        OWLOntology ontology = manager.createOntology(IRI.create(base));
        // Add the class assertion
        manager.addAxiom(ontology, classAssertion);
        // Dump the ontology to stdout
        manager.saveOntology(ontology, new StreamDocumentTarget(
                new ByteArrayOutputStream()));
    }

    /**
     * @throws Exception
View Full Code Here

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

        SWRLRule rule2 = factory.getSWRLRule(antecedent,
                Collections.singleton(propAtom));
        manager.applyChange(new AddAxiom(ontology, rule2));
        // 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);
    }

    /**
     * This example shows how add an object property assertion (triple) of the
     * form prop(subject, object) for example hasPart(a, b).
View Full Code Here

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

        // Add this axiom to our ontology. We can use a short cut method -
        // instead of creating the AddAxiom change ourselves, it will be created
        // automatically and the change applied
        man.addAxiom(ont, ax);
        // Save our ontology
        man.saveOntology(ont, IRI.create("file:/tmp/example.owl"));
    }

    /**
     * An example which shows how to "delete" entities, in this case
     * individuals, from and ontology.
View Full Code Here

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

            throws OWLOntologyCreationException, OWLOntologyStorageException {
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        OWLOntology ont = man.createOntology();
        man.addAxiom(ont, rule);
        StringDocumentTarget documentTarget = new StringDocumentTarget();
        man.saveOntology(ont, ontologyFormat, documentTarget);
        OWLOntologyManager man2 = OWLManager.createOWLOntologyManager();
        OWLOntology ont2 = man2
                .loadOntologyFromOntologyDocument(new StringDocumentSource(
                        documentTarget.toString(),
                        OWLOntologyDocumentSourceBase
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.