[英]Why filter doesn't work in this context?
This is the query and the result: 这是查询和结果:
As you see, I am filtering out the users that are bo:ania
, so why do they still appear? 如您所见,我正在过滤掉
bo:ania
的用户,那么为什么它们仍然出现?
However, if I remove the widecard and select just the users ?user
, bo:ania
doesn't appear 但是,如果删除宽卡并仅选择用户
?user
,则bo:ania
不会出现
I didn't provide a minimum data example because this is a question about how filter and wildcard work, not about a problem in extracting some data from a data set. 我没有提供最低限度的数据示例,因为这是关于过滤器和通配符如何工作的问题,而不是关于从数据集中提取某些数据的问题。 However, if you need a minimum data, I'm more than happy to provide it.
但是,如果您需要最低限度的数据,我很乐意提供。
?specificUser
is bound to bo:ania
by your VALUES
statement. ?specificUser
通过VALUES
语句绑定到bo:ania
。 ?user
is an entirely different binding defined by the other triple patterns. ?user
是由其他三元模式定义的完全不同的绑定。 Your FILTER
says to filter out results where ?user = bo:ania
, and it appears to be doing that correctly, seeing that ?user
is not bound to bo:ania
in any of the results. 您的
FILTER
说要过滤掉?user = bo:ania
,并且看来这样做正确,因为在任何结果中都没有看到?user
绑定到bo:ania
。
BTW, there isn't a need to use VALUES
in this case unless you want to inspect multiple values. 顺便说一句,除非您要检查多个值,否则在这种情况下无需使用
VALUES
。 If it's just the one value, then the following would work, and not have you wondering why the binding to bo:ania
is included in the result set: 如果只是一个值,那么下面的方法将起作用,并且您不知道为什么对
bo:ania
的绑定包含在结果集中:
SELECT *
WHERE {
?user a rs:user .
?user rs:hasRated ?rating .
?rating rs:hasRatingDate ?ratngDate .
FILTER (?ratingDates >= (now() -"P10000F"^^xsd:duration) )
FILTER (?user != bo:ania)
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.