类似:
Resource t
= model.createResource(personURI)
.addProperty(PERSON.property(n[1]), fullName)
.addProperty(PERSON.FN,
model.createResource()
.addProperty(PERSON.property(n[2]),chineseName)
.addProperty(PERSON.property(n[3]), sex)
.addProperty(PERSON.property(n[4]), nation));
如果事先不知道数组的大小,如何实现循环呢?
Resource a
= model.createResource(personURI)
.addProperty(PERSON.property(n[0]), fullName);
for(int i = 1;i< 4;i++) {
model.add(a,PERSON.property(n[i]),chineseName);
}
如果这样的话,就不能实现创建空的Resource(只包含n[2]、n[3]、n[4]这三个节点的资源)
求各位大神指教!小弟刚开始研究RDF,灰常感谢!!!