使用 Jena 的 RDF/XML
如何使用 Jena 生成以下 RDF/XML?
<rdfs:Class rdf:about="http://example.com/A#B">
<rdfs:subClassOf>
<rdfs:Class rdf:about="http://example.com/A" />
</rdfs:subClassOf>
<rdf:Property rdf:about="http://example.com/C">
<rdfs:range rdf:resource="http://example.com/A" />
</rdf:Property>
</rdfs:Class>
How can I generate the following RDF/XML using Jena?
<rdfs:Class rdf:about="http://example.com/A#B">
<rdfs:subClassOf>
<rdfs:Class rdf:about="http://example.com/A" />
</rdfs:subClassOf>
<rdf:Property rdf:about="http://example.com/C">
<rdfs:range rdf:resource="http://example.com/A" />
</rdf:Property>
</rdfs:Class>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
网上有很多 Jena 教程。但是,您的要求非常简单。这是一种解决方案:
它会产生:
There are many Jena tutorials on the web. However, what you are asking for is pretty straightforward. Here's one solution:
which produces:
@Ian Dickinson 的回答很正确。
如果您希望将此输出写入文件,您可以使用此行,然后
您可以通过 protege 或在 WebVowl 上查看此文件。
@Ian Dickinson's answer is spot on.
If you wish to write this output to a file you can use this line instead
You can then view this file either through protege or on WebVowl.
的代码+解释
http://incubator.apache. org/jena/getting_started/index.html
是开始 jena 的好地方。
Code + explanation of
http://incubator.apache.org/jena/getting_started/index.html
decent place to start with jena.