Package org.apache.stanbol.ontologymanager.sources.owlapi

Examples of org.apache.stanbol.ontologymanager.sources.owlapi.ParentPathInputSource


    @Test
    public void storageOnScopeCreation() throws Exception {

        assertEquals(1, ontologyProvider.getStore().listTripleCollections().size());
        // This one has an import that we want to hijack locally, so we use the ParentPathInputSource.
        OntologyInputSource<?> ois = new ParentPathInputSource(new File(getClass().getResource(
            "/ontologies/minorcharacters.owl").toURI()));

        Scope sc = onManager.createOntologyScope(scopeId, ois);

        Set<Triple> triples = new HashSet<Triple>();
View Full Code Here


        // This one is created from scratch
        MGraph ont2 = ClerezzaOWLUtils.createOntology(baseIri2.toString());
        minorSrc = new GraphSource(ont2.getGraph());
        dropSrc = getLocalSource("/ontologies/droppedcharacters.owl");
        nonexSrc = getLocalSource("/ontologies/nonexistentcharacters.owl");
        inMemorySrc = new ParentPathInputSource(new File(TestClerezzaSpaces.class.getResource(
            "/ontologies/maincharacters.owl").toURI()));

        OWLDataFactory df = OWLManager.getOWLDataFactory();
        OWLClass cHuman = df.getOWLClass(IRI.create(baseIri + "/" + Constants.humanBeing));
        OWLIndividual iLinus = df.getOWLNamedIndividual(IRI.create(baseIri + "/" + Constants.linus));
View Full Code Here

    private static OntologyInputSource<OWLOntology> getLocalSource(String resourcePath, OWLOntologyManager mgr) throws OWLOntologyCreationException,
                                                                                                               URISyntaxException {
        URL url = TestOntologySpaces.class.getResource(resourcePath);
        File f = new File(url.toURI());
        return new ParentPathInputSource(f, mgr != null ? mgr
                : OWLOntologyManagerFactory.createOWLOntologyManager(onManager.getOfflineConfiguration()
                        .getOntologySourceLocations().toArray(new IRI[0])));
    }
View Full Code Here

        });

        mgr.addIRIMapper(new PhonyIRIMapper(null));

        File f = new File(url.toURI());
        OntologyInputSource<OWLOntology> src = new ParentPathInputSource(f, mgr);
        // OntologyInputSource<OWLOntology> src = new RootOntologyIRISource(IRI.create(f), mgr);

        // OntologyInputSource<OWLOntology> src = new OntologyContentInputSource(content,mgr);

        OWLOntology original = src.getRootOntology();
        Assert.assertNotNull(original);
        OntologySpace spc = new CustomSpaceImpl("Test", scopeNs, ontologyProvider);
        spc.addOntology(src);

    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.ontologymanager.sources.owlapi.ParentPathInputSource

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.