private function getItemLabel(RunnerServiceContext $context, $itemUri, $useTitle = false)
    {
        $label = '';

        if ($useTitle) {
            $label = $context->getItemIndexValue($itemUri, 'title');
        }

        if (!$label) {
            $label = $context->getItemIndexValue($itemUri, 'label');
        }

        if (!$label) {
            $item = new \core_kernel_classes_Resource($itemUri);
            $label = $item->getLabel();
        }
        return $label;
    }