use of org.apache.jena.query.Dataset in project jena by apache.
the class sdbupdate method execCmd.
@Override
protected void execCmd(List<String> positionalArgs) {
if (isVerbose())
SDB_QC.PrintSQL = true;
getStore();
Dataset dataset = getModStore().getDataset();
List<String> requestFiles = getValues(updateArg);
if (requestFiles.size() == 0 && getPositional().size() == 0)
throw new CmdException("Nothing to do");
for (String filename : requestFiles) execOneFile(filename, dataset);
for (String requestString : super.getPositional()) {
requestString = indirect(requestString);
execOne(requestString, dataset);
}
}
use of org.apache.jena.query.Dataset in project jena by apache.
the class TestAssembler method dataset_1.
@Test
public void dataset_1() {
Dataset ds = DatasetFactory.assemble(dir + "dataset.ttl");
assertNotNull(ds);
// Check it will be dispatched to SDB
DatasetGraph dsg = ds.asDatasetGraph();
assertTrue(dsg instanceof DatasetGraphSDB);
}
use of org.apache.jena.query.Dataset in project jena by apache.
the class TestAssembler method create.
private Store create(Model assem) {
// Create a store and format
Dataset ds = DatasetFactory.assemble(assem);
Store store = ((DatasetGraphSDB) ds.asDatasetGraph()).getStore();
store.getTableFormatter().create();
return store;
}
use of org.apache.jena.query.Dataset in project jena by apache.
the class ExRIOT_out2 method main.
public static void main(String[] args) {
Model model = RDFDataMgr.loadModel("D.ttl");
System.out.println();
System.out.println("#### ---- Write as TriG");
System.out.println();
// This wil be the default graph of the dataset written.
RDFDataMgr.write(System.out, model, Lang.TRIG);
// Loading Turtle as Trig reads into the default graph.
Dataset dataset = RDFDataMgr.loadDataset("D.ttl");
System.out.println();
System.out.println("#### ---- Write as NQuads");
System.out.println();
RDFDataMgr.write(System.out, dataset, Lang.NQUADS);
}
use of org.apache.jena.query.Dataset in project jena by apache.
the class DatasetStoreAssembler method open.
@Override
public Dataset open(Assembler a, Resource root, Mode mode) {
StoreDesc desc = openStore(a, root, mode);
Dataset ds = SDBFactory.connectDataset(desc);
AssemblerUtils.setContext(root, ds.getContext());
return ds;
}
Aggregations