diff --git a/src/MDConcObjectTagRelTypes.php b/src/MDConcObjectTagRelTypes.php new file mode 100644 index 0000000..9da1e1b --- /dev/null +++ b/src/MDConcObjectTagRelTypes.php @@ -0,0 +1,49 @@ + + */ +declare(strict_types = 1); + +/** + * Constains lists for categorizing links between objects and tags. + */ +final class MDConcObjectTagRelTypes implements MDImporterConcordanceListInterface { + + private const RELATION_TYPE_NAMES = [ + + '' => 'tag', + 'tag' => 'tag', + + "motive" => "article", + "motiv" => "article", + "display" => "display_subject", + + "material" => "material", + + "technique" => "technique", + "technik" => "technique", + + ]; + + /** + * Require a function for getting the concordance target. + * + * @param string $input Input string. + * + * @return string + */ + public static function getConcordanceTarget(string $input):string { + + if (isset(self::RELATION_TYPE_NAMES[$input])) { + return self::RELATION_TYPE_NAMES[$input]; + } + if (isset(self::RELATION_TYPE_NAMES[strtolower($input)])) { + return self::RELATION_TYPE_NAMES[strtolower($input)]; + } + + throw new MDImporterMissingConcordance("Unknown object-tag relationship type: " . $input); + + } +}