use of org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl 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.stanbol.ontologymanager.core.OfflineConfigurationImpl in project stanbol by apache.
the class TestRegistryManager method setup.
/**
* Resets all configurations (the offline and registry manager ones).
*
* @throws Exception
*/
@BeforeClass
public static void setup() throws Exception {
configuration = new Hashtable<String, Object>();
// We need this to make sure the local meta.owl (which does not import codolight) is loaded.
configuration.put(OfflineConfiguration.ONTOLOGY_PATHS, new String[] { "/ontologies", "/ontologies/registry" });
configuration.put(RegistryManager.REGISTRY_LOCATIONS, new String[] { TestRegistryManager.class.getResource("/ontologies/registry/onmtest.owl").toString(), TestRegistryManager.class.getResource("/ontologies/registry/onmtest_additions.owl").toString() });
offline = new OfflineConfigurationImpl(configuration);
MockOsgiContext.reset();
}
use of org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl 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.stanbol.ontologymanager.core.OfflineConfigurationImpl in project stanbol by apache.
the class TestClerezzaSpaces method setup.
@BeforeClass
public static void setup() throws Exception {
offline = new OfflineConfigurationImpl(new Hashtable<String, Object>());
ScopeRegistry reg = new ScopeRegistryImpl();
// This one is created from scratch
Graph ont2 = ClerezzaOWLUtils.createOntology(baseIri2.toString());
minorSrc = new GraphSource(ont2.getImmutableGraph());
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));
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/"));
}
use of org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl in project stanbol by apache.
the class TestOntologyLibrary method setupTest.
/**
* Sets the offline configuration (identical across tests) before running the tests.
*
* @throws Exception
* if any error occurs;
*/
@BeforeClass
public static void setupTest() throws Exception {
final Dictionary<String, Object> config = new Hashtable<String, Object>();
config.put(OfflineConfiguration.ONTOLOGY_PATHS, new String[] { "/ontologies", "/ontologies/registry" });
offline = new OfflineConfigurationImpl(config);
reset();
}
Aggregations