sparql 过滤器不起作用

sparql filter won't work

我想获取足球俱乐部的所有球员并过滤掉来自德国的球员,我知道没有过滤器选项是可能的,但我是 SPARQL 的新手,而且我似乎不知道了解在这种情况下如何使用过滤器选项,所以如果有人能告诉我如何让它工作,我会很高兴。

SELECT distinct ?player WHERE {
?player a <http://dbpedia.org/ontology/SoccerPlayer>. 
?player <http://dbpedia.org/property/currentclub> <http://dbpedia.org/resource/Hertha_BSC>. 
optional {?subject <http://dbpedia.org/ontology/birthPlace>/<http://dbpedia.org/ontology/country> ?<http://dbpedia.org/resource/Germany>. }
filter (!bound(?subject)).
} 
ORDER BY ASC(?player)

问候阿德里安

希望您正在寻找这样的东西:

SELECT distinct ?player WHERE {
    ?player a dbo:SoccerPlayer . 
    ?player dbp:currentclub dbr:Hertha_BSC . 
    ?player dbo:birthPlace/dbo:country? ?country .
    FILTER (?country = dbr:Germany)
    } 
ORDER BY ASC(?player)

或者这样:

SELECT distinct ?player WHERE {
    ?player a dbo:SoccerPlayer . 
    ?player dbp:currentclub dbr:Hertha_BSC . 
    ?player dbo:birthPlace/dbo:country? ?country .
    FILTER (?country in (dbr:Germany))
    } 
ORDER BY ASC(?player)

甚至这样:

SELECT distinct ?player WHERE {
    ?player a dbo:SoccerPlayer . 
    ?player dbp:currentclub ?club . 
    ?player dbo:birthPlace/dbo:country? ?country .
    VALUES (?club ?country) { (dbr:Hertha_BSC dbr:Germany) }
    } 
ORDER BY ASC(?player)