简体   繁体   中英

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?

However, if I remove the widecard and select just the users ?user , bo:ania doesn't appear

在此处输入图片说明

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. ?user is an entirely different binding defined by the other triple patterns. 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.

BTW, there isn't a need to use VALUES in this case unless you want to inspect multiple 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:

SELECT *
WHERE {
  ?user a rs:user .
  ?user rs:hasRated ?rating .
  ?rating rs:hasRatingDate ?ratngDate .
  FILTER (?ratingDates >= (now() -"P10000F"^^xsd:duration) )
  FILTER (?user != bo:ania)
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM