Package org.semanticweb.owlapi.model

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


  public OWLOntologyManager loadOntologyFromURL(String URL) throws OWLOntologyCreationException{
    // Get hold of an ontology manager
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    // Let's load an ontology from the web
    IRI iri = IRI.create(URL);
    OWLOntology URLOntology = manager.loadOntologyFromOntologyDocument(iri);
    System.out.println("Loaded ontology: " + URLOntology);
    currentOntologyID =  URLOntology.getOntologyID();
   
    return manager;
   
View Full Code Here


    // Get hold of an ontology manager
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    // We can also load ontologies from files.
    File file = new File(filePath);
    // Now load the local copy
    OWLOntology fileOntology = manager.loadOntologyFromOntologyDocument(file);
    System.out.println("Loaded ontology: " + fileOntology);
   
    currentOntologyID =  fileOntology.getOntologyID();
    return manager;
   
View Full Code Here

   * this takes in existing ontology files and merges their elements.  It then stores the newly generated ontology.
   */
  public void mergeOntology(String firstOntPath, String secondOntPath, String outputPath) throws OWLOntologyStorageException, OWLOntologyCreationException{
    // Just load two arbitrary ontologies for the purposes of this example
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        man.loadOntologyFromOntologyDocument(new File(firstOntPath));
        man.loadOntologyFromOntologyDocument(new File(secondOntPath));
       
        // Create our ontology merger
        OWLOntologyMerger merger = new OWLOntologyMerger(man);
        // We merge all of the loaded ontologies. Since an OWLOntologyManager is an OWLOntologySetProvider we just pass this in.
View Full Code Here

   */
  public void mergeOntology(String firstOntPath, String secondOntPath, String outputPath) throws OWLOntologyStorageException, OWLOntologyCreationException{
    // Just load two arbitrary ontologies for the purposes of this example
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        man.loadOntologyFromOntologyDocument(new File(firstOntPath));
        man.loadOntologyFromOntologyDocument(new File(secondOntPath));
       
        // Create our ontology merger
        OWLOntologyMerger merger = new OWLOntologyMerger(man);
        // We merge all of the loaded ontologies. Since an OWLOntologyManager is an OWLOntologySetProvider we just pass this in.
        //We also need to specify the URI of the new ontology that will be created.
View Full Code Here

  public OWLOntologyManager loadOntologyFromURL(String URL) throws OWLOntologyCreationException{
    // Get hold of an ontology manager
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    // Let's load an ontology from the web
    IRI iri = IRI.create(URL);
    OWLOntology URLOntology = manager.loadOntologyFromOntologyDocument(iri);
    System.out.println("Loaded ontology: " + URLOntology);
    currentOntologyID =  URLOntology.getOntologyID();
   
    return manager;
   
View Full Code Here

    // Get hold of an ontology manager
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    // We can also load ontologies from files.
    File file = new File(filePath);
    // Now load the local copy
    OWLOntology fileOntology = manager.loadOntologyFromOntologyDocument(file);
    System.out.println("Loaded ontology: " + fileOntology);
   
    currentOntologyID =  fileOntology.getOntologyID();
    return manager;
   
View Full Code Here

  public OWLOntologyManager loadOntologyFromURL(String URL) throws OWLOntologyCreationException{
    // Get hold of an ontology manager
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    // Let's load an ontology from the web
    IRI iri = IRI.create(URL);
    OWLOntology URLOntology = manager.loadOntologyFromOntologyDocument(iri);
    System.out.println("Loaded ontology: " + URLOntology);
    currentOntologyID =  URLOntology.getOntologyID();
   
    return manager;
   
View Full Code Here

    }
   
    private OWLOntology loadRootOntologyAndImportsClosureFromOntologyDocument() throws IOException, OWLOntologyCreationException {
        OWLOntologyManager manager = createOntologyManager();
        return manager.loadOntologyFromOntologyDocument(sourceFile);
    }

    private OWLOntologyManager createOntologyManager() {
        OWLOntologyManager manager = WebProtegeOWLManager.createOWLOntologyManager();
        manager.clearIRIMappers();
View Full Code Here

        String l = getPremiseOntology( format );
        if( l == null )
          return null;

        StringDocumentSource source = new StringDocumentSource( l );
        o = manager.loadOntologyFromOntologyDocument( source );
        parsedPremise.put( format, o );
      }
      return o;
    } catch( OWLOntologyCreationException e ) {
      throw new OntologyParseException( e );
View Full Code Here

        String l = getPremiseOntology( format );
        if( l == null )
          return null;

        StringDocumentSource source = new StringDocumentSource( l );
        o = manager.loadOntologyFromOntologyDocument( source );
        parsedPremise.put( format, o );
      }
      return o;
    } catch( OWLOntologyCreationException e ) {
      throw new OntologyParseException( e );
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.