diff --git a/src/acdhOeaw/arche/lib/schema/Ontology.php b/src/acdhOeaw/arche/lib/schema/Ontology.php index b63902c..8f78ade 100644 --- a/src/acdhOeaw/arche/lib/schema/Ontology.php +++ b/src/acdhOeaw/arche/lib/schema/Ontology.php @@ -583,7 +583,7 @@ private function loadPropertiesDb(): void { FROM t JOIN identifiers i ON t.pid = i.id GROUP BY 1 ) c2 USING (id) - LEFT JOIN ( + JOIN ( SELECT r.id, jsonb_agg(ids) AS range FROM relations r JOIN identifiers i ON r.target_id = i.id AND r.property = ? GROUP BY 1 @@ -767,12 +767,13 @@ private function loadClassRest(object $data, string $nmsp, string $baseUrl): voi private function loadPropertyRest(object $data, string $nmsp): void { $data->property = $data->ids; $data->properties = $data->ids; + if (!isset($data->range)) { + return; + } + $data->range = array_unique(array_merge(...array_map(fn($x) => $x->ids, $data->range))); if (isset($data->domain)) { $data->domain = array_unique(array_merge(...array_map(fn($x) => $x->ids, $data->domain))); } - if (isset($data->range)) { - $data->range = array_unique(array_merge(...array_map(fn($x) => $x->ids, $data->range))); - } if (isset($data->recommendedClass)) { $data->recommendedClass = array_unique(array_merge(...array_map(fn($x) => $x->ids, $data->recommendedClass))); }