Search in sources :

Example 1 with SimpleTcProvider

use of org.apache.clerezza.rdf.simple.storage.SimpleTcProvider in project stanbol by apache.

the class TestClerezzaInputSources method fromInputStreamInSimpleTcProvider.

/*
     * An ontology input source created using a custom TC Provider should create a non-null Origin (i.e. the
     * name of the generated graph) and increase the triple collection count by 1.
     */
@Test
public void fromInputStreamInSimpleTcProvider() throws Exception {
    InputStream in = getClass().getResourceAsStream(dummy_RdfXml);
    TcProvider tcp = new SimpleTcProvider();
    assertSame(0, tcp.listGraphs().size());
    int before = tcp.listGraphs().size();
    src = new GraphContentInputSource(in, tcp);
    checkOntology(true);
    assertSame(before + 1, tcp.listGraphs().size());
}
Also used : InputStream(java.io.InputStream) SimpleTcProvider(org.apache.clerezza.rdf.simple.storage.SimpleTcProvider) SimpleTcProvider(org.apache.clerezza.rdf.simple.storage.SimpleTcProvider) TcProvider(org.apache.clerezza.rdf.core.access.TcProvider) Test(org.junit.Test)

Example 2 with SimpleTcProvider

use of org.apache.clerezza.rdf.simple.storage.SimpleTcProvider in project stanbol by apache.

the class TestOntologyRegistry method setup.

/**
 * Sets the registry and ontology network managers, which are immutable across tests.
 */
@BeforeClass
public static void setup() {
    // 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, Parser.getInstance()), config);
}
Also used : Hashtable(java.util.Hashtable) SimpleTcProvider(org.apache.clerezza.rdf.simple.storage.SimpleTcProvider) RegistryManagerImpl(org.apache.stanbol.ontologymanager.registry.impl.RegistryManagerImpl) OfflineConfigurationImpl(org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl) OfflineConfiguration(org.apache.stanbol.ontologymanager.servicesapi.OfflineConfiguration) ClerezzaOntologyProvider(org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider) BeforeClass(org.junit.BeforeClass)

Example 3 with SimpleTcProvider

use of org.apache.clerezza.rdf.simple.storage.SimpleTcProvider in project stanbol by apache.

the class MockOsgiContext method reset.

/**
 * Sets up a new mock OSGi context and cleans all resources and components.
 */
public static void reset() {
    // reset Clerezza objects
    tcManager = new TcManager();
    tcManager.addWeightedTcProvider(new SimpleTcProvider());
    // reset Stanbol objects
    ontologyProvider = new ClerezzaOntologyProvider(tcManager, offline, parser);
    collectorfactory = new ClerezzaCollectorFactory(ontologyProvider, config);
    resetManagers();
}
Also used : TcManager(org.apache.clerezza.rdf.core.access.TcManager) SimpleTcProvider(org.apache.clerezza.rdf.simple.storage.SimpleTcProvider) ClerezzaOntologyProvider(org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider) ClerezzaCollectorFactory(org.apache.stanbol.ontologymanager.multiplexer.clerezza.collector.ClerezzaCollectorFactory)

Example 4 with SimpleTcProvider

use of org.apache.clerezza.rdf.simple.storage.SimpleTcProvider in project stanbol by apache.

the class TestOntologyNetworkPersistence method cleanup.

/*
     * Before each test, everything is cleaned up, including the TcProvider.
     */
@Before
public void cleanup() throws Exception {
    tcp = new SimpleTcProvider();
    resetOntologyProvider();
    Dictionary<String, Object> empty = new Hashtable<String, Object>();
    ClerezzaCollectorFactory factory = new ClerezzaCollectorFactory(ontologyProvider, empty);
    onm = new ScopeManagerImpl(ontologyProvider, new OfflineConfigurationImpl(empty), factory, factory, empty);
}
Also used : Hashtable(java.util.Hashtable) SimpleTcProvider(org.apache.clerezza.rdf.simple.storage.SimpleTcProvider) ScopeManagerImpl(org.apache.stanbol.ontologymanager.core.scope.ScopeManagerImpl) OfflineConfigurationImpl(org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl) Before(org.junit.Before)

Example 5 with SimpleTcProvider

use of org.apache.clerezza.rdf.simple.storage.SimpleTcProvider in project stanbol by apache.

the class MockOsgiContext method reset.

public static void reset() {
    tcManager = new TcManager();
    tcManager.addWeightedTcProvider(new SimpleTcProvider());
}
Also used : TcManager(org.apache.clerezza.rdf.core.access.TcManager) SimpleTcProvider(org.apache.clerezza.rdf.simple.storage.SimpleTcProvider)

Aggregations

SimpleTcProvider (org.apache.clerezza.rdf.simple.storage.SimpleTcProvider)5 Hashtable (java.util.Hashtable)2 TcManager (org.apache.clerezza.rdf.core.access.TcManager)2 OfflineConfigurationImpl (org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl)2 ClerezzaOntologyProvider (org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider)2 InputStream (java.io.InputStream)1 TcProvider (org.apache.clerezza.rdf.core.access.TcProvider)1 ScopeManagerImpl (org.apache.stanbol.ontologymanager.core.scope.ScopeManagerImpl)1 ClerezzaCollectorFactory (org.apache.stanbol.ontologymanager.multiplexer.clerezza.collector.ClerezzaCollectorFactory)1 RegistryManagerImpl (org.apache.stanbol.ontologymanager.registry.impl.RegistryManagerImpl)1 OfflineConfiguration (org.apache.stanbol.ontologymanager.servicesapi.OfflineConfiguration)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1 Test (org.junit.Test)1