I have a problem about registering namespace in AllegroGraph.
My Java code (program 1):
AllegroGraphConnection agc = new AllegroGraphConnection();
agc.enable();
AllegroGraph ag = agc.create("test", AGPaths.TRIPLE_STORES);
AGUtils.printStringArray("AG Namespaces (initially):", ag.getNamespaces());
ag.registerNamespace("foaf","http://xmlns.com/foaf/0.1/");
ag.registerNamespace("dc", "http://purl.org/dc/elements/1.1/");
ag.registerNamespace("dct", "http://purl.org/dc/terms/");
ag.registerNamespace("exif","http://www.w3.org/2003/12/exif/ns#");
ag.registerNamespace("prf", "http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-2007511#");
AGUtils.printStringArray("AG Namespaces (registed):", ag.getNamespaces());
Run, And the result(program 1):
AG Namespaces (initially):
0: rdf
1: http://www.w3.org/1999/02/22-rdf-syntax-ns#
2: rdfs
3: http://www.w3.org/2000/01/rdf-schema#
4: owl
5: http://www.w3.org/2002/07/owl#
AG Namespaces (registered):
0: rdf
1: http://www.w3.org/1999/02/22-rdf-syntax-ns#
2: rdfs
3: http://www.w3.org/2000/01/rdf-schema#
4: owl
5: http://www.w3.org/2002/07/owl#
6: foaf
7: http://xmlns.com/foaf/0.1/
8: dc
9: http://purl.org/dc/elements/1.1/
10: dct
11: http://purl.org/dc/terms/
12: exif
13: http://www.w3.org/2003/12/exif/ns#
14: prf
15: http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-2007511#
Then, my Java code (program 2):
AllegroGraphConnection agc = new AllegroGraphConnection();
agc.enable();
AllegroGraph ag = agc.open("test", AGPaths.TRIPLE_STORES);
AGUtils.printStringArray("AG Namespaces (registed):", ag.getNamespaces());
Run, and the result(program 2):
AG Namespaces (registered):
0: rdf
1: http://www.w3.org/1999/02/22-rdf-syntax-ns#
2: rdfs
3: http://www.w3.org/2000/01/rdf-schema#
4: owl
5: http://www.w3.org/2002/07/owl#
In program 1, I create a AllegroGraph
which name is "test",
and I registered the other 5 namespaces(foaf, dc, dct, exif, prf);
in program 2, I open the created AllegroGraph, but its namespace has only 3: rdf, rdfs, owl,
the other 5 namespaces which is registered in program 1 is missing.
My question is:
- Why the other 5 namespaces missed?
- How can I keep the 5 registered namespaces in created
AllegroGraph
? (When I open the createdAllegroGraph
, I need not to register namespaces again.)
And in my program, after registered all the nameSpace, I added the following code:
ag.closeTripleStore();
and it is unuseful:(