我的 Stardog 数据库包含 SPARQL 端点的服务描述。我现在正在尝试选择特定服务并在查询中调用它,如https://www.w3.org/TR/2013/REC-sparql11-federated-query-20130321/#values中所述
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX doap: <http://usefulinc.com/ns/doap#>
SELECT ?service ?projectName
WHERE {
# Find the service with subject "remote".
?p dc:subject ?projectSubject ;
void:sparqlEndpoint ?service .
FILTER regex(?projectSubject, "remote")
# Query that service projects.
SERVICE ?service {
?project doap:name ?projectName . }
}
不幸的是,Stardog 抛出异常,告诉我变量不是 URI:
com.complexible.stardog.plan.eval.operator.OperatorException: Cannot execute a service query with a variable ref which binds to non-URI values
使用 IRI 构造函数在 BIND 语句中转换“?service”变量并使用绑定变量也无济于事。如何确保变量是 IRI,以便让 Stardog 执行联合查询?