Search in sources :

Example 1 with OfflineConfigurationImpl

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);
}
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 2 with OfflineConfigurationImpl

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();
}
Also used : OfflineConfigurationImpl(org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl) BeforeClass(org.junit.BeforeClass)

Example 3 with OfflineConfigurationImpl

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);
}
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 4 with OfflineConfigurationImpl

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/"));
}
Also used : Hashtable(java.util.Hashtable) OfflineConfigurationImpl(org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl) ClerezzaOntologyProvider(org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider) Graph(org.apache.clerezza.commons.rdf.Graph) ScopeRegistryImpl(org.apache.stanbol.ontologymanager.core.scope.ScopeRegistryImpl) GraphSource(org.apache.stanbol.ontologymanager.sources.clerezza.GraphSource) ParentPathInputSource(org.apache.stanbol.ontologymanager.sources.owlapi.ParentPathInputSource) OWLClass(org.semanticweb.owlapi.model.OWLClass) OWLDataFactory(org.semanticweb.owlapi.model.OWLDataFactory) File(java.io.File) ScopeRegistry(org.apache.stanbol.ontologymanager.servicesapi.scope.ScopeRegistry) OWLIndividual(org.semanticweb.owlapi.model.OWLIndividual) ClerezzaCollectorFactory(org.apache.stanbol.ontologymanager.multiplexer.clerezza.collector.ClerezzaCollectorFactory) BeforeClass(org.junit.BeforeClass)

Example 5 with OfflineConfigurationImpl

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();
}
Also used : Hashtable(java.util.Hashtable) OfflineConfigurationImpl(org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl) BeforeClass(org.junit.BeforeClass)

Aggregations

OfflineConfigurationImpl (org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl)5 Hashtable (java.util.Hashtable)4 BeforeClass (org.junit.BeforeClass)4 SimpleTcProvider (org.apache.clerezza.rdf.simple.storage.SimpleTcProvider)2 ClerezzaOntologyProvider (org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider)2 File (java.io.File)1 Graph (org.apache.clerezza.commons.rdf.Graph)1 ScopeManagerImpl (org.apache.stanbol.ontologymanager.core.scope.ScopeManagerImpl)1 ScopeRegistryImpl (org.apache.stanbol.ontologymanager.core.scope.ScopeRegistryImpl)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 ScopeRegistry (org.apache.stanbol.ontologymanager.servicesapi.scope.ScopeRegistry)1 GraphSource (org.apache.stanbol.ontologymanager.sources.clerezza.GraphSource)1 ParentPathInputSource (org.apache.stanbol.ontologymanager.sources.owlapi.ParentPathInputSource)1 Before (org.junit.Before)1 OWLClass (org.semanticweb.owlapi.model.OWLClass)1 OWLDataFactory (org.semanticweb.owlapi.model.OWLDataFactory)1 OWLIndividual (org.semanticweb.owlapi.model.OWLIndividual)1