public void test_INSERT_triples_with_BODY_and_defaultContext() throws Exception { if(TestMode.quads != getTestMode()) return; final String resource = packagePath + "insert_triples_with_defaultContext.ttl"; final Graph g = loadGraphFromResource(resource); // Load the resource into the KB. doInsertByBody("POST", RDFFormat.TURTLE, g, new URIImpl( "http://example.org")); // Verify that the data were inserted into the appropriate context. { final String queryStr = "select * { GRAPH <http://example.org> {?s ?p ?p} }"; final TupleQuery query = cxn.prepareTupleQuery(QueryLanguage.SPARQL, queryStr); assertEquals(7, countResults(query.evaluate())); } }
doInsertByBody("POST", RDFFormat.RDFXML, g, null/* defaultContext */));
public void test_INSERT_triples_with_BODY_and_defaultContext() throws Exception { if(TestMode.quads != getTestMode()) return; final String resource = packagePath + "insert_triples_with_defaultContext.ttl"; final Graph g = loadGraphFromResource(resource); // Load the resource into the KB. doInsertByBody("POST", RDFFormat.TURTLE, g, new URIImpl( "http://example.org")); // Verify that the data were inserted into the appropriate context. { final String queryStr = "select * { GRAPH <http://example.org> {?s ?p ?p} }"; final TupleQuery query = cxn.prepareTupleQuery(QueryLanguage.SPARQL, queryStr); assertEquals(7, countResults(query.evaluate())); } }
doInsertByBody("POST", RDFFormat.RDFXML, g, null/* defaultContext */));