From 4834a1dfd7c0b0bd7ed1e2247a3d7e3b196ba415 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Thu, 24 Sep 2020 15:29:40 +0200 Subject: [PATCH] Parse relative to doc base URL --- src/Enum/Rdf.php | 1 - src/Flysystem/Plugin/ReadRdf.php | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Enum/Rdf.php b/src/Enum/Rdf.php index b31a93e..8af7c9c 100644 --- a/src/Enum/Rdf.php +++ b/src/Enum/Rdf.php @@ -5,5 +5,4 @@ class Rdf { public const EMPTY_NODE = '_:'; - public const CURRENT_DOC = ''; } diff --git a/src/Flysystem/Plugin/ReadRdf.php b/src/Flysystem/Plugin/ReadRdf.php index a5d6e94..3554fb7 100644 --- a/src/Flysystem/Plugin/ReadRdf.php +++ b/src/Flysystem/Plugin/ReadRdf.php @@ -45,13 +45,14 @@ final public function __construct(\EasyRdf_Graph $rdfConverter) * * @param string $path path to file * @param string $format RDF format to convert file to + * @param string $url base url for parsing * * @return array|false metadata * * @throws FileNotFoundException * @throws \Pdsinterop\Rdf\Flysystem\Exception */ - public function handle(string $path, string $format) : string + public function handle(string $path, string $format, string $url) : string { $converter = $this->converter; @@ -61,7 +62,7 @@ public function handle(string $path, string $format) : string if (is_string($contents)) { try { - $converter->parse($contents, Format::UNKNOWN, Rdf::CURRENT_DOC); + $converter->parse($contents, Format::UNKNOWN, $url); } catch (\EasyRdf_Exception $exception) { $this->throwException(self::ERROR_COULD_NOT_CONVERT, [ 'file' => $path,