2010-02-03 6 views
0

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에 등록 된 다른 네임 스페이스가 누락되었습니다.

내 질문은 :

  1. 왜 다른 5 네임 스페이스가 놓친?
  2. 생성 된에 5 개의 등록 된 네임 스페이스를 어떻게 유지할 수 있습니까? 는 (내가 만든 AllegroGraph을 열 때, 나는 다시 네임 스페이스를 등록 할 필요가 없습니다.)

그리고 내 프로그램가, 결국 네임 스페이스를 등록, 나는 다음과 같은 코드를 추가 :

ag.closeTripleStore(); 

그리고 쓸모가 없다 : (

답변

1

간단히 말해, AllegroGraph는 트리플 스토어에서 네임 스페이스 등록을 유지하지 않는다. 네임 스페이스는 긴 U를 읽고 쓰는 것을 더 쉽게하기 위해 존재하는 구문 설탕이다. RI. 일반적으로 많이 사용되는 약어 (rdf, owl, foaf, dc, ...)가 있더라도, 각 사람은 자신의 것을 만들어 사용할 수 있습니다. AllegroGraph가 네임 스페이스 약어를 유지했다면 다른 누군가가 상점을 열면 혼란을 야기 할 수있는 상점의 개인 약어가 표시됩니다.

간단히 말해 네임 스페이스를 사용하려면 시작시 코드를 다시 설정해야합니다. 또한 네임 스페이스 약어는 특정 트리플 스토어가 아닌 실행중인 인스턴스에 대해 전역 적입니다.

HTH

관련 문제