use of org.apache.jena.query.Dataset in project jena by apache.
the class AbstractTestRDFConnection method dataset_put_1.
@Test
public void dataset_put_1() {
try (RDFConnection conn = connection()) {
conn.putDataset(dataset);
Dataset ds1 = conn.fetchDataset();
assertTrue("Datasets not isomorphic", isomorphic(dataset, ds1));
}
}
use of org.apache.jena.query.Dataset in project jena by apache.
the class AbstractTestRDFConnection method dataset_post_1.
@Test
public void dataset_post_1() {
try (RDFConnection conn = connection()) {
conn.loadDataset(dataset);
Dataset ds1 = conn.fetchDataset();
assertTrue("Datasets not isomorphic", isomorphic(dataset, ds1));
}
}
use of org.apache.jena.query.Dataset in project jena by apache.
the class AbstractTestRDFConnection method dataset_load_1.
@Test
public void dataset_load_1() {
String testDataFile = DIR + "data.trig";
try (RDFConnection conn = connection()) {
conn.loadDataset(testDataFile);
Dataset ds0 = RDFDataMgr.loadDataset(testDataFile);
Dataset ds = conn.fetchDataset();
assertTrue("Datasets not isomorphic", isomorphic(ds0, ds));
}
}
use of org.apache.jena.query.Dataset in project jena by apache.
the class AbstractTestRDFConnection method named_graph_put_1.
@Test
public void named_graph_put_1() {
try (RDFConnection conn = connection()) {
conn.put(graphName, model1);
Dataset ds1 = conn.fetchDataset();
Model m0 = conn.fetch(graphName);
assertTrue("Models not isomorphic", isomorphic(model1, ds1.getNamedModel(graphName)));
Model m = conn.fetch(graphName);
assertTrue("Models not isomorphic", isomorphic(model1, m));
}
}
use of org.apache.jena.query.Dataset in project jena by apache.
the class spatialindexer method processModulesAndArgs.
@Override
protected void processModulesAndArgs() {
super.processModulesAndArgs();
// Two forms : with and without arg.
// Maximises similarity with other tools.
String file;
if (super.contains(assemblerDescDecl)) {
if (getValues(assemblerDescDecl).size() != 1)
throw new CmdException("Multiple assembler descriptions given");
if (getPositional().size() != 0)
throw new CmdException("Additional assembler descriptions given");
file = getValue(assemblerDescDecl);
} else {
if (getNumPositional() != 1)
throw new CmdException("Multiple assembler descriptions given");
file = getPositionalArg(0);
}
if (file == null)
throw new CmdException("No dataset specified");
// Assumes a single test daatset description in the assembler file.
Dataset ds = SpatialDatasetFactory.create(file);
if (ds == null)
throw new CmdException("No dataset description found");
// get index.
dataset = (DatasetGraphSpatial) (ds.asDatasetGraph());
spatialIndex = dataset.getSpatialIndex();
if (spatialIndex == null)
throw new CmdException("Dataset has no spatial index");
context = new SpatialIndexContext(spatialIndex);
}
Aggregations