@Override protected void doApplyToNamespace(final RemoteRepository repo, final UUID uuid) throws Exception { repo.prepareUpdate(updateStr, uuid).evaluate(); }
private void dropGraph(final String namespace) throws Exception { final RemoteRepository rr = m_mgr.getRepositoryForNamespace(namespace); // force an abort by preparing an invalid update rr.prepareUpdate("DROP GRAPH <" + namespace + ">").evaluate(); }
private void forceAbort(final String namespace) throws Exception { final RemoteRepository rr = m_mgr.getRepositoryForNamespace(namespace); // force an abort by preparing an invalid update rr.prepareUpdate("FORCE ABORT").evaluate(); }
public void testLoad() throws Exception { final URL url = this.getClass().getClassLoader().getResource("com/bigdata/rdf/rio/small.rdf"); final String update = "LOAD <" + url.toExternalForm() + ">"; final String ns = "http://bigdata.com/test/data#"; m_repo.prepareUpdate(update).evaluate(); assertTrue(hasStatement(f.createURI(ns, "mike"), RDFS.LABEL, f.createLiteral("Michael Personick"), true)); }
public void testDropAll() throws Exception { // log.debug("executing testDropAll"); String update = "DROP ALL"; // Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update); // // operation.execute(); m_repo.prepareUpdate(update.toString()).evaluate(); assertFalse(hasStatement(null, null, null, false)); }
public void testClearAll() throws Exception { // log.debug("executing testClearAll"); String update = "CLEAR ALL"; // Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update); // // operation.execute(); m_repo.prepareUpdate(update.toString()).evaluate(); assertFalse(hasStatement(null, null, null, false)); }
public void testReallyLongQueryString() throws Exception { final Literal l = getReallyLongLiteral(1000); log.debug("executing test testInsertEmptyWhere"); final StringBuilder update = new StringBuilder(); update.append(getNamespaceDeclarations()); update.append("INSERT { <" + bob + "> rdfs:label " + l + " . } WHERE { }"); assertFalse(hasStatement(bob, RDFS.LABEL, l, true)); m_repo.prepareUpdate(update.toString()).evaluate(); assertTrue(hasStatement(bob, RDFS.LABEL, l, true)); }
@Override protected void doApplyToNamespace(final RemoteRepository repo, final UUID uuid) throws Exception { repo.prepareUpdate(updateStr, uuid).evaluate(); }
protected void executeInsert(String where, boolean expected) throws RepositoryException, Exception { final StringBuilder update = new StringBuilder(); update.append(getNamespaceDeclarations()); update.append("INSERT { ex:bob rdfs:label \"Bob\" . } WHERE { " + where +" }"); assertFalse(hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true)); m_repo.prepareUpdate(update.toString()).evaluate(); assertEquals(expected, hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true)); }
public void testLoadSilent() throws Exception { final String update = "LOAD SILENT <file:src/test/com/bigdata/rdf/rio/NOT-FOUND.rdf>"; final String ns = "http://bigdata.com/test/data#"; m_repo.prepareUpdate(update).evaluate(); assertFalse(hasStatement(f.createURI(ns, "mike"), RDFS.LABEL, f.createLiteral("Michael Personick"), true)); }
private void forceAbort(final String namespace) throws Exception { final RemoteRepository rr = m_mgr.getRepositoryForNamespace(namespace); // force an abort by preparing an invalid update rr.prepareUpdate("FORCE ABORT").evaluate(); }
private void dropGraph(final String namespace) throws Exception { final RemoteRepository rr = m_mgr.getRepositoryForNamespace(namespace); // force an abort by preparing an invalid update rr.prepareUpdate("DROP GRAPH <" + namespace + ">").evaluate(); }
public void testInsertWhere() throws Exception { final StringBuilder update = new StringBuilder(); update.append(getNamespaceDeclarations()); update.append("INSERT {?x rdfs:label ?y . } WHERE {?x foaf:name ?y }"); assertFalse(hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true)); assertFalse(hasStatement(alice, RDFS.LABEL, f.createLiteral("Alice"), true)); m_repo.prepareUpdate(update.toString()).evaluate(); assertTrue(hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true)); assertTrue(hasStatement(alice, RDFS.LABEL, f.createLiteral("Alice"), true)); }
public void testClearAll() throws Exception { // log.debug("executing testClearAll"); String update = "CLEAR ALL"; // Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update); // // operation.execute(); m_repo.prepareUpdate(update.toString()).evaluate(); assertFalse(hasStatement(null, null, null, false)); }
public void testLoad() throws Exception { final URL url = this.getClass().getClassLoader().getResource("com/bigdata/rdf/rio/small.rdf"); final String update = "LOAD <" + url.toExternalForm() + ">"; final String ns = "http://bigdata.com/test/data#"; m_repo.prepareUpdate(update).evaluate(); assertTrue(hasStatement(f.createURI(ns, "mike"), RDFS.LABEL, f.createLiteral("Michael Personick"), true)); }
public void testDropAll() throws Exception { // log.debug("executing testDropAll"); String update = "DROP ALL"; // Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update); // // operation.execute(); m_repo.prepareUpdate(update.toString()).evaluate(); assertFalse(hasStatement(null, null, null, false)); }
public void testReallyLongQueryString() throws Exception { final Literal l = getReallyLongLiteral(1000); log.debug("executing test testInsertEmptyWhere"); final StringBuilder update = new StringBuilder(); update.append(getNamespaceDeclarations()); update.append("INSERT { <" + bob + "> rdfs:label " + l + " . } WHERE { }"); assertFalse(hasStatement(bob, RDFS.LABEL, l, true)); m_repo.prepareUpdate(update.toString()).evaluate(); assertTrue(hasStatement(bob, RDFS.LABEL, l, true)); }
protected void executeInsert(String where, boolean expected) throws RepositoryException, Exception { final StringBuilder update = new StringBuilder(); update.append(getNamespaceDeclarations()); update.append("INSERT { ex:bob rdfs:label \"Bob\" . } WHERE { " + where +" }"); assertFalse(hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true)); m_repo.prepareUpdate(update.toString()).evaluate(); assertEquals(expected, hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true)); }
public void testLoadSilent() throws Exception { final String update = "LOAD SILENT <file:src/test/com/bigdata/rdf/rio/NOT-FOUND.rdf>"; final String ns = "http://bigdata.com/test/data#"; m_repo.prepareUpdate(update).evaluate(); assertFalse(hasStatement(f.createURI(ns, "mike"), RDFS.LABEL, f.createLiteral("Michael Personick"), true)); }
public void testInsertWhere() throws Exception { final StringBuilder update = new StringBuilder(); update.append(getNamespaceDeclarations()); update.append("INSERT {?x rdfs:label ?y . } WHERE {?x foaf:name ?y }"); assertFalse(hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true)); assertFalse(hasStatement(alice, RDFS.LABEL, f.createLiteral("Alice"), true)); m_repo.prepareUpdate(update.toString()).evaluate(); assertTrue(hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true)); assertTrue(hasStatement(alice, RDFS.LABEL, f.createLiteral("Alice"), true)); }