Search in sources :

Example 1 with AdHocRdbmsStore

use of fr.lirmm.graphik.graal.store.rdbms.adhoc.AdHocRdbmsStore in project graal by graphik-team.

the class TestUtil method getAtomSet.

public static AtomSet[] getAtomSet() {
    if (neo4jStore != null) {
        neo4jStore.close();
    }
    try {
        if (defaultRDBMSStore != null) {
            defaultRDBMSStore.close();
        }
        if (plainTableRDBMSStore != null) {
            plainTableRDBMSStore.close();
        }
        defaultRDBMSStore = new AdHocRdbmsStore(new HSQLDBDriver(DEFAULT_RDBMS_TEST, null));
        plainTableRDBMSStore = new NaturalRDBMSStore(new HSQLDBDriver(PLAIN_TABLE_RDBMS_TEST, null));
        defaultRDBMSStore.clear();
        plainTableRDBMSStore.clear();
        rm(NEO4J_TEST);
        neo4jStore = new Neo4jStore(NEO4J_TEST);
        if (sailStore != null) {
            sailStore.close();
        }
        try {
            sailStore = new RDF4jStore(new SailRepository(new MemoryStore()));
        } catch (AtomSetException e) {
            Assert.assertTrue("Error while creating SailStore", false);
        }
        return new AtomSet[] { new DefaultInMemoryGraphStore(), new LinkedListAtomSet(), defaultRDBMSStore, plainTableRDBMSStore, neo4jStore, sailStore };
    } catch (SQLException e) {
        throw new Error(e);
    } catch (AtomSetException e) {
        throw new Error(e);
    }
}
Also used : Neo4jStore(fr.lirmm.graphik.graal.store.gdb.Neo4jStore) RDF4jStore(fr.lirmm.graphik.graal.store.triplestore.rdf4j.RDF4jStore) SailRepository(org.eclipse.rdf4j.repository.sail.SailRepository) SQLException(java.sql.SQLException) LinkedListAtomSet(fr.lirmm.graphik.graal.core.atomset.LinkedListAtomSet) AtomSet(fr.lirmm.graphik.graal.api.core.AtomSet) LinkedListAtomSet(fr.lirmm.graphik.graal.core.atomset.LinkedListAtomSet) IOError(java.io.IOError) NaturalRDBMSStore(fr.lirmm.graphik.graal.store.rdbms.natural.NaturalRDBMSStore) AdHocRdbmsStore(fr.lirmm.graphik.graal.store.rdbms.adhoc.AdHocRdbmsStore) MemoryStore(org.eclipse.rdf4j.sail.memory.MemoryStore) AtomSetException(fr.lirmm.graphik.graal.api.core.AtomSetException) HSQLDBDriver(fr.lirmm.graphik.graal.store.rdbms.driver.HSQLDBDriver) DefaultInMemoryGraphStore(fr.lirmm.graphik.graal.core.atomset.graph.DefaultInMemoryGraphStore)

Example 2 with AdHocRdbmsStore

use of fr.lirmm.graphik.graal.store.rdbms.adhoc.AdHocRdbmsStore in project graal by graphik-team.

the class TestUtil method getStores.

public static RdbmsStore[] getStores() {
    if (defaultRdbms != null) {
        try {
            defaultRdbms.getDriver().getConnection().createStatement().executeQuery("DROP SCHEMA PUBLIC CASCADE");
        } catch (SQLException e) {
            throw new Error(e);
        }
        defaultRdbms.close();
    }
    if (plainTableRdbms != null) {
        try {
            plainTableRdbms.getDriver().getConnection().createStatement().executeQuery("DROP SCHEMA PUBLIC CASCADE");
        } catch (SQLException e) {
            throw new Error(e);
        }
        plainTableRdbms.close();
    }
    try {
        defaultRdbms = new AdHocRdbmsStore(new HSQLDBDriver(DEFAULT_TEST, null));
        plainTableRdbms = new NaturalRDBMSStore(new HSQLDBDriver(PLAIN_TABLE_TEST, null));
    } catch (AtomSetException e) {
        throw new Error(e);
    } catch (SQLException e) {
        throw new Error(e);
    }
    return new RdbmsStore[] { defaultRdbms, plainTableRdbms };
}
Also used : SQLException(java.sql.SQLException) AtomSetException(fr.lirmm.graphik.graal.api.core.AtomSetException) HSQLDBDriver(fr.lirmm.graphik.graal.store.rdbms.driver.HSQLDBDriver) RdbmsStore(fr.lirmm.graphik.graal.store.rdbms.RdbmsStore) AdHocRdbmsStore(fr.lirmm.graphik.graal.store.rdbms.adhoc.AdHocRdbmsStore) NaturalRDBMSStore(fr.lirmm.graphik.graal.store.rdbms.natural.NaturalRDBMSStore) AdHocRdbmsStore(fr.lirmm.graphik.graal.store.rdbms.adhoc.AdHocRdbmsStore)

Aggregations

AtomSetException (fr.lirmm.graphik.graal.api.core.AtomSetException)2 AdHocRdbmsStore (fr.lirmm.graphik.graal.store.rdbms.adhoc.AdHocRdbmsStore)2 HSQLDBDriver (fr.lirmm.graphik.graal.store.rdbms.driver.HSQLDBDriver)2 NaturalRDBMSStore (fr.lirmm.graphik.graal.store.rdbms.natural.NaturalRDBMSStore)2 SQLException (java.sql.SQLException)2 AtomSet (fr.lirmm.graphik.graal.api.core.AtomSet)1 LinkedListAtomSet (fr.lirmm.graphik.graal.core.atomset.LinkedListAtomSet)1 DefaultInMemoryGraphStore (fr.lirmm.graphik.graal.core.atomset.graph.DefaultInMemoryGraphStore)1 Neo4jStore (fr.lirmm.graphik.graal.store.gdb.Neo4jStore)1 RdbmsStore (fr.lirmm.graphik.graal.store.rdbms.RdbmsStore)1 RDF4jStore (fr.lirmm.graphik.graal.store.triplestore.rdf4j.RDF4jStore)1 IOError (java.io.IOError)1 SailRepository (org.eclipse.rdf4j.repository.sail.SailRepository)1 MemoryStore (org.eclipse.rdf4j.sail.memory.MemoryStore)1