Hello!
I am struggling to do insert from Mediawiki 1.39.5 to GraphDB SPARQL endpoint. I have installed the LinkedWiki 3.7.1 compatible with MW. Also, i am running SMW 4.1.1, PHP 8.1.2 and MySQL 8.0.35
In the Special:SparqlQuery I can perform SELECT queries no problem.
However, when I try to perform the following insert, I get Error message: Sorry, you have not configure the endpoint to update the database.
Which is strange since the same statement run just fine in the GraphDB sparql endpoint
PREFIX dc: <http://purl.org/dc/elements/1.1/>
INSERT {
GRAPH <http://example> {
<http://example/book2> dc:title "A new book2" ;
dc:creator "A.N.Other2" .
}
Here is my setting in LocalSettings.php
wfLoadExtension( 'LinkedWiki' );
$wgAutoloadClasses['GraphdbStorageMethod'] = "$IP/extensions/LinkedWiki/storageMethod/GraphdbStorageMethod.php";
$wgLinkedWikiConfigSPARQLServices["http://localhost/graphdb"] = array(
"debug" => true,
"isReadOnly" => false,
"typeRDFDatabase" => "graphdb",
"endpointRead" => "http://localhost:3030/graphdb/myrepository",
"endpointWrite" => "http://localhost:3030/graphdb",
"login" => "test",
"password" => "test",
"HTTPMethodForRead" => "POST",
"HTTPMethodForWrite" => "POST",
"lang" => "en",
"nameParameterRead" => "query",
"nameParameterWrite" => "update",
"storageMethodClass" => "GraphdbStorageMethod"
);
$wgLinkedWikiSPARQLServiceSaveDataOfWiki= "http://localhost:3030/graphdb";
And the GraphdbStorageMethod.php
<?php
class GraphdbStorageMethod extends StorageMethodAbstract {
/**
* @return string
*/
private $graphNamed = "http://localhost/graphdb";
public function getQueryReadStringWithTagLang() {
return <<<EOT
SELECT DISTINCT ?value
WHERE
{
?subject ?property ?value .
FILTER ( lang(?value) = ?lang )
}
EOT;
}
/**
* @return string
*/
public function getQueryReadStringWithoutTagLang() {
return <<<EOT
SELECT DISTINCT ?value
WHERE
{
?subject ?property ?value .
FILTER ( lang(?value) = "" )
}
EOT;
}
/**
* @return string
*/
public function getQueryReadValue() {
return <<<EOT
SELECT DISTINCT ?value
WHERE
{
?subject ?property ?value .
}
EOT;
}
/**
* @return string
*/
public function getQueryInsertValue() {
return <<<EOT
INSERT DATA
{
?subject ?property ?value .
}
EOT;
}
/**
* @return string
*/
public function getQueryDeleteSubject() {
return <<<EOT
DELETE
{ ?subject ?property ?value . }
WHERE
{ ?subject ?property ?value . }
EOT;
}
/**
* @param string $url
* @return string
*/
public function getQueryLoadData( $url ) {
return "";
}
}