AGNtriplesTest.java
package com.franz.ag.examples;
import com.franz.ag.*;
public class AGNtriplesTest {
@param
@throws
public static void main(String[] args) throws AllegroGraphException {
AllegroGraphConnection ags = new AllegroGraphConnection();
try {
ags.enable();
} catch (Exception e) {
throw new AllegroGraphException("Server connection problem", e);
}
AllegroGraph ts = ags.renew("testnt", AGPaths.TRIPLE_STORES);
String ntripleFile = AGPaths.dataSources("test.nt");
System.out.println("Loading N-Triples " + ntripleFile);
long n = ts.loadNTriples(ntripleFile);
System.out.println("Loaded " + n + " triples.");
Cursor cc = ts.getStatements(null, null, null);
AGUtils.showTriples(cc);
ts.closeTripleStore();
ags.disable();
}
}
Up |
Next