Skip to content

Commit c4b96fd

Browse files
committed
use URI in parse. The breakage was caused by the pubsub server which has been fixed
1 parent 4b97394 commit c4b96fd

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

src/Server.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ private function handleSparqlUpdate(Response $response, string $path, $contents)
283283

284284
try {
285285
// Assuming this is in our native format, turtle
286-
$graph->parse($data, "turtle", $this->baseUrl . $path);
286+
$graph->parse($data, "turtle", , $this->baseUrl . $this->basePath . $path);
287287
// FIXME: Use enums from namespace Pdsinterop\Rdf\Enum\Format instead of 'turtle'?
288288
289289
// parse query in contents
@@ -297,14 +297,14 @@ private function handleSparqlUpdate(Response $response, string $path, $contents)
297297
case "INSERT":
298298
// insert $triple(s) into $graph
299299
// @CHECKME: Does the Graph Parse here also need an URI?
300-
$graph->parse($triples, "turtle"); // FIXME: The triples here are in sparql format, not in turtle;
300+
$graph->parse($triples, "turtle", $this->baseUrl . $this->basePath . $path); // FIXME: The triples here are in sparql format, not in turtle;
301301

302302
break;
303303
case "DELETE":
304304
// delete $triples from $graph
305305
$deleteGraph = $this->getGraph();
306306
// @CHECKME: Does the Graph Parse here also need an URI?
307-
$deleteGraph->parse($triples, "turtle"); // FIXME: The triples here are in sparql format, not in turtle;
307+
$deleteGraph->parse($triples, "turtle", $this->baseUrl . $this->basePath . $path); // FIXME: The triples here are in sparql format, not in turtle;
308308
$resources = $deleteGraph->resources();
309309
foreach ($resources as $resource) {
310310
$properties = $resource->propertyUris();
@@ -440,25 +440,22 @@ private function handleN3Update(Response $response, string $path, $contents): Re
440440

441441
try {
442442
// Assuming this is in our native format, turtle
443-
// @CHECKME: Does the Graph Parse here also need an URI?
444-
$graph->parse($data, "turtle");
445-
// FIXME: Adding this base will allow us to parse <> entries; , $this->baseUrl . $this->basePath . $path), but that breaks the build.
443+
$graph->parse($data, "turtle", $this->baseUrl . $this->basePath . $path);
446444
// FIXME: Use enums from namespace Pdsinterop\Rdf\Enum\Format instead of 'turtle'?
447445
$instructions = $this->n3Convert($contents);
448446
foreach ($instructions as $key => $value) {
449447
switch ($key) {
450448
case "insert":
451449
// error_log("INSERT");
452450
// error_log($instructions['insert']);
453-
$graph->parse($instructions['insert'], "turtle");
451+
$graph->parse($instructions['insert'], "turtle", $this->baseUrl . $this->basePath . $path);
454452
break;
455453
case "delete":
456454
$deleteGraph = $this->getGraph();
457455
// error_log("DELETE");
458456
// error_log($instructions['delete']);
459457

460-
// @CHECKME: Does the Graph Parse here also need an URI?
461-
$deleteGraph->parse($instructions['delete'], "turtle");
458+
$deleteGraph->parse($instructions['delete'], "turtle", $this->baseUrl . $this->basePath . $path);
462459
$resources = $deleteGraph->resources();
463460
foreach ($resources as $resource) {
464461
$properties = $resource->propertyUris();

0 commit comments

Comments
 (0)