select ?threadstarter ?commenters (count(?postid) as ?postcount)
where
{
?subject1 bt:ThreadId ?threadid .
?subject1 bt:PostId ?postid .
?subject1 bt:UserUserId ?commenters .
{
select ?threadid ?threadstarter
where
{
?subject1 bt:PostId ?firstpost .
?subject1 bt:UserUserId ?threadstarter .
?subject1 bt:ThreadId ?threadid
{
select ?threadid (min(?postid) as ?firstpost)
where
{
?subject bt:ThreadId ?threadid .
?subject bt:PostId ?postid .
}
group by ?threadid
}
}
}
}
group by ?threadstarter ?commenters
order by ?threadstarter
以上是Sparql查询,我在数据集的fuseki端点上运行了460万个三元组,但它运行了几个小时并且没有提供输出。但是相同的查询对于具有600k三元组的数据集运行良好,并在2-3分钟内抛出输出。
可能是什么问题? 是否有任何优化要对查询? 或者搬到其他三家商店? 或任何其他替代解决方案?