【问题标题】:Apache Jena RDFWriter.setProperty has no effectApache Jena RDFWriter.setProperty 没有效果
【发布时间】:2016-04-21 12:28:11
【问题描述】:

我在我的 java 应用程序中使用 Jena (apache-jena-libs 3.0.1) 来创建 RDF 模型并序列化为 RDF/XML。我使用的方式与https://jena.apache.org/documentation/io/rdfxml_howto.html

中记录的方式相同
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 没有影响。有什么想法吗?

【问题讨论】:

    标签: java xml rdf jena apache-jena


    【解决方案1】:

    有一个bug(只记录为JENA-1168)

    一种解决方法是使用

    RDFWriter rdfWriter = new org.apache.jena.rdfxml.xmloutput.impl.Abbreviated() ;
    

    【讨论】:

    猜你喜欢
    • 2016-10-06
    • 1970-01-01
    • 2021-05-17
    • 2018-01-14
    • 1970-01-01
    • 2014-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多