Closed pietrobolcato closed 4 years ago
Hi! I guess, using INSERT DATA without a graph URI tells ARC2 to write into the default graph, which is currently not supported. But try INSERT INTO <http://your-target-graph> {..
, described here.
First of all thanks for your kind answer! I tried this way:
<?php
include_once('semsol\ARC2.php');
$end = "http://localhost:7200/repositories/virtualcoach";
/* configuration */
$config = array(
/* remote endpoint */
'remote_store_endpoint' => $end,
);
/* instantiation */
$store = ARC2::getRemoteStore($config);
$q2 = "PREFIX vc: <http://www.fbk.eu/ontologies/2016/virtualcoach/v1#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
INSERT INTO <$end> {
vc:AnimalLipid_6666662 vc:amountNutrient 6666.66 .
vc:AnimalLipid_6666662 vc:unit \"g\" .
vc:AnimalLipid_6666662 rdf:type vc:AnimalLipid .
vc:AnimalLipid_6666662 rdf:type owl:NamedIndividual .
}";
$rows = $store->query($q2);
print_r($rows);
This is the error output:`
Array ( [query_type] => insert [result] => Array ( [errors] => Array ( [0] => 400 Bad Request "MALFORMED QUERY: Encountered " "insert" "INSERT "" at line 7, column 1. Was expecting one of: "base" ... "prefix" ......" [1] => missing stream in "getFormat" [2] => missing stream in "readStream" http://localhost:7200/repositories/virtualcoach ) ) [query_time] => 0.0067639350891113 )
Any idea? Thanks in advance again.
Sorry for the late response!
Any luck solving this?
I am closing this, because of no response. Please reopen, if the error persists.
Hi
I'm trying to insert data into my RDF database using Arc2. This is my code:
The first query, which is a select query, works like a charm. The second one, which is an insert data, is not working at all. My server is graphDB. How can I make it work? Where I'm wrong?
Thanks in advance.