Jena TDB , see how many triple stored during tdb creation -
Is it possible to see the number of triples in storage during tdb creation with Hi-Java API? I run the TDB factory with a RR file in Turtle, but while creating a file in my directory, I can not see how many triples it has stored. How do I solve this problem?
You can view the bulk codes via a Java code (triples are presented for viewing):
< Pre class = "lang-java prettyprint-override"> final dataset tdbdataset = TDBFactory.createDataset (/ * location * /); Try (in the last inputstream = / * Get input stream for your large file * /) {TDBLoader.load ((DatasetGraphTransaction) tdbDataset.asDatasetGraph ()). GetBaseDatasetGraph (), in, right); }
If you have multiple files in your archive (for simplicity, I will not rear, rather a zip), then you can customize the performance by adding files together One file before passing the bulk loader Until all triples are presented, the delay in construction of the index raises better performance. I'm sure there are other formats that are supported but I've only tested N-TRIPLES
IOUtils Uses
commons-io
from:
last dataset tdb dataset = TDBFactory.createDataset (/ * location * /); Last pipe otputstream concatuit = new pipeoutputstream (); The final pipeline stream consign = new pipe intestust (cockat); Final Executor Service Worker = Exporter. NiffixTraderpool (2); The Final Future & lt; Long & gt; Submitter = workers.submit (new callable & lt; long & gt; () {@ Override public long call ()) throws exceptions {long files loaded = 0; Try (Last zipfile zipfile = new zipfile (/ * space * /) {final count & lt ;? ZipEntry & gt; zipEntries = zipFile.entries (); while (ZipEntrieskhasMoreElements ()) {final zip Entry entry = Jipintryjh. Anakstilement (); try (last Inputstrym single sign = Jipfailkjet Inputstrym (entry)) {// if already IOUtilskcopy (single in your file in a supported format, Coktat); / * (final model M = ModelFactory.createDefaultModel (); m.read (single in, empty, "l ;); M.write (concatout, "N-TRIPLES"); * /} FilesLoaded ++;}} concatOut.close (); Return files loaded;}}); Last futuristic & nt; null & gt; ; comitter = workers.subm it (new calls & lt; null & gt; () {@ override public Whoid call) exception {TDB loader. load ((Detasetgraft transactions) tdb datasets. Detadet graph ()). GetBaseDatasetGraph ( ), ConcatIn, true); Return tap; }}); Workers.shutdown (); System.out.println ("Submit" + submitter.get () + "Input Files for Processing"); Comitter.get (); System.out.println ("full resource"); Workers Waiting time (1, time unit. SECONDS); // Note this wait is redundant
Comments
Post a Comment