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