我使用Protege创建了一个自定义OWL本体,它以基于树的RDF / XML格式序列化 .
我想要做的是从自定义本体中的预定义类创建RDF三元组并将它们存储在RDF文件中 . 并使用SPARQL查询这些三元组 . 我怎样才能做到这一点?
===更新===
这就是我的自定义本体,它具有Comment类和isAbout对象属性 .
]>
xml:base="http://review-analyzer.local/ontologies/reviews_2.owl"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:reviews_2="http://review-analyzer.local/ontologies/reviews_2.owl#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
battery
OLED
amoled
3
awesome
front camera
3
great
3
nice one
2
dfgh
4
great battery
1
fghjk
我的RDF文件看起来像
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:cmnt="http://review-analyzer.local/ontologies/reviews_2.owl#"
xmlns:admin="http://webns.net/mvcb/">
Great one!
5
amoled
所以我无法想出一种评论哪种方法是从Comment类创建的 .
我不能写点什么吗?
select *
where {
?Comment rdf:type ns:Review ;
}