查询如下:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT distinct ?value from <http://fr.dbpedia.org> WHERE{ ?sub rdfs:label ?value. FILTER (CONTAINS(LCASE(?value), 'data')). } limit 10它使用DBpedia端点工作得非常好但是当我尝试使用ARC2从PHP使用它时,我收到以下错误:
查询errorsArray([0] => ARC2_SPARQLPlusParser中的不完整FILTER [1] =>组图模式不完整或无效。无法处理ARC2_SPARQLPlusParser中的“”)
任何想法可能是什么问题? 谢谢!
the query is the following :
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT distinct ?value from <http://fr.dbpedia.org> WHERE{ ?sub rdfs:label ?value. FILTER (CONTAINS(LCASE(?value), 'data')). } limit 10it works perfectly fine using the DBpedia endpoint but when I try to use it from PHP using ARC2 I get the following error :
Query errorsArray ( [0] => Incomplete FILTER in ARC2_SPARQLPlusParser [ 1] => Incomplete or invalid Group Graph pattern. Could not handle " " in ARC2_SPARQLPlusParser )
Any ideas what could be the problem ? thank's!
最满意答案
ARC2不支持完整的SPARQL 1.1(请参阅源代码 ),因此不支持CONTAINS 。 您可以尝试使用REGEX :
PREFIX rdfs: http : //www.w3.org/2000/01/rdf-schema#
SELECT distinct ?value from <http://fr.dbpedia.org> WHERE{ ?sub rdfs:label ?value. FILTER (REGEX(STR(?value), 'data', 'i')). } limit 10ARC2 does not support full SPARQL 1.1 (see the source code), thus, CONTAINS is not supported. You can try to use REGEX instead:
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
SELECT distinct ?value from <http://fr.dbpedia.org> WHERE{ ?sub rdfs:label ?value. FILTER (REGEX(STR(?value), 'data', 'i')). } limit 10
更多推荐
发布评论