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());
}
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);
}
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();
}
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);
}
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());
}
Aggregations