AGTemporalDateTime.java
package com.franz.ag.examples;
import org.openrdf.model.Literal;
import com.franz.ag.AllegroGraph;
import com.franz.ag.AllegroGraphConnection;
import com.franz.ag.AllegroGraphException;
import com.franz.ag.Cursor;
public class AGTemporalDateTime {
@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("datetime", AGPaths.TRIPLE_STORES);
ts.registerNamespace("ex","http://example.org/");
Literal lit = ts.createEncodedLiteral("2000-01-01T00:00:00-00:00","date-time");
AGUtils.showLiteral(lit);
ts.addStatement("!ex:person1","!ex:birthdate", lit);
Cursor cc = ts.getStatements(null, "!ex:birthdate", lit);
AGUtils.showTriples(cc);
ts.closeTripleStore();
ags.disable();
}
}
Up |
Next