Sparql MULTIPLE 不存在条件

imp*_*rme 2 sparql dbpedia

我正在执行一个 Sparql 查询,该查询返回关键字apple不属于特定子类的所有 URISpecies

select distinct ?s 
where 
{ 
?s a owl:Thing . ?s rdfs:label ?label . 
filter(langmatches(lang(?label), 'en')) ?label bif:contains '"apple"' . 
filter not exists {?s rdf:type/rdfs:subClassOf* dbo:Species } 
}
Run Code Online (Sandbox Code Playgroud)

我想包含更多子类。我想包含许多子类,所以我想像这样过滤掉:

filter not exists {?s rdf:type/rdfs:subClassOf* dbo:Speciesfilter not exists {?s rdf:type/rdfs:subClassOf* dbo:Organisationfilter not exists {?s rdf:type/rdfs:subClassOf* dbo:SomeOtherSubclass

如何将多个 AND 链接在一起?

Jee*_*tra 5

你可以这样做:

FILTER NOT EXISTS { 
   VALUES ?clazz { dbo:Species dbo:Organisation dbo:SomeOtherSubclass } 
   ?s rdf:type/rdfs:subClassOf* ?clazz. 
 }
Run Code Online (Sandbox Code Playgroud)

但不能保证其性能如何。