use of org.apache.jena.rdf.model.Model in project jena by apache.
the class TestDatasetAccessorHTTP method put_03.
@Test
public void put_03() {
DatasetAccessor du = connectToService();
du.putModel(model1);
// PUT overwrites
du.putModel(model2);
Model graph = du.getModel();
assertFalse(graph.isIsomorphicWith(model1));
assertTrue(graph.isIsomorphicWith(model2));
// Empty it.
du.deleteDefault();
graph = du.getModel();
assertTrue(graph.isEmpty());
}
use of org.apache.jena.rdf.model.Model in project jena by apache.
the class TestDatasetAccessorHTTP method post_02.
@Test
public void post_02() {
DatasetAccessor du = connectToService();
du.add(model1);
du.add(model2);
Model graph = du.getModel();
Model graph3 = ModelFactory.createDefaultModel();
graph3.add(model1);
graph3.add(model2);
assertFalse(graph.isIsomorphicWith(model1));
assertFalse(graph.isIsomorphicWith(model2));
assertTrue(graph.isIsomorphicWith(graph3));
// Empty it.
du.deleteDefault();
graph = du.getModel();
assertTrue(graph.isEmpty());
}
use of org.apache.jena.rdf.model.Model in project jena by apache.
the class TestDatasetAccessorHTTP method put_02.
@Test
public void put_02() {
DatasetAccessor du = connectToService();
du.putModel(gn1, model1);
boolean exists = du.containsModel(gn1);
assertTrue(exists);
exists = du.containsModel(gn2);
assertFalse("Expected gn2 not to exist", exists);
Model graph = du.getModel();
assertTrue(graph.isEmpty());
graph = du.getModel(gn1);
assertTrue(graph.isIsomorphicWith(model1));
du.deleteModel(gn1);
exists = du.containsModel(gn1);
assertFalse("Expected gn1 not to exist", exists);
graph = du.getModel(gn1);
assertNull(graph);
}
use of org.apache.jena.rdf.model.Model in project jena by apache.
the class TestDatasetAccessorHTTP method get_04.
@Test
public void get_04() {
DatasetAccessor du = connectToDataset();
Model graph = du.getModel(gn1);
assertNull(graph);
}
use of org.apache.jena.rdf.model.Model in project jena by apache.
the class TestDatasetAccessorHTTP method test_404_3.
@Test
public void test_404_3() {
// Right service, wrong graph
DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP());
Model graph = du.getModel(gn99);
assertNull(graph);
}
Aggregations