Package org.apache.stanbol.ontologymanager.ontonet.api.io

Examples of org.apache.stanbol.ontologymanager.ontonet.api.io.RootOntologySource


    public static void setup() {
        factory = onManager.getOntologyScopeFactory();
        if (factory == null) fail("Could not instantiate ontology space factory");
        OWLOntologyManager mgr = OWLOntologyManagerFactory.createOWLOntologyManager(null);
        try {
            src1 = new RootOntologySource(mgr.createOntology(baseIri), null);
            src2 = new RootOntologySource(mgr.createOntology(baseIri2), null);
        } catch (OWLOntologyCreationException e) {
            fail("Could not setup ontology with base IRI " + Constants.PEANUTS_MAIN_BASE);
        }
    }
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, null);
        // 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);
        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, null);

    }
View Full Code Here

        if (rootSrc instanceof OntologySpaceSource) {
            OntologySpace spc = ((OntologySpaceSource) rootSrc).asOntologySpace();
            for (OWLOntology o : subtrees)
                try {
                    spc.addOntology(new RootOntologySource(o));
                } catch (UnmodifiableOntologyCollectorException e) {
                    logger.error("Cannot add ontology {} to unmodifiable space {}", o, spc);
                    continue;
                }
        }
View Full Code Here

    }

    public static OWLOntology buildImportTree(Set<OWLOntology> subtrees, OWLOntologyManager mgr) throws OWLOntologyCreationException {

        return buildImportTree(new RootOntologySource(mgr.createOntology()), subtrees, mgr);

    }
View Full Code Here

            // Expand core sources
            List<OntologyInputSource<?,?>> expanded = new ArrayList<OntologyInputSource<?,?>>();
            if (coreSrc != null) {
                if (coreSrc instanceof OntologySetInputSource) {
                    for (OWLOntology o : ((OntologySetInputSource) coreSrc).getOntologies()) {
                        expanded.add(new RootOntologySource(o));
                    }
                } else expanded.add(coreSrc);
            }
            if (custSrc != null) {
                if (custSrc instanceof OntologySetInputSource) for (OWLOntology o : ((OntologySetInputSource) custSrc)
                        .getOntologies())
                    expanded.add(new RootOntologySource(o));
                else expanded.add(custSrc);
            }
            // Invoke the appropriate factory method depending on the
            // availability of a custom source.
            // scope = (custSrc != null) ? f.createOntologyScope(scopeid, coreSrc, custSrc) : f
View Full Code Here

        scopeRegistry = onm.getScopeRegistry();
        assertNotNull(spaceFactory);
        assertNotNull(scopeFactory);
        OWLOntologyManager mgr = OWLOntologyManagerFactory.createOWLOntologyManager(null);
        try {
            src1 = new RootOntologySource(mgr.createOntology(baseIri), null);
            src2 = new RootOntologySource(mgr.createOntology(baseIri2), null);
        } catch (OWLOntologyCreationException e) {
            fail("Could not setup ontology with base IRI " + Constants.PEANUTS_MAIN_BASE);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.ontologymanager.ontonet.api.io.RootOntologySource

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.