Examples of AddImport


Examples of org.semanticweb.owlapi.model.AddImport

                            // out importing ontology and remove the imported ontology.
                            // WHO EVER THOUGHT THAT THIS WAS A GOOD IDEA?
                            man.applyChange(new RemoveImport(getConsumer().getOntology(), importsDeclaration));

                            for (OWLImportsDeclaration decl : importedOntology.getImportsDeclarations()) {
                                man.applyChange(new AddImport(getConsumer().getOntology(), decl));
                            }
                            for (OWLAnnotation anno : importedOntology.getAnnotations()) {
                                man.applyChange(new AddOntologyAnnotation(getConsumer().getOntology(), anno));
                            }
                            for (OWLAxiom ax : importedOntology.getAxioms()) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport


    public void endElement() throws OWLParserException, UnloadableImportException {
        IRI ontIRI = getIRI(getText().trim());
        OWLImportsDeclaration decl = getOWLDataFactory().getOWLImportsDeclaration(ontIRI);
        getOWLOntologyManager().applyChange(new AddImport(getOntology(), decl));
        getOWLOntologyManager().makeLoadImportRequest(decl, getConfiguration());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

    try {           
      IRI iri = IRI.create(inputFile);
      iriMapper.addAllowedIRI(iri);

      OWLImportsDeclaration declaration = manager.getOWLDataFactory().getOWLImportsDeclaration( iri );
      manager.applyChange( new AddImport( baseOntology, declaration ) );
      manager.makeLoadImportRequest( declaration );
    }catch (Exception e) {
      if(verbose)
        System.err.println(e.getLocalizedMessage());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        // loading multiple files so each input file should be added as
        // an import to the base ontology we created
        OWLOntology importOnt = manager.loadOntologyFromOntologyDocument( fileIRI )
        OWLImportsDeclaration declaration = manager.getOWLDataFactory()
            .getOWLImportsDeclaration( importOnt.getOntologyID().getOntologyIRI() );
        manager.applyChange( new AddImport( baseOntology, declaration ) );
      }
    } catch( IllegalArgumentException e ) {
      throw new RuntimeException( e );
    } catch( OWLOntologyCreationException e ) {
      throw new RuntimeException( e );
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        // loading multiple files so each input file should be added as
        // an import to the base ontology we created
        OWLOntology importOnt = manager.loadOntologyFromOntologyDocument( fileIRI )
        OWLImportsDeclaration declaration = manager.getOWLDataFactory()
            .getOWLImportsDeclaration( importOnt.getOntologyID().getOntologyIRI() );
        manager.applyChange( new AddImport( baseOntology, declaration ) );
      }
    } catch( IllegalArgumentException e ) {
      throw new RuntimeException( e );
    } catch( OWLOntologyCreationException e ) {
      throw new RuntimeException( e );
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

    OWLOntology ontology1 = OWL.Ontology(axioms1);
    OWLOntology ontology2 = OWL.Ontology(axioms2);

    try {
      OWL.manager.applyChange(new AddImport(ontology1, OWL.factory.getOWLImportsDeclaration(ontology2.getOntologyID()
                      .getOntologyIRI())));
 
      TestUtils.runUpdateTest(ontology1, createModuleExtractor(), Arrays.asList(additions), Arrays.asList(deletions));
    }
    finally {
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                    break;
            }

            for (UriRef ref : listToUse)
                if (!loaded.contains(ref) && !ref.equals(graphName)) {
                    changes.add(new AddImport(o, df.getOWLImportsDeclaration(IRI.create(ref
                            .getUnicodeString()))));
                    loaded.add(ref);
                }
            o.getOWLOntologyManager().applyChanges(changes);
            return o;
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

            OWLOntologyManager ontologyManager = o.getOWLOntologyManager();
            OWLDataFactory df = ontologyManager.getOWLDataFactory();
            // Add import declarations for attached scopes.
            for (String scopeID : attachedScopes.keySet()) {
                IRI physIRI = attachedScopes.get(scopeID).getDocumentIRI();
                changes.add(new AddImport(o, df.getOWLImportsDeclaration(physIRI)));
            }
            // Commit
            ontologyManager.applyChanges(changes);
        }
        return o;
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
        OWLDataFactory auxfactory = inowl.getOWLOntologyManager().getOWLDataFactory();

        while(importedonto.hasNext()){
            OWLOntology auxonto = importedonto.next();
            additions.add(new AddImport(toadd,auxfactory.getOWLImportsDeclaration(auxonto.getOWLOntologyManager().getOntologyDocumentIRI(auxonto))));
        }

        if(additions.size()==0){
            Iterator<OWLImportsDeclaration> importedontob = inowl.getImportsDeclarations().iterator();
            additions = new LinkedList<OWLOntologyChange>();
            auxfactory = inowl.getOWLOntologyManager().getOWLDataFactory();

            while(importedontob.hasNext()){
                OWLImportsDeclaration  auxontob = importedontob.next();
                additions.add(new AddImport(toadd,auxontob));
            }
        }

        return additions;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
                // Add the import statement for the custom space, if existing and not empty
                OntologySpace spc = getCustomSpace();
                if (spc != null && spc.getOntologyCount(false) > 0) {
                    IRI spaceIri = IRI.create(getNamespace() + spc.getID());
                    additions.add(new AddImport(ont, df.getOWLImportsDeclaration(spaceIri)));
                }
                // Add the import statement for the core space, if existing and not empty
                spc = getCoreSpace();
                if (spc != null && spc.getOntologyCount(false) > 0) {
                    IRI spaceIri = IRI.create(getNamespace() + spc.getID());
                    additions.add(new AddImport(ont, df.getOWLImportsDeclaration(spaceIri)));
                }
                mgr.applyChanges(additions);
            }
        } catch (OWLOntologyCreationException e) {
            log.error("Failed to generate an OWL form of scope " + getID(), 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.