AGCreatingTriples.java
package com.franz.ag.examples;
import com.franz.ag.*;
public class AGCreatingTriples {
@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("creatingtriples", AGPaths.TRIPLE_STORES);
ts.addStatement("<http://example.org/Dog>",
"<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
"<http://www.w3.org/2002/07/owl#Class>");
Triple tr = ts.newTriple("<http://example.org/Dog>",
"<http://www.w3.org/2000/01/rdf-schema#subClassOf>",
"<http://example.org/Mammal>");
System.out.println("Created and added the following triple to the store:");
AGUtils.showTriple(tr);
ts.closeTripleStore();
ags.disable();
}
}
Up |
Next