package edu.isi.karma.rdf;

import java.io.File;

import com.uwyn.jhighlight.tools.FileUtils;

import edu.isi.karma.er.helper.TripleStoreUtil;
import edu.isi.karma.webserver.KarmaException;

public class LoadRDFToTripleStore {
	
	public static void main(String args[]) throws KarmaException {
		TripleStoreUtil util = new TripleStoreUtil();
		if (args.length < 3)
			return;
		File file = new File(args[0]);
		String context = args[1];
		String tripleStoreUrl = args[2];
		if (file.isDirectory()) {
			File[] files = file.listFiles();
			for (File f : files) {
				System.out.println(FileUtils.getExtension(f.getName()));
				if (FileUtils.getExtension(f.getName()) != null && FileUtils.getExtension(f.getName()).compareTo("ttl") == 0)
					util.saveToStore(f.getAbsolutePath(), tripleStoreUrl, context, false, null);
			}
		}
		else {
			if (FileUtils.getExtension(file.getName()) != null && FileUtils.getExtension(file.getName()).compareTo("ttl") == 0)
				util.saveToStore(file.getAbsolutePath(), tripleStoreUrl, context, false, null);
		}
	}
}

@@ -265,30 +265,8 @@
 s%5B%5D)
- throws KarmaException
  %7B%0A%09
@@ -703,24 +703,36 @@
 ttl%22) == 0)%0A
+%09%09%09%09%09try %7B%0A%09
 %09%09%09%09%09util.sa
@@ -801,16 +801,99 @@
  null);%0A
+%09%09%09%09%09%7D catch (KarmaException e) %7B%0A%09%09%09%09%09%09System.err.println(e.getMessage());%0A%09%09%09%09%09%7D%0A
 %09%09%09%7D%0A%09%09%7D
@@ -1017,24 +1017,35 @@
 ttl%22) == 0)%0A
+%09%09%09%09try %7B%0A%09
 %09%09%09%09util.sav
@@ -1116,16 +1116,96 @@
  null);%0A
+%09%09%09%09%7D catch (KarmaException e) %7B%0A%09%09%09%09%09System.err.println(e.getMessage());%0A%09%09%09%09%7D%0A
 %09%09%7D%0A%09%7D%0A%7D

Save to store skip failed files