AllegroGraph에 네임 스페이스를 등록하는 데 문제가 있습니다.AllegroGraph에 네임 스페이스 등록 (등록 된 네임 스페이스가 없습니다.)
내 자바 코드 (프로그램 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 :,
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#
그런 다음, 내 자바 코드 (프로그램 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에서 나는 "test"라는 이름의 AllegroGraph
을 만들고 과 다른 5 개의 네임 스페이스 (foaf, dc, dct, exif, prf)를 등록했습니다. 프로그램 2에 을 만들었지 만 생성 된 AllegroGraph를 열었지만 네임 스페이스에 3 : rdf, rdfs, owl, 이 있고 프로그램 1에 등록 된 다른 네임 스페이스가 누락되었습니다.
내 질문은 :
- 왜 다른 5 네임 스페이스가 놓친?
- 생성 된에 5 개의 등록 된 네임 스페이스를 어떻게 유지할 수 있습니까? 는 (내가 만든
AllegroGraph
을 열 때, 나는 다시 네임 스페이스를 등록 할 필요가 없습니다.)
그리고 내 프로그램가, 결국 네임 스페이스를 등록, 나는 다음과 같은 코드를 추가 :
ag.closeTripleStore();
을
그리고 쓸모가 없다 : (