From c4b96fdbe6b8e4cc14e7bba8212d52110d43ae11 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 10 Feb 2026 00:17:39 +0100 Subject: [PATCH 1/3] use URI in parse. The breakage was caused by the pubsub server which has been fixed --- src/Server.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Server.php b/src/Server.php index e2f0309..ab39dbe 100644 --- a/src/Server.php +++ b/src/Server.php @@ -283,7 +283,7 @@ private function handleSparqlUpdate(Response $response, string $path, $contents) try { // Assuming this is in our native format, turtle - $graph->parse($data, "turtle", $this->baseUrl . $path); + $graph->parse($data, "turtle", , $this->baseUrl . $this->basePath . $path); // FIXME: Use enums from namespace Pdsinterop\Rdf\Enum\Format instead of 'turtle'? // parse query in contents @@ -297,14 +297,14 @@ private function handleSparqlUpdate(Response $response, string $path, $contents) case "INSERT": // insert $triple(s) into $graph // @CHECKME: Does the Graph Parse here also need an URI? - $graph->parse($triples, "turtle"); // FIXME: The triples here are in sparql format, not in turtle; + $graph->parse($triples, "turtle", $this->baseUrl . $this->basePath . $path); // FIXME: The triples here are in sparql format, not in turtle; break; case "DELETE": // delete $triples from $graph $deleteGraph = $this->getGraph(); // @CHECKME: Does the Graph Parse here also need an URI? - $deleteGraph->parse($triples, "turtle"); // FIXME: The triples here are in sparql format, not in turtle; + $deleteGraph->parse($triples, "turtle", $this->baseUrl . $this->basePath . $path); // FIXME: The triples here are in sparql format, not in turtle; $resources = $deleteGraph->resources(); foreach ($resources as $resource) { $properties = $resource->propertyUris(); @@ -440,9 +440,7 @@ private function handleN3Update(Response $response, string $path, $contents): Re try { // Assuming this is in our native format, turtle - // @CHECKME: Does the Graph Parse here also need an URI? - $graph->parse($data, "turtle"); - // FIXME: Adding this base will allow us to parse <> entries; , $this->baseUrl . $this->basePath . $path), but that breaks the build. + $graph->parse($data, "turtle", $this->baseUrl . $this->basePath . $path); // FIXME: Use enums from namespace Pdsinterop\Rdf\Enum\Format instead of 'turtle'? $instructions = $this->n3Convert($contents); foreach ($instructions as $key => $value) { @@ -450,15 +448,14 @@ private function handleN3Update(Response $response, string $path, $contents): Re case "insert": // error_log("INSERT"); // error_log($instructions['insert']); - $graph->parse($instructions['insert'], "turtle"); + $graph->parse($instructions['insert'], "turtle", $this->baseUrl . $this->basePath . $path); break; case "delete": $deleteGraph = $this->getGraph(); // error_log("DELETE"); // error_log($instructions['delete']); - // @CHECKME: Does the Graph Parse here also need an URI? - $deleteGraph->parse($instructions['delete'], "turtle"); + $deleteGraph->parse($instructions['delete'], "turtle", $this->baseUrl . $this->basePath . $path); $resources = $deleteGraph->resources(); foreach ($resources as $resource) { $properties = $resource->propertyUris(); From c1f66df415b26f5e4d0a41609dae2944b9f026de Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 10 Feb 2026 00:19:26 +0100 Subject: [PATCH 2/3] typofix --- src/Server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Server.php b/src/Server.php index ab39dbe..e63cf17 100644 --- a/src/Server.php +++ b/src/Server.php @@ -283,7 +283,7 @@ private function handleSparqlUpdate(Response $response, string $path, $contents) try { // Assuming this is in our native format, turtle - $graph->parse($data, "turtle", , $this->baseUrl . $this->basePath . $path); + $graph->parse($data, "turtle", $this->baseUrl . $this->basePath . $path); // FIXME: Use enums from namespace Pdsinterop\Rdf\Enum\Format instead of 'turtle'? // parse query in contents From 32d159a5d436de055d24a7436578af4fa27436d1 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 10 Feb 2026 01:13:03 +0100 Subject: [PATCH 3/3] add lock to path option (for the profile server) --- src/Server.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Server.php b/src/Server.php index e63cf17..e562833 100644 --- a/src/Server.php +++ b/src/Server.php @@ -55,6 +55,10 @@ class Server private $basePath; /** @var string */ private $baseUrl; + /** @var string */ + private $lockedPath; + /** @var string */ + private $requestedPath; /** @var Filesystem */ private $filesystem; /** @var Graph */ @@ -89,6 +93,11 @@ final public function setBaseUrl($url) $this->basePath = $serverRequest->getUri()->getPath(); } + final public function lockToPath($path) + { + $this->lockedPath = $path; + } + final public function setNotifications(SolidNotificationsInterface $notifications) { $this->notifications = $notifications; @@ -100,6 +109,7 @@ final public function __construct(Filesystem $filesystem, Response $response, ?G { $this->basePath = ''; $this->baseUrl = ''; + $this->lockedPath = false; $this->filesystem = $filesystem; $this->graph = $graph ?? new Graph(); $this->response = $response; @@ -121,6 +131,11 @@ final public function respondToRequest(Request $request): Response $path = reset($slugs); } + $this->requestedPath = $path; + if ($this->lockedPath) { + $path = $this->lockedPath; + } + $method = $this->getRequestMethod($request); $contents = $request->getBody()->getContents(); @@ -283,7 +298,7 @@ private function handleSparqlUpdate(Response $response, string $path, $contents) try { // Assuming this is in our native format, turtle - $graph->parse($data, "turtle", $this->baseUrl . $this->basePath . $path); + $graph->parse($data, "turtle", $this->baseUrl . $this->basePath . $this->requestedPath); // FIXME: Use enums from namespace Pdsinterop\Rdf\Enum\Format instead of 'turtle'? // parse query in contents @@ -297,14 +312,14 @@ private function handleSparqlUpdate(Response $response, string $path, $contents) case "INSERT": // insert $triple(s) into $graph // @CHECKME: Does the Graph Parse here also need an URI? - $graph->parse($triples, "turtle", $this->baseUrl . $this->basePath . $path); // FIXME: The triples here are in sparql format, not in turtle; + $graph->parse($triples, "turtle", $this->baseUrl . $this->basePath . $this->requestedPath); // FIXME: The triples here are in sparql format, not in turtle; break; case "DELETE": // delete $triples from $graph $deleteGraph = $this->getGraph(); // @CHECKME: Does the Graph Parse here also need an URI? - $deleteGraph->parse($triples, "turtle", $this->baseUrl . $this->basePath . $path); // FIXME: The triples here are in sparql format, not in turtle; + $deleteGraph->parse($triples, "turtle", $this->baseUrl . $this->basePath . $this->requestedPath); // FIXME: The triples here are in sparql format, not in turtle; $resources = $deleteGraph->resources(); foreach ($resources as $resource) { $properties = $resource->propertyUris(); @@ -440,7 +455,7 @@ private function handleN3Update(Response $response, string $path, $contents): Re try { // Assuming this is in our native format, turtle - $graph->parse($data, "turtle", $this->baseUrl . $this->basePath . $path); + $graph->parse($data, "turtle", $this->baseUrl . $this->basePath . $this->requestedPath); // FIXME: Use enums from namespace Pdsinterop\Rdf\Enum\Format instead of 'turtle'? $instructions = $this->n3Convert($contents); foreach ($instructions as $key => $value) { @@ -448,14 +463,14 @@ private function handleN3Update(Response $response, string $path, $contents): Re case "insert": // error_log("INSERT"); // error_log($instructions['insert']); - $graph->parse($instructions['insert'], "turtle", $this->baseUrl . $this->basePath . $path); + $graph->parse($instructions['insert'], "turtle", $this->baseUrl . $this->basePath . $this->requestedPath); break; case "delete": $deleteGraph = $this->getGraph(); // error_log("DELETE"); // error_log($instructions['delete']); - $deleteGraph->parse($instructions['delete'], "turtle", $this->baseUrl . $this->basePath . $path); + $deleteGraph->parse($instructions['delete'], "turtle", $this->baseUrl . $this->basePath . $this->requestedPath); $resources = $deleteGraph->resources(); foreach ($resources as $resource) { $properties = $resource->propertyUris();