【问题标题】:Sesame 2.8.4 subquery limit bug fix?Sesame 2.8.4 子查询限制错误修复?
【发布时间】:2015-09-02 07:05:05
【问题描述】:

Sesame 2.8.4好像有bug。

如果我有以下数据集:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix : <http://example.org/>.

:a rdf:type :AClass .
:a :hasName "a"^^xsd:string .
:a :hasProperty :xa .
:a :hasProperty :ya .
:a :hasProperty :za .

:b rdf:type :AClass . 
:b :hasName "b"^^xsd:string .
:b :hasProperty :xb .
:b :hasProperty :yb .

:c rdf:type :AClass .
:c :hasName "c"^^xsd:string .
:c :hasProperty :xc .

并对其运行以下查询:

prefix : <http://example.org/> 
select ?s ?p ?o {
#-- first, select two instance of :AClass
{ select ?s { ?s a :AClass } limit 2 }

#-- then, select all the triples of
#-- which they are subjects
?s ?p ?o
}

我得到的结果是这样的:

--------------------------------------------------------------------
| s  | p                                                 | o       |
====================================================================
| :a | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | :AClass |
| :a | :hasName                                          | "a"     |
--------------------------------------------------------------------

而不是这个是正确的结果:

--------------------------------------------------------------------
| s  | p                                                 | o       |
====================================================================
| :a | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | :AClass |
| :a | :hasName                                          | "a"     |
| :a | :hasProperty                                      | :xa     |
| :a | :hasProperty                                      | :ya     |
| :a | :hasProperty                                      | :za     |
| :b | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | :AClass |
| :b | :hasName                                          | "b"     |
| :b | :hasProperty                                      | :xb     |
| :b | :hasProperty                                      | :yb     |
--------------------------------------------------------------------

有人知道这个错误吗?有没有人遇到过同样的问题?或者是否有其他版本的 Sesame 修复了这个错误?

在回答我的问题后添加了下一行:

为避免任何混淆:错误在工作台中,而不是在查询引擎中。 查询引擎完美运行。

【问题讨论】:

  • 不回答您的问题,但您需要{ select **DISTINCT** ?s { ?s a :AClass } limit 2 } 目前,内部选择可能会返回:a 和:a。
  • @AndyS 对不起,但如果我添加 DISTINCT 它会给我完全相同的结果。它没有其他效果。我已经试过了。
  • @AndyS:为什么内部选择要返回两次相同的 URI?图中不应该只有一个三元组(:a rdf:type :AClass)吗?
  • 您检查过Sesame project support resources -- 错误跟踪器、邮件列表等吗?

标签: sparql semantic-web sesame


【解决方案1】:

您看到的问题不是查询引擎中的错误,而是 Workbench 客户端应用程序中的错误(这也解释了为什么我之前无法重现它,因为我使用的是命令行客户端)。由于某种原因,Workbench 错误地呈现了结果,只显示了 2 行(尽管在标题中说要显示 9 个结果):

问题与工作台中的结果分页功能有关,因为当您更改该设置时,它会突然显示完整的结果:

此问题现已在 Sesame 的问题跟踪器中记录为错误:SES-2307

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-27
    • 2014-05-31
    • 1970-01-01
    • 2021-03-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多