Search in sources :

Example 1 with DatasetAccessor

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

the class TestDatasetAccessorHTTP method post_01.

@Test
public void post_01() {
    DatasetAccessor du = connectToService();
    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 2 with DatasetAccessor

use of org.apache.jena.query.DatasetAccessor 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());
}
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 3 with DatasetAccessor

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

the class TestDatasetAccessorHTTP method delete_03.

@Test
public void delete_03() {
    DatasetAccessor du = connectToDataset();
    du.deleteDefault();
}
Also used : DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 4 with DatasetAccessor

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

the class TestDatasetAccessorHTTP method clearup_1.

@Test
public void clearup_1() {
    DatasetAccessor du = connectToService();
    du.deleteDefault();
    du.deleteModel(gn1);
    du.deleteModel(gn2);
    du.deleteModel(gn99);
}
Also used : DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 5 with DatasetAccessor

use of org.apache.jena.query.DatasetAccessor 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());
}
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)

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