SPARQL federated query "SERVICE" returns Virtuoso RDFZZ Error: unexpected variable name 'stubvar14'

SPARQL federated query "SERVICE" returns Virtuoso RDFZZ Error: unexpected variable name 'stubvar14'

我想从两个不同的 SPARQL 端点获取人员列表,因此我在 de.dbpedia:

上使用此查询
PREFIX category-en: <http://dbpedia.org/resource/Category:>
SELECT distinct *
WHERE {
?name dcterms:subject category-de:Haus_Liechtenstein.
?name rdf:type foaf:Person.
SERVICE <http://dbpedia.org/sparql> {
?name dcterms:subject category-en:Princely_Family_of_Liechtenstein.
?name rdf:type foaf:Person.
}
MINUS {?name dbpedia-owl:deathDate ?d}
}

然后出现以下错误:

Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://dbpedia.org/sparql', ...) has received result with unexpected variable name 'stubvar14'

知道我做错了什么吗?非常感谢!

所以问题在于,虽然这两个查询单独运行良好,但组合查询中的 service 部分试图根据第二组来过滤第一组。我认为你缺少的是一个联合:

PREFIX category-en: <http://dbpedia.org/resource/Category:>
SELECT distinct count(?name)
WHERE {
{
    ?name dcterms:subject category-de:Haus_Liechtenstein.
    ?name rdf:type foaf:Person.
}
union{
    SERVICE silent <http://dbpedia.org/sparql>{
    ?name dcterms:subject category-en:Princely_Family_of_Liechtenstein.
    ?name rdf:type foaf:Person.
}
}
MINUS {?name dbpedia-owl:deathDate ?d}
}