带有过滤器的SPARQL查询不存在

时间:2019-05-06 10:04:00

标签: sparql jena

我想进行查询,以提供满足以下条件的所有三元组(s,p,o):从so的路径通过长度为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" ...

0 个答案:

没有答案