diff --git a/actions/class.RdfController.php b/actions/class.RdfController.php index b7f29ef5c1..77c25fb57d 100644 --- a/actions/class.RdfController.php +++ b/actions/class.RdfController.php @@ -1720,7 +1720,13 @@ private function getResourceTransfer(): ResourceTransferInterface private function getResourceParentClass(string $id): string { + if ($this->getResource($id)->isClass()) { + $directParent = $this->getResource($id)->getParentClassesIds(); + return reset($directParent); + } + $types = $this->getResource($id)->getTypes(); + if (count($types) !== 1) { throw new InvalidArgumentException('Resource has no class or resource types are ambiguous'); }