Stardawg 2.0 Data Not Impl无法转换为类表达式

时间:2013-11-07 14:57:02

标签: stardog

我使用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检索所有个体时:输入感染我什么都没得到。

./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

一致性检查也是如此。

我做错了什么?

1 个答案:

答案 0 :(得分:2)

DL推理仅允许对您的TBox进行查询,因此您的查询将无法使用推理来回答;使用Stardog's reasoning capabilities时请记住这一点。

说到这一点,你永远不应该得到ClassCastException。尝试使用最新的Stardog,你有三个版本,如果问题仍然存在,请将一个自包含的最小示例发送到邮件列表,我们很乐意解决它。