1
我在我的java應用程序中使用Jena(apache-jena-libs 3.0.1)來創建RDF模型並序列化爲RDF/XML。我使用的是https://jena.apache.org/documentation/io/rdfxml_howto.htmlApache Jena RDFWriter.setProperty沒有效果
FileOutputStream out = new FileOutputStream(new File(dir, filename + ".xml"));
RDFWriter rdfWriter = notificationModel.getWriter("RDF/XML-ABBREV");
rdfWriter.setProperty("showXmlDeclaration", "true");
rdfWriter.setProperty("showDoctypeDeclaration", "true");
rdfWriter.write(notificationModel, out, null);
記載然而,筆者忽略任何屬性,它們對生成的XML沒有影響一樣。有任何想法嗎?
由於一個錯誤,這有助於!鏈接到該問題:https://issues.apache.org/jira/browse/JENA-1168 –