php – Could not properly handle " PREFIX in ARC2-ThrowExceptions

Exception or error:

I try to query data in the ontology which is saved in the GraphDB Ontotext. I use ARC2 as remote store end point, but I got the result that my query can’t handle Prefix. I implement it using Codeigniter and it worked fine to find Class inside ontology. But here I try to find the distance between 2 classes. The error shows below:

Query errorsArray ( [0] => Could not properly handle " PREFIX geo: NULL ["a"]=> array(1) { ["remote_store_endpoint"]=> string(46) "" } ["caller"]=> object(stdClass)#21 (0) { } ["inc_path"]=> string(58) "C:\xampp\htdocs\SearchEngine\application\third_party\arc2/" ["ns_count"]=> int(0) ["nsp"]=> array(1) { [""]=> string(3) "rdf" } ["used_ns"]=> array(1) { [0]=> string(43) "" } ["ns"]=> array(1) { ["rdf"]=> string(43) "" } ["base"]=> string(55) "http://localhost/SearchEngine/testcontroller/find/tutu/" ["errors"]=> array(1) { [0]=> string(83) "Could not properly handle " PREFIX geo: array(0) { } ["adjust_utf8"]=> int(0) ["max_errors"]=> int(25) ["has_pcre_unicode"]=> int(1) ["is_remote"]=> int(1) }

This is my code:

    $coba = new ARC2();
    $config = array('remote_store_endpoint' => '');
    $r = "  PREFIX geo:<>
    PREFIX rdfs:<>
    PREFIX rdf:<>
    PREFIX owl:<> 
    SELECT  ?individual ?ancestor
            ( count(distinct ?mid) as ?closest)
    WHERE {
            values ?individual {geo:$tokenizeword[$x]}
            values ?ancestor {geo:$values[6]}
            ?individual rdf:type+ ?mid.
            ?mid rdf:type* ?ancestor.
            group by ?individual ?ancestor
            order by ?individual ?closest
    $rowr[] = $store->query($r, 'rowsr');
    if ($errs = $store->getErrors()) {
        echo "Query errors" ;

Is there anyone can help me?

How to solve:

I have gotten the answer. So, there is problem of SPARQL remote store on ARC2 because it can’t handle SPARQL 1.1 query, thus we need to add some library to it. FYI – The following forks seem to add SPARQL 1.1. remote endpoint feature.

file: store/ARC2_SPARQL11RemoteStore.php
forked from

Leave a Reply

Your email address will not be published. Required fields are marked *