exists()) { return \common_report_Report::createFailure('Invalid CLASS_URI provided'); } $label = new core_kernel_classes_Property(OntologyRdfs::RDFS_LABEL); $instances = $class->getInstances(true); $cleaned = 0; foreach ($instances as $instance) { $labels = $instance->getPropertyValues($label); if (count($labels) > 1) { $instance->setLabel(array_shift($labels)); $cleaned++; } } return \common_report_Report::createSuccess( sprintf('instances with duplicates labels cleaned %u', $cleaned) ); } catch (\Exception $e) { return \common_report_Report::createFailure($e->getMessage()); } } }