@Override protected int countQueryResults(String query) throws Exception { query = "PREFIX ex: <http://example.org/> PREFIX rdf: <"+RDF.NAMESPACE+"> PREFIX rdfs: <"+RDFS.NAMESPACE+"> " + query; return countElements(evaluate(query, con)); }
@Override protected int countQueryResults(String query) throws Exception { query = "PREFIX ex: <http://example.org/> PREFIX rdf: <"+RDF.NAMESPACE+"> PREFIX rdfs: <"+RDFS.NAMESPACE+"> " + query; return countElements(evaluate(query, con)); }
assertEquals(nexpected, countElements(queryResult)); Runnable clearer = new Runnable() {
/** * Modified to test SPARQL instead of Serql. */ @Override public void testEmptyRepository() throws Exception { // repository should be empty assertEquals("Empty repository should not return any statements", 0, countAllElements()); assertEquals("Named context should be empty", 0, countContext1Elements()); assertEquals("Empty repository should not return any context identifiers", 0, countElements(con.getContextIDs())); assertEquals("Empty repository should not return any query results", 0, countQueryResults("select * where { ?S ?P ?O }")); }
assertEquals(nexpected, countElements(queryResult)); Runnable clearer = new Runnable() {
/** * Modified to test SPARQL instead of Serql. */ @Override public void testEmptyRepository() throws Exception { // repository should be empty assertEquals("Empty repository should not return any statements", 0, countAllElements()); assertEquals("Named context should be empty", 0, countContext1Elements()); assertEquals("Empty repository should not return any context identifiers", 0, countElements(con.getContextIDs())); assertEquals("Empty repository should not return any query results", 0, countQueryResults("select * where { ?S ?P ?O }")); }
assertEquals(3, countElements(con.getStatements(null, RDF.TYPE, RDFS.CLASS, false))); assertEquals(2, countElements(con.getStatements(null, RDF.TYPE, RDF.PROPERTY, false)));
assertEquals(3, countElements(con.getStatements(null, RDF.TYPE, RDFS.CLASS, false))); assertEquals(2, countElements(con.getStatements(null, RDF.TYPE, RDF.PROPERTY, false)));
assertEquals("Repository should have 1 context identifier", 1, countElements(con.getContextIDs()));
assertEquals("Repository should have 1 context identifier", 1, countElements(con.getContextIDs()));