Search in sources :

Example 21 with DatasetAccessor

use of org.apache.jena.query.DatasetAccessor in project jena by apache.

the class TestDatasetAccessorHTTP method test_404_1.

@Test
public void test_404_1() {
    // Not the right service.
    DatasetAccessor du = DatasetAccessorFactory.createHTTP(datasetURI_not_1);
    Model graph = du.getModel(gn99);
    assertNull(graph);
}
Also used : Model(org.apache.jena.rdf.model.Model) DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 22 with DatasetAccessor

use of org.apache.jena.query.DatasetAccessor in project jena by apache.

the class TestDatasetAccessorHTTP method post_03.

@Test
public void post_03() {
    DatasetAccessor du = connectToDataset();
    du.putModel(model1);
    // POST appends
    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());
}
Also used : Model(org.apache.jena.rdf.model.Model) DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 23 with DatasetAccessor

use of org.apache.jena.query.DatasetAccessor in project jena by apache.

the class TestDatasetAccessorHTTP method put_01.

@Test
public void put_01() {
    DatasetAccessor du = connectToService();
    du.putModel(model1);
    Model graph = du.getModel();
    assertTrue(graph.isIsomorphicWith(model1));
    // Empty it.
    du.deleteDefault();
    graph = du.getModel();
    assertTrue(graph.isEmpty());
}
Also used : Model(org.apache.jena.rdf.model.Model) DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 24 with DatasetAccessor

use of org.apache.jena.query.DatasetAccessor in project jena by apache.

the class TestDatasetAccessorHTTP method get_02.

@Test
public void get_02() {
    DatasetAccessor du = connectToService();
    Model graph = du.getModel(gn1);
    assertNull(graph);
}
Also used : Model(org.apache.jena.rdf.model.Model) DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 25 with DatasetAccessor

use of org.apache.jena.query.DatasetAccessor in project jena by apache.

the class TestDatasetAccessorHTTP method head_02.

@Test
public void head_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 (1)", exists);
    exists = du.containsModel(gn2);
    assertFalse("Expected gn2 not to exist (2)", exists);
    // Clearup
    du.deleteModel(gn1);
}
Also used : DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Aggregations

DatasetAccessor (org.apache.jena.query.DatasetAccessor)32 Test (org.junit.Test)31 AbstractFusekiTest (org.apache.jena.fuseki.AbstractFusekiTest)21 FusekiTest (org.apache.jena.fuseki.FusekiTest)21 Model (org.apache.jena.rdf.model.Model)20 AuthScope (org.apache.http.auth.AuthScope)2