Search in sources :

Example 1 with ClerezzaCollectorFactory

use of org.apache.stanbol.ontologymanager.multiplexer.clerezza.collector.ClerezzaCollectorFactory 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 2 with ClerezzaCollectorFactory

use of org.apache.stanbol.ontologymanager.multiplexer.clerezza.collector.ClerezzaCollectorFactory 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)

Aggregations

ClerezzaCollectorFactory (org.apache.stanbol.ontologymanager.multiplexer.clerezza.collector.ClerezzaCollectorFactory)2 ClerezzaOntologyProvider (org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider)2 File (java.io.File)1 Hashtable (java.util.Hashtable)1 Graph (org.apache.clerezza.commons.rdf.Graph)1 TcManager (org.apache.clerezza.rdf.core.access.TcManager)1 SimpleTcProvider (org.apache.clerezza.rdf.simple.storage.SimpleTcProvider)1 OfflineConfigurationImpl (org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl)1 ScopeRegistryImpl (org.apache.stanbol.ontologymanager.core.scope.ScopeRegistryImpl)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 BeforeClass (org.junit.BeforeClass)1 OWLClass (org.semanticweb.owlapi.model.OWLClass)1 OWLDataFactory (org.semanticweb.owlapi.model.OWLDataFactory)1 OWLIndividual (org.semanticweb.owlapi.model.OWLIndividual)1