Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Importing several ontologies from stream

Ralf Weinand weinanr at cs.tu-berlin.de
Tue May 6 14:03:22 PDT 2008


Just in case someone else needs to import models from a stream, here
is the code.
Tania, maybe you want to have a look at the last line of the method,
regarding the addImport()-statement.
Is this the way to mark the imported ontology as imported?

    public void importIntoModel(String modelString, URI ontologyURI,
JenaOWLModel owlModel)
            throws Exception
    {
        TripleStore activeTripleStore =
owlModel.getTripleStoreModel().getActiveTripleStore();
        TripleStore ts =
owlModel.getTripleStoreModel().createTripleStore(ontologyURI.toString());

        ProtegeOWLParser parser = new ProtegeOWLParser(owlModel, true);
        parser.setImporting(true);

        // Get a reader for the model to be imported
        StringReader modelStringReader = new StringReader(modelString);
        ARPInvokation arpInvokation =
createARPInvokation(modelStringReader, ontologyURI.toString());
        parser.loadTriples(ts, ontologyURI.toString(), arpInvokation);

        owlModel.getTripleStoreModel().setActiveTripleStore(activeTripleStore);
        owlModel.getOWLFrameStore().copyFacetValuesIntoNamedClses();

        owlModel.getDefaultOWLOntology().addImports(ontologyURI);
    }



More information about the protege-owl mailing list