AGFreetextIndex.java
package com.franz.ag.examples;
import com.franz.ag.*;
public class AGFreetextIndex {
@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("kennedy", AGPaths.TRIPLE_STORES);
ts.registerFreetextPredicate("<http://example.org/kennedy/first-name>");
String[] ftpreds = ts.getFreetextPredicates();
AGUtils.printStringArray("getFreetextPredicates:", ftpreds);
AGUtils.loadNTriplesWithTiming(ts, AGPaths.dataSources("kennedy.ntriples"));
ts.indexAllTriples(true);
Cursor cc = ts.getFreetextStatements("'Arnold'");
AGUtils.showTriples(cc);
ts.closeTripleStore();
ags.disable();
}
}
Up |
Next