AGCreateURI.java
package com.franz.agbase.examples;
import com.franz.agbase.*;
public class AGCreateURI {
@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("createuri", AGPaths.TRIPLE_STORES);
URINode subject = ts.createURI("http://example.org/Dog");
URINode predicate = ts.createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
URINode object = ts.createURI("http://www.w3.org/2002/07/owl#Class");
AGUtils.showURI(subject);
AGUtils.showURI(predicate);
AGUtils.showURI(object);
ts.addStatement(subject, predicate, object);
URINode u = (URINode)ts.addURI("http://www.w3.org/2002/07/owl#Class");
AGUtils.showURI(u);
URINode v = (URINode)ts.addPart("<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>");
AGUtils.showURI(v);
ts.closeTripleStore();
ags.disable();
}
}
Up |
Next