



 Learning Center Documentation Updates • Info FAQ

| AGNamespaceRegistries.javapackage com.franz.ag.examples;
import com.franz.ag.*;
public class AGNamespaceRegistries {
@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);
}
AGUtils.printStringArray("AGS Namespaces (initially):",ags.getNamespaces());
AllegroGraph ts = ags.renew("namespaces", AGPaths.TRIPLE_STORES);
AGUtils.printStringArray("TS Namespaces (initially):",ts.getNamespaces());
ags.registerNamespace("ns1", "http://www.example.com/ns1#");
ts.registerNamespace("ns2", "http://www.example.com/ns2#");
AGUtils.printStringArray("AGS Namespaces (added ns1):",ags.getNamespaces());
AGUtils.printStringArray("TS Namespaces: (added ns2)",ts.getNamespaces());
ts.registerNamespace("ns1", "http://www.example.com/ns1a#");
ts.registerNamespace("ns2", null);
AGUtils.printStringArray("TS Namespaces: (redefined ns1, removed ns2)",ts.getNamespaces());
ts.closeTripleStore();
ags.disable();
}
}
Up |
Next
© 2008 Franz Inc - Privacy Statement
[ Consulting Services
| Franz
| TopQuadrant
| Racer Systems
]
|