我使用stardog 2.0.0创建了一个(磁盘)数据库。
我已经将我的本体和一些数据加载到这个数据库中。
在执行以下命令时,我可以看到本体的公理和这些数据:
./stardog query -v --username user --passwd pass dbname "select * where { ?s ?p ?o }"这是返回的公理的选择:
?s ?p ?o
| http://www.ugent.be/chest#Infection | rdf:type | owl:Class |
| http://www.ugent.be/chest#Infection | rdf:type | http://www.ugent.be/chest#RespiratoryInfection |
| http://www.ugent.be/chest#Infection | rdf:type | owl:NamedIndividual |
| http://www.ugent.be/chest#Infection | rdfs:subClassOf | http://www.ugent.be/chest#Pathology |这是对返回的数据的选择:
| <http://www.ugent.be/chest#Infection/4641> | rdf:type | <http://www.ugent.be/chest#Infection> |
| <http://www.ugent.be/chest#Infection/4642> | rdf:type | <http://www.ugent.be/chest#Infection> |
| <http://www.ugent.be/chest#Infection/4643> | rdf:type | <http://www.ugent.be/chest#Infection> |
| <http://www.ugent.be/chest#Infection/4644> | rdf:type | <http://www.ugent.be/chest#Infection> |当我试图执行一个查询来检索带有rdf:type感染的所有个人时,我什么也得不到。
./stardog query -v --username user --passwd pass "chest" "PREFIX : <http://www.ugent.be/chest#> select ?s where { ?s rdf:type :Infection }"当我添加推理类型QL或EL时,我得到
:Infection当我添加推理类型DL时,我得到:
com.clarkparsia.pellet.api.term.impl.entity.DataNotImpl cannot be cast to com.clarkparsia.pellet.api.term.entity.ClassExpression一致性检查也是如此。
我做错什么了吗?
发布于 2013-11-07 19:47:55
DL推理只允许对您的TBox上的查询进行查询,因此您的给定查询不会使用推理来回答;在使用星犬的推理能力时请记住这一点。
这么说吧,你不应该得到一个ClassCastException。尝试使用最新的Stardog,您已经落后了三个版本,如果问题仍然存在,请向邮件列表发送一个独立的最小示例,我们将很乐意修复它。
https://stackoverflow.com/questions/19839093
复制相似问题