Examples of GraphSource


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

        parser.parse(tcManager.createMGraph(uri), inputStream, SupportedFormat.RDF_XML, uri);
        uri = new UriRef(Locations.CHAR_MINOR.toString());
        inputStream = TestClerezzaInputSources.class.getResourceAsStream("/ontologies/minorcharacters.owl");
        parser.parse(tcManager.createMGraph(uri), inputStream, SupportedFormat.RDF_XML, uri);

        gis = new GraphSource(new UriRef(Locations.CHAR_ACTIVE.toString()));
        assertNotNull(gis);
        assertNotNull(gis.getRootOntology());
        Set<TripleCollection> imported = gis.getImports(false);
        // Number of stored graphs minus the importing one minus the reserved graph = imported graphs
        assertEquals(tcManager.listTripleCollections().size() - 2, imported.size());
View Full Code Here

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

             *
             * There is no chance that (2) could be null, as it was previously controlled by the JobManager
             * through the canEnhance() method and the computeEnhancement is always called iff the former
             * returns true.
             */
            session.addOntology(new GraphSource(signaturesGraph));
            session.addOntology(new GraphSource(metadataGraph));
        } catch (UnmodifiableOntologyCollectorException e1) {
            throw new EngineException("Cannot add enhancement graph to OntoNet session for refactoring", e1);
        }

        try {
View Full Code Here

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

    private static OfflineConfiguration offline;

    private static OntologyInputSource<TripleCollection,?> getLocalSource(String resourcePath) {
        InputStream is = TestOntologySpaces.class.getResourceAsStream(resourcePath);
        return new GraphSource(parser.parse(is, SupportedFormat.RDF_XML));
    }
View Full Code Here

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

        offline = new OfflineConfigurationImpl(new Hashtable<String,Object>());
        ScopeRegistry reg = new ScopeRegistryImpl();

        // 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 RootOntologyIRISource(IRI.create(TestClerezzaSpaces.class
                .getResource("/ontologies/maincharacters.owl")));
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.sources.clerezza.GraphSource

    private static OfflineConfiguration offline;

    private static OntologyInputSource<TripleCollection> getLocalSource(String resourcePath) {
        InputStream is = TestOntologySpaces.class.getResourceAsStream(resourcePath);
        return new GraphSource(parser.parse(is, SupportedFormat.RDF_XML));
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.sources.clerezza.GraphSource

        offline = new OfflineConfigurationImpl(new Hashtable<String,Object>());
        ScopeRegistry reg = new ScopeRegistryImpl();

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

Examples of org.apache.stanbol.ontologymanager.sources.clerezza.GraphSource

             *
             * There is no chance that (2) could be null, as it was previously controlled by the JobManager
             * through the canEnhance() method and the computeEnhancement is always called iff the former
             * returns true.
             */
            session.addOntology(new GraphSource(signaturesGraph));
            session.addOntology(new GraphSource(metadataGraph));
        } catch (UnmodifiableOntologyCollectorException e1) {
            throw new EngineException("Cannot add enhancement graph to OntoNet session for refactoring", e1);
        }

        try {
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.sources.clerezza.GraphSource

            } catch (OWLOntologyCreationException e) {
                throw new RuntimeException(e);
            }
            else if (ref instanceof UriRef) {
                log.debug("Deferring addition to stored Clerezza graph {} (if available).", ref);
                key = addOntology(new GraphSource((UriRef) ref));
            } else if (ref instanceof OWLOntologyID) {
                OWLOntologyID idref = (OWLOntologyID) ref;
                log.debug("Deferring addition to stored ontology with public key {} (if available).", ref);
                if (!ontologyProvider.hasOntology(idref)) throw new MissingOntologyException(this, idref);
                key = idref;
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.sources.clerezza.GraphSource

                if (coreSrc != null) {
                    if (coreSrc instanceof SetInputSource) {
                        for (Object o : ((SetInputSource<?>) coreSrc).getOntologies()) {
                            OntologyInputSource<?> src = null;
                            if (o instanceof OWLOntology) src = new RootOntologySource((OWLOntology) o);
                            else if (o instanceof TripleCollection) src = new GraphSource(
                                    (TripleCollection) o);
                            if (src != null) expanded.add(src);
                        }
                    } else expanded.add(coreSrc); // Must be denoting a single ontology
                }
View Full Code Here

Examples of org.opentripplanner.routing.services.GraphSource

        /*
         * Here we should not synchronize on graphSource as it may block for a while (during
         * reload/autoreload). For normal operations a simple get do not need to be synchronized so
         * we should be safe.
         */
        GraphSource graphSource = graphSources.get(routerId);
        if (graphSource == null) {
            LOG.error("no graph registered with the routerId '{}'", routerId);
            throw new GraphNotFoundException();
        }
        Graph graph = graphSource.getGraph();
        if (graph == null) {
            evictGraph(routerId);
            throw new GraphNotFoundException();
        }
        return graph;
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.