The code you are using only reads the default graph as the warning message
implies

If you wish to read quad formats use the newer RDFDataMgr APIs instead
(see http://jena.apache.org/documentation/io/rdf-input.html for an
overview), specifically for your case you want to do the following:

RDFDataMgr.read(dataset, source);

Your code is only a fragment but if you aren't already I suggest using the
TDB transaction APIs
(http://jena.apache.org/documentation/tdb/tdb_transactions.html) to wrap
this operation in a write transaction remembering to commit() after the
read() call.

Rob

On 21/01/2014 11:13, "Adeeb Noor" <[email protected]> wrote:

>I have a NQuads file that I want to store it inside the tdb. Here is the
>code:
>
>String directory =
>"/Users/adeebnoor/Documents/uploadDatasets/dataSetsTDB/new";
>
> Dataset dataset = TDBFactory.createDataset(directory);
>
>Model tdb = dataset.getDefaultModel();
>
>   String source =
>"/Users/adeebnoor/Documents/uploadDatasets/dataSource/drugbank_target_ids.
>nq"
>;
>
> FileManager.get().readModel(tdb, source);
>
>  System.out.println("Done");
>when I run the code above , I got this warning:
>
>12:05:58 WARN  riot                      :: Only triples or default graph
>data expected : named graph data ignored
>
>and when I tried to query the tdb, the result is empty.
>
>Am I doing something wrong here ? or is there another way to handle
>the NQuads format.
>
>thanks
>
>-- 
>Adeeb Noor
>Ph.D. Candidate
>Dept of Computer Science
>University of Colorado at Boulder
>Cell: 571-484-3303
>Email: [email protected]




Reply via email to