我想进行查询,以提供满足以下条件的所有三元组(s,p,o)
:从s
到o
的路径通过长度为at的谓词p
至少2条边,但是三边(s,p,o)
不存在。
我的查询如下(p
是<http://dbpedia.org/ontology/isPartOf>
)
select ?s ?p ?o
WHERE {
?s <http://dbpedia.org/ontology/isPartOf>/<http://dbpedia.org/ontology/isPartOf>+ ?o .
FILTER (NOT EXISTS {?s <http://dbpedia.org/ontology/isPartOf> ?o } )
}
我通过Jena API执行了该操作,并收到以下错误:
Exception in thread "main" org.apache.jena.query.QueryParseException: Encountered " "select" "select "" at line 1, column 1.
Was expecting one of:
<EOF>
"\ufeff" ...
"base" ...
"prefix" ...
"insert" ...
"delete" ...
<INSERT_DATA> ...
<DELETE_DATA> ...
<DELETE_WHERE> ...
"load" ...
"clear" ...
"create" ...
"add" ...
"move" ...
"copy" ...
"drop" ...
"with" ...