我正在尝试将 SPARQL 1.1 属性路径与 VirtuosoOS 6.1 一起使用,但出现了问题。我使用下一个图表:
@prefix foo: <foo/> .
@prefix bar: <bar/> .
@prefix type: <type/> .
bar:a1 type:read foo:b1 .
bar:a1 type:write foo:b2 .
bar:a1 type:write foo:b3 .
bar:a2 type:read foo:b4 .
bar:a2 type:write foo:b5 .
bar:a3 type:write foo:b6 .
foo:b2 type:link foo:b4 .
foo:b4 type:link foo:b6 .
我想找到所有从 x 开始的“链接”“foo”,其中 x 是 bar:a1 ---(type:write)--> x。显然答案是 foo:b4 和 foo:b6。
所以,我使用这个查询
prefix bar: <bar/>
prefix type: <type/>
select ?y where {
bar:a1 type:write ?x .
?x type:link+ ?y
}
但Virtuoso说
Virtuoso 37000 Error SP030: SPARQL compiler, line 8: syntax error at '?y' before '}'
我的查询有什么问题?也许 Virtuoso 不支持此功能?