Jena で RDF/XML を書きながら、propertyAttr のブロックを解除する方法を見つけようとしています。ドキュメントにあるように、「デフォルトでは、ルール propertyAttr はブロックされています。」試してみましたが、RDF/XML-ABBREV モードでブロックできません。
RDFWriter w = m.getWriter("RDF/XML-ABBREV");
w.setProperty("tab", "2");
w.setProperty("blockRules", "propertyAttr");
w.write(m, System.out, "");
これは私の目的の出力でeg:value="v"
あり、属性として設定されています:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:eg="http://example.org/"
xml:base="http://example.org/dir/file">
<rdf:Description rdf:ID="frag" eg:value="v" />
</rdf:RDF>
これは私の実際の出力です:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://example.org/">
<rdf:Description rdf:about="http://example.org/dir/filefrag">
<j.0:value>v</j.0:value>
</rdf:Description>
</rdf:RDF>