Search in sources :

Example 6 with DatasetAccessor

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

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

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

the class TestDatasetAccessorHTTP method head_01.

@Test
public void head_01() {
    DatasetAccessor du = connectToService();
    boolean b = du.containsModel(gn1);
    assertFalse("Blank remote dataset as a named graph", b);
}
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 9 with DatasetAccessor

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

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

the class TestDatasetAccessorHTTP method test_404_2.

@Test
public void test_404_2() {
    DatasetAccessor du = DatasetAccessorFactory.createHTTP(datasetURI_not_2);
    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)

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