Package org.semanticweb.owlapi.util

Examples of org.semanticweb.owlapi.util.InferredOntologyGenerator


        // axiom generators
        List<InferredAxiomGenerator<? extends OWLAxiom>> gens = new ArrayList<>();
        gens.add(new InferredSubClassAxiomGenerator());
        OWLOntology infOnt = m.createOntology();
        // create the inferred ontology generator
        InferredOntologyGenerator iog = new InferredOntologyGenerator(reasoner,
                gens);
        iog.fillOntology(m.getOWLDataFactory(), infOnt);
    }
View Full Code Here


        // ontology if we wanted to do this.
        OWLOntology infOnt = man.createOntology();
        // Now get the inferred ontology generator to generate some inferred
        // axioms for us (into our fresh ontology). We specify the reasoner that
        // we want to use and the inferred axiom generators that we want to use.
        InferredOntologyGenerator iog = new InferredOntologyGenerator(reasoner,
                gens);
        iog.fillOntology(man.getOWLDataFactory(), infOnt);
        // Save the inferred ontology. (Replace the URI with one that is
        // appropriate for your setup)
        man.saveOntology(infOnt, new StringDocumentTarget());
    }
View Full Code Here

            // Get the reasoner
            OWLReasoner reasoner = getReasoner(input);
            log.info("Running {} reasoner on {} ", reasoner.getClass(), input.getOntologyID());

            // To generate inferred axioms
            InferredOntologyGenerator inferred = new InferredOntologyGenerator(reasoner, generators);

            // We fill an anonymous ontology with the result, the return the
            // axiom set
            Set<OWLAxiom> axioms = new HashSet<OWLAxiom>();
            try {
                OWLOntology output = manager.createOntology();
                log.debug("Created output ontology: {}", output);
                try {
                    inferred.fillOntology(manager, output);
                } catch (InconsistentOntologyException i) {
                    throw i;
                } catch (Throwable t) {
                    log.error("Some problem occurred:\n {}", t.getStackTrace());
                    throw new ReasoningServiceException();
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.util.InferredOntologyGenerator

Copyright © 2018 www.massapicom. 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.