public function inject($target, array $values)
    {
        if (!$target instanceof \core_kernel_classes_Resource) {
            $msg = "The given target is not an instance of core_kernel_classes_Resource.";
            throw new MetadataInjectionException($msg);
        }

        /** @var \core_kernel_classes_Class $targetClass */
        $types = $target->getTypes();
        $targetClass = reset($types);
        $classProperties = $targetClass->getProperties(true);

        $properties = [];
        foreach ($classProperties as $property) {
            $properties[] = $property->getUri();
        }
        $properties = array_diff($properties, GenericLomOntologyClassificationExtractor::$excludedProperties);

        foreach ($values as $metadataValues) {
            /** @var MetadataValue $metadataValue */
            foreach ($metadataValues as $metadataValue) {
                $lang = $metadataValue->getLanguage() ?: DEFAULT_LANG;
                $path = $metadataValue->getPath();
                $valuePath = end($path);
                if (in_array($valuePath, $properties)) {
                    $prop = $this->getProperty($valuePath);
                    if ($target->getPropertyValuesByLg($prop, $lang)->count() > 0) {
                        $target->editPropertyValueByLg($prop, $metadataValue->getValue(), $lang);
                    } else {
                        $target->setPropertyValueByLg($prop, $metadataValue->getValue(), $lang);
                    }
                }
            }
        }
    }