Package org.semanticweb.owlapi.model

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


         * object property assertion axiom
         */
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        OWLDataFactory factory = manager.getOWLDataFactory();
        try {
            ontology = manager.createOntology(IRI.create(ns + "testOntology"));
        } catch (OWLOntologyCreationException e) {
            log.error(e.getMessage());
        }

        if (ontology != null) {
View Full Code Here


        JenaToOwlConvert j2o = new JenaToOwlConvert();

        OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
        OWLOntology ont = null;
        try {
            ont = mgr.createOntology();
        } catch (OWLOntologyCreationException e) {
            e.printStackTrace();
            fail("Can not create ontology");
        }
View Full Code Here

        OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
        OWLOntology ont = null;
        StmtIterator resource = null;

        try {
            ont = mgr.createOntology();
        } catch (OWLOntologyCreationException e) {
            e.printStackTrace();
            fail("Could not load ontology");
        }
View Full Code Here

            // 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;
View Full Code Here

    public boolean isConsistent(OWLOntology ontology, List<SWRLRule> rules) throws ReasoningServiceException {
        log.debug("Create a input ontology to merge rules in.");
        OWLOntology input;
        try {
            OWLOntologyManager manager = createOWLOntologyManager();
            input = manager.createOntology();
            Set<SWRLRule> ruleSet = new HashSet<SWRLRule>();
            ruleSet.addAll(rules);
            manager.addAxioms(input, ruleSet);
            input = manager.getOntology(input.getOntologyID());
            log.debug("Created ontology: {}", input);
View Full Code Here

    public static OWLOntology getScopes(Set<Scope> scopes) {

        OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
        OWLOntology ont = null;
        try {
            ont = mgr.createOntology();
        } catch (OWLOntologyCreationException e) {
            LoggerFactory.getLogger(ScopeSetRenderer.class).error(
                "KReS :: could not create empty ontology for rendering scopes.", e);
            return null;
        }
View Full Code Here

        OWLOntologyManager mgr = OWLOntologyManagerFactory.createOWLOntologyManager(onManager
                .getOfflineConfiguration().getOntologySourceLocations().toArray(new IRI[0]));
        OWLDataFactory df = mgr.getOWLDataFactory();

        ont = mgr.createOntology(baseIri);
        inMemorySrc = new RootOntologySource(ont);
        // Let's state that Linus is a human being
        OWLClass cHuman = df.getOWLClass(IRI.create(baseIri + "/" + Constants.humanBeing));
        OWLIndividual iLinus = df.getOWLNamedIndividual(IRI.create(baseIri + "/" + Constants.linus));
        linusIsHuman = df.getOWLClassAssertionAxiom(cHuman, iLinus);
View Full Code Here

        OWLClass cHuman = df.getOWLClass(IRI.create(baseIri + "/" + Constants.humanBeing));
        OWLIndividual iLinus = df.getOWLNamedIndividual(IRI.create(baseIri + "/" + Constants.linus));
        linusIsHuman = df.getOWLClassAssertionAxiom(cHuman, iLinus);
        mgr.applyChange(new AddAxiom(ont, linusIsHuman));

        ont2 = mgr.createOntology(baseIri2);
        minorSrc = new RootOntologySource(ont2);

        dropSrc = getLocalSource("/ontologies/droppedcharacters.owl", mgr);
        nonexSrc = getLocalSource("/ontologies/nonexistentcharacters.owl", mgr);
        minorSrc = new RootOntologySource(ont2);
View Full Code Here

                    log.error("Failed to merge imports for ontology.", e);
                    ont = null;
                }
            } else {
                // The root ontology ID is in the form [namespace][scopeId]
                ont = mgr.createOntology(IRI.create(universalPrefix + getID()));
                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.listManagedOntologies().size() > 0) {
                    IRI spaceIri = IRI.create(universalPrefix + spc.getID());
View Full Code Here

        }
        // We get the manager from the input ontology
        // XXX We must be aware of this.
        OWLOntologyManager manager = input.getOWLOntologyManager();
        try {
            OWLOntology output = manager.createOntology();
            Set<OWLAxiom> axioms = s.runTask(task, input, rules, filtered, parameters);
            log.debug("Prepare output: {} axioms", axioms.size());
            manager.addAxioms(output, axioms);
            if (targetGraphID == null) {
                return new ReasoningServiceResult<OWLOntology>(task, true, manager.getOntology(output
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.