use of fr.lirmm.graphik.graal.store.rdbms.RdbmsStore in project graal by graphik-team.
the class StoreTest method caseSensitivityTest.
@Theory
public void caseSensitivityTest(AtomSet store) throws AtomSetException, IteratorException, ParseException, SQLException {
Assume.assumeTrue(!(store instanceof RdbmsStore) || ((RdbmsStore) store).getDriver().isCaseSensitive());
Atom toAdd = DlgpParser.parseAtom("<P>(a,b).");
Atom toCheck = DlgpParser.parseAtom("<p>(a,b).");
Predicate predicateToCheck = new Predicate("p", 2);
store.add(toAdd);
Assert.assertTrue(store.contains(toAdd));
Assert.assertFalse(store.contains(toCheck));
CloseableIterator<?> it = store.termsByPredicatePosition(predicateToCheck, 0);
Assert.assertFalse(it.hasNext());
it = store.atomsByPredicate(predicateToCheck);
Assert.assertFalse(it.hasNext());
it = store.match(DlgpParser.parseAtom("<p>(X,Y)."));
Assert.assertFalse(it.hasNext());
}
use of fr.lirmm.graphik.graal.store.rdbms.RdbmsStore 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 };
}
Aggregations