AGLoadStoreInThread.java
package com.franz.ag.examples;
import com.franz.ag.*;
public class AGLoadStoreInThread extends Thread {
String store;
String file;
AGLoadStoreInThread(String store, String file) {
this.store = store;
this.file = file;
}
public void run() {
AllegroGraphConnection ags = new AllegroGraphConnection();
try {
ags.enable();
AllegroGraph ts = ags.renew(store, AGPaths.TRIPLE_STORES);
System.out.println("Loading " + store + " from " + file);
Long n = ts.loadNTriples(file);
System.out.println("Loaded " + n + " triples into " + store);
ts.closeTripleStore();
ags.disable();
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
@param
@throws
public static void main(String[] args) throws AllegroGraphException {
String file = AGPaths.dataSources("kennedy.ntriples");
AGLoadStoreInThread p1 = new AGLoadStoreInThread("store1", file);
AGLoadStoreInThread p2 = new AGLoadStoreInThread("store2", file);
p1.start();
p2.start();
}
}
Up |
Next