Package org.semanticweb.owlapi.model

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


        // Create a manager to work with
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        // Load the MGED ontology. There is a copy of the MGED ontology located
        // at the address pointed to by its ontology IRI (this is good practice
        // and is recommended in the OWL 2 spec).
        OWLOntology ontology = manager.loadOntology(mgedOntologyIri);
        // Print out the ontology IRI and its imported ontology IRIs
        printOntologyAndImports(manager, ontology);
        // We'll load the MGED ontology again, but this time, we'll get the
        // Protege ontology (that it imports) from the TONES repository. To tell
        // the ontology manager to do this we need to add an IRI mapper. We need
View Full Code Here


        manager.getIRIMappers().add(new SimpleIRIMapper(iri, IRI.create(file)));
        // Load the ontology as if we were loading it from the web (from its
        // ontology IRI)
        IRI pizzaOntologyIRI = IRI
                .create("http://owl.cs.manchester.ac.uk/co-ode-files/ontologies/pizza.owl");
        OWLOntology redirectedPizza = manager.loadOntology(pizzaOntologyIRI);
        IRI pizza = manager.getOntologyDocumentIRI(redirectedPizza);
        // Note that when imports are loaded an ontology manager will be
        // searched for mappings
    }
View Full Code Here

    @Test
    public void testRemoteIsParseable() throws OWLOntologyCreationException {
        OWLOntologyManager manager = getManager();
        IRI iri = IRI(str);
        OWLOntology ontology = manager.loadOntology(iri);
        assertEquals(1, ontology.getAxioms().size());
        assertEquals(ontology.getOntologyID().getOntologyIRI().get(), iri);
        assertNotNull(manager.getOntology(iri));
    }
View Full Code Here

    public void testEquivalentLoading() throws OWLOntologyCreationException {
        OWLOntologyManager managerStart = getManager();
        OWLOntology manualImport = managerStart
                .loadOntologyFromOntologyDocument(new File(RESOURCES, superpath));
        OWLOntologyManager managerTest = getManager();
        OWLOntology iriImport = managerTest.loadOntology(IRI(str));
        assertEquals(manualImport.getAxioms(), iriImport.getAxioms());
        assertEquals(manualImport.getOntologyID(), iriImport.getOntologyID());
    }

    @Test
View Full Code Here

        }
        public void run(Reasoner hermit,Prefixes prefixes,StatusOutput status,PrintWriter output) {
            status.log(2,"Checking whether the loaded ontology entails the conclusion ontology");
            OWLOntologyManager m=OWLManager.createOWLOntologyManager();
            try {
                OWLOntology conclusions = m.loadOntology(conclusionIRI);
                EntailmentChecker checker=new EntailmentChecker(hermit, m.getOWLDataFactory());
                boolean isEntailed=checker.entails(conclusions.getLogicalAxioms());
                output.println(isEntailed);
            } catch (OWLOntologyCreationException e) {
                e.printStackTrace();
View Full Code Here

                status.log(2,"Processing "+ont.toString());
                status.log(2,String.valueOf(actions.size())+" actions");
                try {
                    long startTime=System.currentTimeMillis();
                    OWLOntologyManager ontologyManager=OWLManager.createOWLOntologyManager();
                    OWLOntology ontology=ontologyManager.loadOntology(ont);
                    long parseTime=System.currentTimeMillis()-startTime;
                    status.log(2,"Ontology parsed in "+String.valueOf(parseTime)+" msec.");
                    startTime=System.currentTimeMillis();
                    Reasoner hermit=new Reasoner(config,ontology);
                    long loadTime=System.currentTimeMillis()-startTime;
View Full Code Here

    public final static void main(String[] args) throws Exception  {
    String file = "http://www.mindswap.org/2004/owl/mindswappers#";
   
    System.out.print("Reading file " + file + "...");
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLOntology ontology = manager.loadOntology(IRI.create(file));

    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner( ontology );
    System.out.println("done.");
   
    reasoner.getKB().realize();
View Full Code Here

    System.out.println( "----------------------------------------------" );

    // read the ontology
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLDataFactory factory = manager.getOWLDataFactory();
    OWLOntology ontology = manager.loadOntology( IRI.create( mindswappers ) );

    // we want a non-buffering reasoner here (a buffering reasoner would not process any additions, until manually refreshed)
    PelletReasoner reasoner = com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.getInstance().createNonBufferingReasoner( ontology );
    manager.addOntologyChangeListener( reasoner );
View Full Code Here

    // create an ontology manager
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLDataFactory factory = manager.getOWLDataFactory();
   
    // read the ontology
    OWLOntology ontology = manager.loadOntology( IRI.create(ont) );
   
    // load the ontology to the reasoner
    PelletReasoner reasoner = com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.getInstance().createReasoner( ontology );
   
    // create property and resources to query the reasoner
View Full Code Here

  private void run() throws Exception {
    // Create an OWLAPI manager that allows to load an ontology
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();

    // Load the ontology file into an OWL ontology object
    OWLOntology ontology = manager.loadOntology( IRI.create( file ) );
   
    // Get some figures about the ontology and print them
    System.out.println( "The ontology contains "
      + ontology.getLogicalAxiomCount() + " axioms, "
      + ontology.getClassesInSignature().size() + " classes, and "
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.