AGWilburwine.java
package com.franz.agbase.examples;
import com.franz.agbase.*;
public class AGWilburwine {
@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("wilburwine", AGPaths.TRIPLE_STORES);
AGLoadNtriples.loadNTriplesWithTiming(ts,AGPaths.dataSources("wilburwine.ntriples"));
AGIndexAllTriples.indexAllTriplesWithTiming(ts);
ts.registerNamespace("wine", "http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine#");
System.out.println("Triples with Subject: CabernetSauvignonGrape");
TriplesIterator cc = ts.getStatements("!wine:CabernetSauvignonGrape",null, null);
AGUtils.showTriples(cc);
ts.closeTripleStore();
ags.disable();
}
}
Up |
Next