Examples of ClerezzaOntologyProvider


Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider

        serializer = new Serializer(); // add Jena-supported formats + RDF/JSON
        serializer.bindSerializingProvider(new JenaSerializerProvider());
        serializer.bindSerializingProvider(new RdfJsonSerializingProvider());

        // reset Stanbol objects
        ontologyProvider = new ClerezzaOntologyProvider(tcManager, offline, parser);
        collectorfactory = new ClerezzaCollectorFactory(ontologyProvider, config);
        resetManagers();
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider

        OWLDataFactory df = OWLManager.getOWLDataFactory();
        OWLClass cHuman = df.getOWLClass(IRI.create(baseIri + "/" + Constants.humanBeing));
        OWLIndividual iLinus = df.getOWLNamedIndividual(IRI.create(baseIri + "/" + Constants.linus));
        linusIsHuman = df.getOWLClassAssertionAxiom(cHuman, iLinus);

        factory = new ClerezzaCollectorFactory(new ClerezzaOntologyProvider(tcManager, offline, parser),
                new Hashtable<String,Object>());
        factory.setDefaultNamespace(IRI.create("http://stanbol.apache.org/ontology/"));
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider

    /*
     * With this method, the ontology provider and all its internal indices are cleared. However, the Clerezza
     * persistence objects are not cleared, so we can check if we can still retrieve metadata from them.
     */
    private void resetOntologyProvider() {
        ontologyProvider = new ClerezzaOntologyProvider(tcp, new OfflineConfigurationImpl(
                new Hashtable<String,Object>()), parser);
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider

        // Create and set the cache.
        if (cachingPolicyString.equals(CachingPolicy.CENTRALISED.name())) {
            // this.cache = OWLOntologyManagerFactory.createOWLOntologyManager(offlineResources);
            if (cache == null) {
                log.warn("Caching policy is set as Centralised, but no ontology provider is supplied. Will use new in-memory tcProvider.");
                cache = new ClerezzaOntologyProvider(TcManager.getInstance(), offline, Parser.getInstance());
            }
            // else sta bene cosi'
        } else if (cachingPolicyString.equals(CachingPolicy.DISTRIBUTED.name())) {
            this.cache = null;
        }

        riFactory = new RegistryItemFactoryImpl(cache);

        // Build the model.
        createModel(regOnts);

        // Set the cache on libraries.
        Set<RegistryItem> visited = new HashSet<RegistryItem>();
        for (Registry reg : getRegistries())
            for (RegistryItem child : reg.getChildren())
                if (!visited.contains(child)) {
                    if (child instanceof Library) {
                        if (this.cache != null) ((Library) child).setCache(this.cache);
                        else ((Library) child).setCache(new ClerezzaOntologyProvider(TcManager.getInstance(),
                                offline, Parser.getInstance()));
                    }
                    visited.add(child);
                }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider

        // We use a single Dictionary for storing all configurations.
        final Dictionary<String,Object> config = new Hashtable<String,Object>();
        config.put(OfflineConfiguration.ONTOLOGY_PATHS, new String[] {"/ontologies", "/ontologies/registry"});
        OfflineConfiguration offline = new OfflineConfigurationImpl(config);
        // The registry manager can be updated via calls to createModel()
        regman = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(new SimpleTcProvider(),
                offline, new Parser()), config);
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider

    public void setupTests() throws Exception {}

    @After
    public void cleanup() throws Exception {
        reset();
        provider = new ClerezzaOntologyProvider(tcManager, offline, parser);
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider

        IRI localTestRegistry = IRI.create(getClass().getResource(registryResourcePath));
        Dictionary<String,Object> regmanConf = new Hashtable<String,Object>();
        regmanConf.put(RegistryManager.REGISTRY_LOCATIONS, new String[] {localTestRegistry.toString()});
        // Instantiating the registry manager will also load the registry data.
        regMgr = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(tcManager, offline, parser),
                regmanConf);

        // The resulting manager must exist and have exactly one registry.
        assertNotNull(regMgr);
        Set<Registry> registries = regMgr.getRegistries();
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider

        IRI localTestRegistry = IRI.create(getClass().getResource(registryResourcePath));
        Dictionary<String,Object> regmanConf = new Hashtable<String,Object>();
        regmanConf.put(RegistryManager.REGISTRY_LOCATIONS, new String[] {localTestRegistry.toString()});
        // Instantiating the registry manager will also load the registry data.
        regMgr = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(tcManager, offline, parser),
                regmanConf);
        assertNotNull(regMgr);

        // Now use this registry manager to instantiate an input source.
        OntologyInputSource<OWLOntology> src = new LibrarySource(Locations.LIBRARY_TEST1, regMgr,
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider

        // Also unload the ontology version that comes from this library.
    }

    @Override
    public void setCache(OntologyProvider<?> cache) {
        if (cache == null) cache = new ClerezzaOntologyProvider(TcManager.getInstance(), null,
                Parser.getInstance());
        else {
            Object store = cache.getStore();
            if (!(store instanceof TcProvider || store instanceof OWLOntologyManager)) throw new IllegalArgumentException(
                    "Type "
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.impl.clerezza.ClerezzaOntologyProvider

    @Test
    public void testGraphContentSource() throws Exception {
        // Make sure the tc manager has been reset
        assertEquals(1, tcManager.listTripleCollections().size());

        OntologyProvider<TcProvider> provider = new ClerezzaOntologyProvider(tcManager,
                new OfflineConfigurationImpl(new Hashtable<String,Object>()), parser);

        InputStream content = TestClerezzaInputSources.class
                .getResourceAsStream("/ontologies/droppedcharacters.owl");
        OntologyInputSource<?,TcProvider> src = new GraphContentInputSource(content, SupportedFormat.RDF_XML,
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.