SPARQL查询中的最佳过滤器放置

Jenaarq执行的优化之一是:“将过滤器放置在其依赖变量定义的位置附近”。

这将导致以下查询计划:

  (filter (exprlist (|| (|| (isIRI ?Y) (isBlank ?Y)) (!= (datatype ?Y) <http://example.com/onto/rdf#structure>)) (|| (|| (isIRI ?Z) (isBlank ?Z)) (!= (datatype ?Z) <http://example.com/onto/rdf#structure>)))
    (bgp
      (triple ?X <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://swat.cse.lehigh.edu/onto/univ-bench.owl#Student>)
      (triple ?Y <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://swat.cse.lehigh.edu/onto/univ-bench.owl#Faculty>)
      (triple ?Z <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://swat.cse.lehigh.edu/onto/univ-bench.owl#Course>)
      (triple ?X <http://swat.cse.lehigh.edu/onto/univ-bench.owl#advisor> ?Y)
      (triple ?Y <http://swat.cse.lehigh.edu/onto/univ-bench.owl#teacherOf> ?Z)
      (triple ?X <http://swat.cse.lehigh.edu/onto/univ-bench.owl#takesCourse> ?Z)
    )))

要转换为以下内容:

  (sequence
    (filter (|| (|| (isIRI ?Z) (isBlank ?Z)) (!= (datatype ?Z) <http://example.com/onto/rdf#structure>))
      (sequence
        (filter (|| (|| (isIRI ?Y) (isBlank ?Y)) (!= (datatype ?Y) <http://example.com/onto/rdf#structure>))
          (bgp
            (triple ?X <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://swat.cse.lehigh.edu/onto/univ-bench.owl#Student>)
            (triple ?Y <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://swat.cse.lehigh.edu/onto/univ-bench.owl#Faculty>)
          ))
        (bgp (triple ?Z <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://swat.cse.lehigh.edu/onto/univ-bench.owl#Course>))))
    (bgp
      (triple ?X <http://swat.cse.lehigh.edu/onto/univ-bench.owl#advisor> ?Y)
      (triple ?Y <http://swat.cse.lehigh.edu/onto/univ-bench.owl#teacherOf> ?Z)
      (triple ?X <http://swat.cse.lehigh.edu/onto/univ-bench.owl#takesCourse> ?Z)
    )))

事实证明,虽然原始查询计划以毫秒为单位运行,但“优化”查询计划需要大约7个小时才能得出结论。

Jenaarq是否考虑任何统计信息来优化查询计划中的过滤器放置?

我正在使用Jena 3.12.0。

kjhsdgfhkjshfuwerytu 回答:SPARQL查询中的最佳过滤器放置

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2760997.html

大家都在问