semsol / arc2

ARC RDF Classes for PHP
Other
332 stars 89 forks source link

problem Insert on local repositorie #80

Closed Trigui closed 4 years ago

Trigui commented 7 years ago

hi , I have a problem with insert I am trying to insert data on my GraphDB server but I get that error:

array(1) { [0]=> string(53) "Construct Template not found in ARC2_SPARQLPlusParser" } 
array(2) { ["result"]=> string(0) "" ["query_time"]=> float(4.0531158447266E-6) } 

any one can help me please

EDIT by @k00ni: code formating

k00ni commented 7 years ago

Can you explain your setup please? Which ARC2 version? Is this a public endpoint that one can test? Which INSERT query do you use?

Trigui commented 7 years ago

I am using this version , with select query I don't have any problem I am using a local data base server http://ontotext.com/products/graphdb/ my set up :

$config = array( 'remote_store_endpoint' => 'http://localhost:7200/repositories/ripo_v2', );
$store = ARC2::getStore($config);
if (!$store->isSetUp())
  $store->setUp();
$store = ARC2::getRemoteStore($config);
$query='
INSERT DATA{  
    <http://data.delphi.com/dcs/data/customer> <http://data.delphi.com/dcs/ontology#preference> "new techno" . 
}'
/* with this query I have :
array(1) { 
   [0]=> string(83) "Could not properly handle " INSERT DATA{  string(0) "" 
  ["query_time"]=> float(5.0067901611328E-6) 
} 
so I changed to insert into <your graph> and I got the first error */

$res = $store->query($query);
echo var_dump($store->getErrors());
echo var_dump($res);

EDIT by @k00ni: code formating

k00ni commented 6 years ago

Hi @Trigui, sorry for the late response. Could you find a solution?

It seems a problem with GraphDB, not understanding the query. Your response in the second post looks weird, can you paste the original response of the server?

PulsarFox commented 5 years ago

I have the same issue with Jena, it seems the Sparql processor does not recognise INSERT DATA. Is INSERT DATA supported with Sparql and with SPARQLScript ?

k00ni commented 5 years ago

Hi @PulsarFox,

to my knowledge, ARC2 does not support INSERT DATA queries, but INSERT INTO. We have some examples in our tests, for instance: https://github.com/semsol/arc2/blob/master/tests/db_adapter_depended/store/query/InsertIntoQueryTest.php#L40

Further information about the SPARQL support can be found here: https://github.com/semsol/arc2/blob/master/doc/SPARQL-support.md#insert-into

Hope it helps.

k00ni commented 4 years ago

Closed due to no activity since a year. Issue should be solved.