AGLoadWithDatatypeMapping.java
package com.franz.ag.examples;
import com.franz.ag.*;
public class AGLoadWithDatatypeMapping {
@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("datamapping", AGPaths.TRIPLE_STORES);
String[] map = new String[3];
map[0] = "http://www.w3.org/2000/01/XMLSchema#dateTime";
map[1] = "date-time";
map[2] = "datatype";
ts.addDataMapping(map);
AGUtils.loadNTriplesWithTiming(ts, AGPaths.dataSources("temporal.nt"));
AGUtils.indexAllTriplesWithTiming(ts);
ts.registerNamespace("ex", "http://example.org/");
ts.registerNamespace("t", "http://franz.com/ns/allegrograph/3.0/temporal/");
Cursor cc = ts.getStatements(null, "!t:time", null);
AGUtils.showTriples(cc);
ts.closeTripleStore();
ags.disable();
}
}
Up |
Next