On 31/07/13 11:41, Adeeb Noor wrote:
Thanks Anday:

here is my new code and I am still getting this warning message:

04:37:02 WARN  riot                      :: Only triples or default graph
data expected : named graph data ignored


String directory = "/Users/adeebnoor/Desktop/Desktop/DDID/UMLStdb";

  Dataset dataset = TDBFactory.createDataset(directory);

  String source = "/Users/adeebnoor/Downloads/Ontologies/umls.trig";

Model m = ModelFactory.createDefaultModel() ;

  System.out.println("start loading");

  RDFDataMgr.read(m,  source);

System.out.println("done loading");

  m.close();

  dataset.close();

Am I doing something wrong?

AdeeB

No - as I described this is exactly what to expect IF you load a model with TriG.

If you want to work with named graphs, use the datasets:

        Dataset ds = TDBFactory.createDataset() ;
        RDFDataMgr.read(dataset, source) ;

(note - for what might be 100m quads, this is slow.)

Use the bulk loader for speed.

You can do it in code but I'd advise you not to do so:

DatasetGraphTDB dsg = ((DatasetGraphTransaction)dataset.asDatasetGraph()).get() ;
        TDBLoader.load(dsg, "D.trig") ;
        RDFDataMgr.write(System.out, ds, Lang.TRIG) ;

You are going behind the systems back to some extent. The script tdbloader knows all the tricks and safely does it.

        Andy





Reply via email to