转载自 http://www.cnblogs.com/yuyd902/archive/2008/10/09/1307262.html
InputStream fs = FileManager.get().open("ontology\\test.rdf");
if (fs != null) {
Model model = ModelFactory.createDefaultModel();
model.read(fs, "");
model.write(System.out);
Resource res = model.getResource("http://somewhere/JohnSmith");//获取资源
Resource n = res.getProperty(VCARD.N).getResource();//获取属性,得到的是陈述,需要再得到资源
n.addProperty(VCARD.ADR, "sichuan").addProperty(VCARD.ADR,//一个资源可以添加多个属性
"zhongguo");
StmtIterator itor = n.listProperties();//获取所有属性
while (itor.hasNext()) {
System.out.print(itor.nextStatement().getLiteral());
}