2012-05-14 3 views
0

나는 DatatypeProperty "hasAge"가있는 올빼미 온톨로지가 있습니다 이 코드가 null 값을 반환하는 이유는 누구에게 말해 줄 수 있습니까?Jena에서 getDatatypeProperty (String PropertyName)는 어떻게 사용해야합니까?

String URI = "http://owldl.com/ontologies/dl-safe.owl" 
DatatypeProperty data = model.getDatatypeProperty(URI+"hasAge") 

데이터가 null입니다. 이 라인은 올빼미 파일에 종료 있지만 :

<!-- http://owldl.com/ontologies/dl-safe.owl#hasAge --> 
<owl:DatatypeProperty rdf:about="&dl-safe;hasAge"/> 

이 온톨로지는 ObjectProperties와 잘 작동합니다. 그러나 DatatypeProperties와 함께 작동하지 않는 것 같습니다

답변

2

거기에 #이 누락되었습니다.

http://owldl.com/ontologies/dl-safe.owlhasAge 

을하지만 주석 알 수 있듯이,이 호텔의 URI는 다음과 같습니다 :

URI+"hasAge"

이 될 것입니다

String URI = "http://owldl.com/ontologies/dl-safe.owl#"; 
:

http://owldl.com/ontologies/dl-safe.owl#hasAge 

그래서으로 변경

관련 문제