我有一個本體,我與Jena一起閱讀,幫助我從網站上刮取一些RDFa三元組。我目前沒有將這些三元組存儲在耶拿模型中,但那是相當直接的做法,它在我的下一個列表中。用Jena閱讀Ontology,用RDF三元組提供它,並生成正確的RDF字符串輸出
儘管如此,我正在努力的領域是讓Jena爲我所擁有的本體輸出正確的RDF。本體使用Owl和RDFS定義,但是當我將一些示例三元組傳遞給模型時,它們顯示不正確。就好像它對本體論一無所知。但是,輸出仍然是有效的RDF,只是它不是以我期望的形式出現的。
我正確地認爲,耶拿應該能夠根據本體論對我所收集的三元組產生寫得很好的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>
對我來說,看起來耶拿只是缺少與本體相關的事情,比如資源類型等。我有這種感覺我錯誤地使用了耶拿。
嗯,是的,我應該發佈一個例子。我現在要做。 – JonB 2010-05-19 07:54:55