Search in sources :

Example 1 with Dataset

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);
    }
}
Also used : CmdException(jena.cmd.CmdException) Dataset(org.apache.jena.query.Dataset)

Example 2 with 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);
}
Also used : Dataset(org.apache.jena.query.Dataset) DatasetGraphSDB(org.apache.jena.sdb.store.DatasetGraphSDB) DatasetGraph(org.apache.jena.sparql.core.DatasetGraph) Test(org.junit.Test)

Example 3 with Dataset

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;
}
Also used : Dataset(org.apache.jena.query.Dataset) DatasetGraphSDB(org.apache.jena.sdb.store.DatasetGraphSDB) Store(org.apache.jena.sdb.Store)

Example 4 with Dataset

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);
}
Also used : Dataset(org.apache.jena.query.Dataset) Model(org.apache.jena.rdf.model.Model)

Example 5 with Dataset

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;
}
Also used : StoreDesc(org.apache.jena.sdb.StoreDesc) Dataset(org.apache.jena.query.Dataset)

Aggregations

Dataset (org.apache.jena.query.Dataset)725 Test (org.junit.Test)401 Model (org.apache.jena.rdf.model.Model)173 Ignore (org.junit.Ignore)93 URI (java.net.URI)80 Resource (org.apache.jena.rdf.model.Resource)70 QueryExecution (org.apache.jena.query.QueryExecution)53 ArrayList (java.util.ArrayList)46 QuerySolution (org.apache.jena.query.QuerySolution)46 ResultSet (org.apache.jena.query.ResultSet)45 WonNodeInformationService (won.protocol.service.WonNodeInformationService)28 Statement (org.apache.jena.rdf.model.Statement)26 Node (org.apache.jena.graph.Node)23 InputStream (java.io.InputStream)22 RDFNode (org.apache.jena.rdf.model.RDFNode)21 RdfUtils (won.protocol.util.RdfUtils)19 WonMessage (won.protocol.message.WonMessage)17 Literal (org.apache.jena.rdf.model.Literal)16 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)16 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)16