AllegroGraph での名前空間の登録に関して問題があります。
私のJavaコード(プログラム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());
実行し、結果 (プログラム 1):
AG 名前空間 (初期):
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: フクロウ
5: http://www.w3.org/2002/07/owl#
AG 名前空間 (登録済み):
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#
次に、私の Java コード (プログラム 2):
AllegroGraphConnection agc = new AllegroGraphConnection();
agc.enable();
AllegroGraph ag = agc.open("test", AGPaths.TRIPLE_STORES);
AGUtils.printStringArray("AG Namespaces (registed):", ag.getNamespaces());
実行し、結果 (プログラム 2):
AG 名前空間 (登録済み):
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#
プログラム 1 では、AllegroGraph
「test」という名前の を作成し、他の 5 つの名前空間 (foaf、dc、dct、exif、prf) を登録しました。プログラム 2 で、作成した AllegroGraph を開きますが、その名前空間は rdf、rdfs、owl の 3 つだけで、プログラム 1 で登録された他の 5 つの名前空間がありません。
私の質問は:
- 他の 5 つの名前空間が欠落したのはなぜですか?
- 5 つの登録済み名前空間を created に保持するにはどうすればよい
AllegroGraph
ですか? (作成した を開くと、AllegroGraph
名前空間を再度登録する必要はありません。)
私のプログラムでは、すべての nameSpace を登録した後、次のコードを追加しました。
ag.closeTripleStore();
そしてそれは役に立たない:(