我有一个本体,我和 Jena 一起阅读了它,以帮助我从网站上抓取一些 RDFa 三元组。我目前没有将这些三元组存储在 Jena 模型中,但这很简单,它在我的下一个列表中。
不过,我正在努力的领域是让 Jena 为我拥有的本体输出正确的 RDF。本体使用 Owl 和 RDFS 定义,但是当我将一些示例三元组传递给模型时,它们显示不正确。几乎就好像它对本体一无所知。然而,输出仍然是有效的 RDF,只是它没有以我希望的形式出现。
我是否认为 Jena 应该能够根据本体生成关于我收集的三元组的编写良好的 RDF(不仅仅是有效的),或者这是否扩展了它的能力?
非常感谢您的任何意见。
更新 1
例子:
这是我们目前拥有的:
<rdf:Description rdf:about='http://theinternet.com/%3fq=Club/325'>
<j.0:hasName>Manchester United</j.0:hasName>
<j.0:hasPlayer>
<rdf:Description rdf:about='http://theinternet.com/%3fq=player/291/'>
</rdf:Description>
</j.0:hasPlayer>
<j.0:hasEmblem>http://theinternet.com/images/manutd.jpg</j.0:hasEmblem>
<j.0:hasWebsite>http://www.manutd.com/</j.0:hasWebsite>
</rdf:Description>
</rdf:RDF>
这就是我们理想中想要的:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:ontology="http://theinternet.com/ontology.rdf#">
<rdf:Description rdf:about='http://theinternet.com/%3fq=Club/325'>
<rdf:type rdf:resource='ontology:Club' />
<ontology:hasName>Manchester United</ontology:hasName>
<ontology:hasPlayer>
<rdf:Description rdf:about='http://theinternet.com/%3fq=player/291/'>
<rdf:type rdf:resource='ontology:Player' />
</rdf:Description>
</ontology:hasPlayer>
<ontology:hasEmblem>http://theinternet.com/images/manutd.jpg</ontology:hasEmblem>
<ontology:hasWebsite>http://www.manutd.com/</ontology:hasWebsite>
</rdf:Description>
</rdf:RDF>
在我看来,Jena 似乎缺少与本体有关的东西,例如资源类型等。我有这种感觉,我错误地使用了 Jena。