use of org.apache.jena.rdf.model.Model in project jena by apache.
the class TestGraphDeltas method sparql_graph_delta_01.
/**
* Tests graph deltas calculation with SPARQL
*/
@Test
public void sparql_graph_delta_01() {
Model a = ModelFactory.createDefaultModel();
Model b = ModelFactory.createDefaultModel();
a.read(new StringReader(testData), null, "TTL");
b.read(new StringReader(testData), null, "TTL");
this.testDeltas(a, b, 0);
this.testDeltas(b, a, 0);
}
use of org.apache.jena.rdf.model.Model in project jena by apache.
the class TestGraphDeltas method sparql_graph_delta_02.
/**
* Tests graph deltas calculate with SPARQL
*/
@Test
public void sparql_graph_delta_02() {
Model a = ModelFactory.createDefaultModel();
Model b = ModelFactory.createDefaultModel();
a.read(new StringReader(testData), null, "TTL");
b.read(new StringReader(testData2), null, "TTL");
this.testDeltas(a, b, 0);
this.testDeltas(b, a, 1);
}
use of org.apache.jena.rdf.model.Model in project jena by apache.
the class GraphsTests method graph4.
@Test
public void graph4() {
Dataset ds = getDataset();
int x = query(queryString, ds.getNamedModel(Quad.unionGraph.getURI()));
assertEquals(3, x);
Model m = ds.getNamedModel(Quad.unionGraph.getURI());
m.isIsomorphicWith(calcUnion);
}
use of org.apache.jena.rdf.model.Model in project jena by apache.
the class GraphsTests method graph_api4.
@Test
public void graph_api4() {
Dataset ds = getDataset();
int x = api(ds.getNamedModel(Quad.unionGraph.getURI()));
assertEquals(3, x);
Model m = ds.getNamedModel(Quad.unionGraph.getURI());
m.isIsomorphicWith(calcUnion);
}
use of org.apache.jena.rdf.model.Model in project jena by apache.
the class UpdateTest method datasetSame.
private boolean datasetSame(Dataset ds1, Dataset ds2, boolean verbose) {
List<String> names1 = Iter.toList(ds1.listNames());
List<String> names2 = Iter.toList(ds2.listNames());
if (!names1.equals(names2)) {
if (verbose) {
System.out.println("Different named graphs");
System.out.println(" " + names1);
System.out.println(" " + names2);
}
return false;
}
if (!ds1.getDefaultModel().isIsomorphicWith(ds2.getDefaultModel())) {
if (verbose)
System.out.println("Default graphs differ");
return false;
}
for (String gn : names1) {
Model m1 = ds1.getNamedModel(gn);
Model m2 = ds2.getNamedModel(gn);
if (!m1.isIsomorphicWith(m2)) {
if (verbose)
System.out.println("Different on named graph " + gn);
return false;
}
}
return true;
}
Aggregations