Compare commits

...

8 Commits

25 changed files with 520 additions and 32 deletions

View File

@@ -5,6 +5,55 @@ declare(strict_types = 1);
* Exception thrown in case an update failed.
*/
final class MDImporterMissingConcordance extends Exception {
public string $target_type;
public string $value_to_map;
/** @var array<string, array<string>> */
private static array $_missing_concordances = [];
/**
* Sets up an error.
*
* @param string $target_type Target type (e.g. "measurements").
* @param string $value_to_map Value to map.
*
* @return void
*/
public static function throw(string $target_type, string $value_to_map):void {
if (class_exists("MD_IMPORTER_CONF") && MD_IMPORTER_CONF::$dry_run === true) {
if (empty(self::$_missing_concordances)) {
// Register printing at the end
register_shutdown_function(function() {
echo PHP_EOL . PHP_EOL . "There are unmapped concordances. Please map them before proceeding." . PHP_EOL . "You may use https://concordance.museum-digital.org/ to do the mapping" . PHP_EOL . PHP_EOL;
foreach (self::$_missing_concordances as $key => $values) {
sort($values);
echo PHP_EOL . PHP_EOL . $key . PHP_EOL . PHP_EOL;
echo implode(PHP_EOL, array_unique($values));
}
});
}
if (!isset(self::$_missing_concordances[$target_type])) {
self::$_missing_concordances[$target_type] = [];
}
self::$_missing_concordances[$target_type][] = $value_to_map;
return;
}
$exception = new MDImporterMissingConcordance("Unmapped specific value of type " . $target_type . ": " . $value_to_map);
$exception->target_type = $target_type;
$exception->value_to_map = $value_to_map;
throw $exception;
}
/**
* Error message.
*

View File

@@ -56,6 +56,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
"Creator" => 1,
"creator" => 1,
"deutscher Baumeister, Ingenieur, Holzschneider, Kupferstecher, Zeichner, Topograph und Militärschrif" => 1,
"Drechsler" => 1,
"Elfenbeindrechsler" => 1,
"Elfenbeindrechslerin" => 1,
"Elfenbeindrechsler*in" => 1,
@@ -63,6 +64,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
"Elfenbeinschnitzerin" => 1,
"Elfenbeinschnitzer*in" => 1,
"Elfenbeinschnitzerei" => 1,
"Emailleur" => 1,
"Entwurf und Ausführung" => 1,
"Fabrik" => 1,
"Fayencemanufaktur" => 1,
@@ -136,6 +138,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
"Interviewer" => 1,
"Interviewerin" => 1,
"Interviewer*in" => 1,
"Juwelier" => 1,
"Juwelier und Uhrmacher" => 1,
"Katograf" => 1,
"Keramiker" => 1,
@@ -193,6 +196,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
"Papiermacherin" => 1,
"Papiermacher*in" => 1,
'Papierverarbeitungswerk' => 1, // created by
'Plattner' => 1, // created by
"Porzellanhersteller" => 1,
"Porzellanherstellerin" => 1,
"Porzellanhersteller*in" => 1,
@@ -216,15 +220,18 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
"Regisseuer*in" => 1,
"Reparatur" => 1,
"Reproduktion" => 1,
"Schäfter" => 1,
"Scherenschneider" => 1,
"Scherenschneiderin" => 1,
"Scherenschneider*in" => 1,
"Schlossschmied" => 1,
"Schneider" => 1,
"Schneiderin" => 1,
"Schneider*in" => 1,
"Schnitzer" => 1,
"Schnitzerin" => 1,
"Schnitzer*in" => 1,
"Seidensticker" => 1,
"Silberschmied" => 1,
"Silberschmiedin" => 1,
"Silberschmied*in" => 1,
@@ -239,6 +246,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
"Steinbildhauer*in" => 1,
"Steinmetz" => 1,
"Steinmetzin" => 1,
"Steinschneider" => 1,
"Steinmetz*in" => 1,
"Steingutfabrik" => 1,
"Stempelschneider" => 1,
@@ -351,6 +359,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
"Datsrellung" => 5,
"Dastellung" => 5,
"Dartsellung" => 5,
"Dargestellte Person" => 5,
"dargestellt" => 5,
"Dargestellt" => 5,
"Dargestellte Personen" => 5,
@@ -554,6 +563,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
// 11: Received
"Adressat" => 11,
'Adressat/in' => 11, // received by
"Beschenkter" => 11,
"Beschenkte Person" => 11,
"Beschenkte Person (Geburtstag)" => 11,
"Beschenkte Person (Hochzeitstag)" => 11,
@@ -646,6 +656,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
"Zeichnerin" => 19,
"Zeichner*in" => 19,
'Zeichner/in' => 19, // drawn by
'Zeichnung' => 19, // drawn by
"Zeichner / Inventor" => 19,
"Zeichner, Autor der Dekoration" => 19,
"Zeichner und Grafiker" => 19,
@@ -1267,7 +1278,8 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):int {
if (!isset(self::ACTOR_ROLES_TO_EVENT_TYPE[$input])) {
throw new MDImporterMissingConcordance("Unknown actor role: " . $input);
MDImporterMissingConcordance::throw("actor role", $input);
return 1; // Return default in dry-run mode
}
return self::ACTOR_ROLES_TO_EVENT_TYPE[$input];

View File

@@ -11,7 +11,8 @@ declare(strict_types = 1);
*/
final class MDConcCertainty implements MDImporterConcordanceListInterface {
private const MAPPING = [
// Public for access in concordance.museum-digital.org
public const MAPPING = [
// Uncertain
@@ -55,7 +56,8 @@ final class MDConcCertainty implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):bool {
if (!isset(self::MAPPING[$input])) {
throw new MDImporterMissingConcordance("Unknown certainty identifier: " . $input);
MDImporterMissingConcordance::throw("certainty identifier", $input);
return true; // Return default in dry-run mode
}
return self::MAPPING[$input];

View File

@@ -25,7 +25,8 @@ final class MDConcCheckTypes implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):MDObjectCheckType {
if (!isset(self::CHECK_TYPES[$input])) {
throw new MDImporterMissingConcordance("Unknown check type: " . $input);
MDImporterMissingConcordance::throw("check", $input);
return MDObjectCheckType::completeness_check; // Return default in dry-run mode
}
return self::CHECK_TYPES[$input];

View File

@@ -45,7 +45,8 @@ final class MDConcCloserLocationTypes implements MDImporterConcordanceListInterf
public static function getConcordanceTarget(string $input):string {
if (!isset(self::LOCATION_TYPES_VERBOSE[$input])) {
throw new MDImporterMissingConcordance("Unknown location type: " . $input);
MDImporterMissingConcordance::throw("location", $input);
return "3"; // Return default in dry-run mode
}
return self::LOCATION_TYPES_VERBOSE[$input];

View File

@@ -26,7 +26,8 @@ final class MDConcColors implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):string {
if (!isset(self::COLORS_LIST[$input])) {
throw new MDImporterMissingConcordance("Unknown color: " . $input);
MDImporterMissingConcordance::throw("color", $input);
return "black"; // Return default in dry-run mode
}
return self::COLORS_LIST[$input];

View File

@@ -99,7 +99,8 @@ final class MDConcCurrencies implements MDImporterConcordanceListInterface {
if (in_array($input, MDCurrenciesSet::CURRENCIES, true)) {
return $input;
}
throw new MDImporterMissingConcordance("Unknown currency: " . $input);
MDImporterMissingConcordance::throw("currency", $input);
return "eu-EUR"; // Return default in dry-run mode
}
return self::CURRENCIES_LIST[$input];

View File

@@ -37,7 +37,8 @@ final class MDConcDamageTypes implements MDImporterConcordanceListInterface {
throw new MDImporterBlacklistedConcordanceTerm("Invalid damage type: " . $input);
}
throw new MDImporterMissingConcordance("Unknown damage type: " . $input);
MDImporterMissingConcordance::throw("damage", $input);
return MDObjectDamageType::desiccation; // Return default in dry-run mode
}
return self::DAMAGE_TYPES[$input];

View File

@@ -195,6 +195,7 @@ final class MDConcEntryTypes implements MDImporterConcordanceListInterface {
"Excavation" => "3",
"Feltárás" => "3",
"Grabung" => "3",
"Grabungsfund" => "3",
"Grabungsfund Arch. Landesamt" => "3",
"Bergung" => "3",
@@ -375,7 +376,8 @@ final class MDConcEntryTypes implements MDImporterConcordanceListInterface {
return self::ENTRY_TYPES_VERBOSE[$inputTrimmed];
}
throw new MDImporterMissingConcordance("Unknown entry type: " . $input);
MDImporterMissingConcordance::throw("entry (to museum)", $input);
return "99"; // Return default in dry-run mode
}
}

View File

@@ -397,7 +397,8 @@ vermuteter Herstellungsort' => 1,
public static function getConcordanceTarget(string $input):int {
if (!isset(self::EVENT_TYPE_NAMES_TO_ID[$input])) {
throw new MDImporterMissingConcordance("Unknown event type: '" . $input . "'");
MDImporterMissingConcordance::throw("event", $input);
return 1; // Return default in dry-run mode
}
return self::EVENT_TYPE_NAMES_TO_ID[$input];

View File

@@ -28,7 +28,7 @@ enum MDConcFieldRelatedWorksType {
*/
public static function fromString(string $input):MDConcFieldRelatedWorksType {
return match($input) {
$output = match($input) {
"Dokumentiert in",
"dokumentiert in",
@@ -199,8 +199,15 @@ enum MDConcFieldRelatedWorksType {
"" => self::undefined,
default => throw new MDpageParameterNotFromListException("Unknown target field for related works type: " . $input),
default => null,
};
if ($output === null) {
MDImporterMissingConcordance::throw("related work type", $input);
return self::undefined; // Return default in dry-run mode
}
return $output;
}
}

View File

@@ -86,7 +86,8 @@ final class MDConcLanguages implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):string {
if (!isset(self::LANGUAGES_LIST[$input])) {
throw new MDImporterMissingConcordance("Unknown language type: " . $input);
MDImporterMissingConcordance::throw("language", $input);
return "de"; // Return default in dry-run mode
}
return self::LANGUAGES_LIST[$input];

View File

@@ -163,7 +163,8 @@ final class MDConcLicenses implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):string {
if (!isset(self::LICENSES_LIST[$input])) {
throw new MDImporterMissingConcordance("Unknown licence type: " . $input);
MDImporterMissingConcordance::throw("licence", $input);
return "RR-F"; // Return default in dry-run mode
}
return self::LICENSES_LIST[$input];

View File

@@ -31,7 +31,8 @@ final class MDConcLoanTypes implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):string {
if (!isset(self::LOAN_TYPES[$input])) {
throw new MDImporterMissingConcordance("Unknown loan type: " . $input);
MDImporterMissingConcordance::throw("loan", $input);
return "outgoing"; // Return default in dry-run mode
}
return self::LOAN_TYPES[$input];

View File

@@ -23,6 +23,7 @@ final class MDConcMarkingPosition implements MDImporterConcordanceListInterface
"Mitte" => "center",
"vorn am Kasten, mittig, einseitig" => "center",
"an Gehäuse mittig" => "center",
'mitte' => 'center', // Center
// Left
"Links" => "left",
@@ -35,6 +36,7 @@ final class MDConcMarkingPosition implements MDImporterConcordanceListInterface
"Waagebalken links" => "left",
"Vorderseite links (Brusthöhe)" => "left",
"an Skala links und am Gehäuse Fronseite" => "left",
'mitte links' => 'left', // Left
// Right
"mittig rechts" => "right",
@@ -43,9 +45,13 @@ final class MDConcMarkingPosition implements MDImporterConcordanceListInterface
"rechts neben Bildnis" => "right",
"Rechter Bildrand" => "right",
"Balken rechts" => "right",
'Mitte rechts' => 'right', // Right
// Bottom
"unten" => "bottom",
'Mitte unten' => 'bottom', // Bottom
'unten links u. rechts' => 'bottom', // Bottom
'unten rechts/links' => 'bottom', // Bottom
"unter der Zeichnung" => "bottom",
"unter der Bild" => "bottom",
"unterer Bildrand" => "bottom",
@@ -166,6 +172,7 @@ final class MDConcMarkingPosition implements MDImporterConcordanceListInterface
"Rückseite Keilrahmen" => "rear_side",
"Rükseite" => "rear_side",
"Rückseite, unter Doublierung" => "rear_side",
'verso' => 'rear_side', // Rear side
// rear_bottom
"Rückseite unten" => "rear_bottom",
@@ -450,7 +457,8 @@ final class MDConcMarkingPosition implements MDImporterConcordanceListInterface
public static function getConcordanceTarget(string $input):string {
if (!isset(self::MARKING_POSITIONS_VERBOSE[$input])) {
throw new MDImporterMissingConcordance("Unknown marking position: " . $input);
MDImporterMissingConcordance::throw("marking position", $input);
return "other"; // Return default in dry-run mode
}
return self::MARKING_POSITIONS_VERBOSE[$input];

View File

@@ -16,6 +16,7 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
// Default: Handwritten
"-" => "handwritten",
"x" => "handwritten",
'Handschriftlich mit Bleistift - Signatur' => 'handwritten', // Handwritten
"schwarz" => "handwritten",
"braun" => "handwritten",
"Leinenarbeit" => "handwritten",
@@ -57,6 +58,25 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
"aufgemalt/geschrieben" => "handwritten",
"Aufschrift" => "handwritten",
"Aufschrift (Bleistift)" => "handwritten",
'handschirftlich - Handschrift' => 'handwritten', // Handwritten
'handschirftlich mit Bleistift - Signatur' => 'handwritten', // Handwritten
'handschriflich mit Bleistift - Handschrift' => 'handwritten', // Handwritten
'handschriflich mit Bleistift - Signatur' => 'handwritten', // Handwritten
'handschrifltich mit Bleistift - Signatur' => 'handwritten', // Handwritten
'handschriftich mit Bleistift - Signatur' => 'handwritten', // Handwritten
'handschriftlich - Handschrift' => 'handwritten', // Handwritten
'handschriftlich mit Bleisift - Signatur' => 'handwritten', // Handwritten
'handschriftlich mit Bleistift - Beschriftung' => 'handwritten', // Handwritten
'handschriftlich mit Bleistift - Handschrift' => 'handwritten', // Handwritten
'handschriftlich mit Feder - Signatur' => 'handwritten', // Handwritten
'handschriftlich mit Kohle - Signatur' => 'handwritten', // Handwritten
'handschriftlich mit Kugelschreiber - Handschrift' => 'handwritten', // Handwritten
'handschriftlich mit schwarzer Kreide - Signatur' => 'handwritten', // Handwritten
'handschriftliche Dedikation - Handschrift' => 'handwritten', // Handwritten
'handschriftllich mit Bleistift - Handschrift' => 'handwritten', // Handwritten
'handschriftllich mit Bleistift - Signatur' => 'handwritten', // Handwritten
'hanschriftlich mit Bleistift - Signatur' => 'handwritten', // Handwritten
'marking' => 'handwritten', // Handwritten
"Aufschrift mit Tinte" => "handwritten",
"Beischrift" => "handwritten",
"Benennung" => "handwritten",
@@ -230,6 +250,12 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
"Druck, weiße Schrift" => "overprint",
"gedruckt und geprägt" => "overprint",
"gdruckt" => "overprint",
'gedruckt - Inschrift' => 'overprint', // Overprint
'gedruckt - Signatur' => 'overprint', // Overprint
'gedruckt - Stempel' => 'overprint', // Overprint
'gedruckt im Stein - Beschriftung' => 'overprint', // Overprint
'gedruckt im Stein - Inschrift' => 'overprint', // Overprint
'gedruckt im Stein - Signatur' => 'overprint', // Overprint
"gerduckt" => "overprint",
"goldener Druck mit Ornamenten und Zierrahmen" => "overprint",
"Golddruck" => "overprint",
@@ -299,11 +325,15 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
"schwarz gestempelt" => "stamp",
"Signaturenstempel" => "stamp",
"stamped" => "stamp",
'gestemnpelt - Stempel' => 'stamp', // Stamped
'gestempelt - Signatur' => 'stamp', // Stamped
'gestempelt - Stempel' => 'stamp', // Stamped
"Stempel" => "stamp",
"Stempel (rund)" => "stamp",
"Stempel,Kugelschreiber" => "stamp",
"Stempel eingeprägt" => "stamp",
"Stempelaufdruck" => "stamp",
'Signatur gestempelt - Signatur' => 'stamp', // Stamped
"Beschriftung (gestempelt)" => "stamp",
"Beschriftung auf Montierung (gestempelt)" => "stamp",
@@ -399,6 +429,14 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
"eingeritzt" => "scarified",
"handschliff" => "scarified",
"Schliff" => "scarified",
'Signatur geritzt - Signatur' => 'scarified', // Scarified
'Signatur geritzt in der Platte - Signatur' => 'scarified', // Scarified
'geritzt - Beschriftung' => 'scarified', // Scarified
'geritzt - Inschrift' => 'scarified', // Scarified
'geritzt - Marke' => 'scarified', // Scarified
'geritzt - Signatur' => 'scarified', // Scarified
'geritzt in der Platte - Beschriftung' => 'scarified', // Scarified
'geritzt in der Platte - Signatur' => 'scarified', // Scarified
# Hallmarked
"gepunzt" => "hallmarked",
@@ -416,7 +454,9 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
"Signatur" => "signature",
"signiert" => "signature",
"farbig bemalt und glasiert" => "signature",
'geruckt - Signatur' => 'signature', // Signature
"gemalt und glasiert" => "signature",
'Signatur gedruckt im Stein - Signatur' => 'signature', // Signature
"Signatur (handschriftlich)" => "signature",
"Signatur (gedruckt)" => "signature",
"Signatur (gemalt)" => "signature",
@@ -432,14 +472,20 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
"Signatur mit Datum (gemalt)" => "signature",
"Signatur mit Datum (gestempelt)" => "signature",
"Signatur mit Datum (gezeichnet)" => "signature",
'signatur im Holzstock - Signatur' => 'signature', // Signature
'signatur im Stein - Signatur' => 'signature', // Signature
"Künstlersignatur" => "signature",
"Signatur (geritzt)" => "signature",
"Signatur mit Kugelschreiber" => "signature",
"handschriftlich mit Bleistift - Signatur" => "signature",
"im Stein - Signatur" => "signature",
'Signatur im Holzstock - Signatur' => "signature",
'Signatur im Stein - Signatur' => "signature",
'Signatur in der Platte - Signatur' => "signature",
# Watermark
"Wasserzeichen" => "watermark",
'Wasserzeichen - Wasserzeichen' => 'watermark', // Watermark
];
@@ -453,7 +499,8 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):string {
if (!isset(self::MARKING_TYPES_VERBOSE[$input])) {
throw new MDImporterMissingConcordance("Unknown marking type: " . $input);
MDImporterMissingConcordance::throw("marking", $input);
return "marking"; // Return default in dry-run mode
}
return self::MARKING_TYPES_VERBOSE[$input];

View File

@@ -19,7 +19,7 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
*/
public static function getConcordanceTarget(string $input):MDMeasurementType|false {
return match($input) {
$output = match($input) {
// Just list entries
"Allgemein",
@@ -187,8 +187,56 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"Höhe (Objekt)",
"Höhe (Etui)",
"Höhe (Heft)",
"Höhe (Foto)",
"Höhe (Dose)",
"Höhe (netto)",
"Höhe (a mit b-d)",
"Höhe (e)",
"Höhe (S 6289/5a)",
"Höhe (S 6289/5b)",
"Höhe (S 6291/3)",
"Höhe (S 6291/4)",
"Höhe (S 6291/5)",
"Höhe (S 6291/6)",
"Höhe (S 6295/3)",
"Höhe (S 6295/4)",
"Höhe (S 6295/5)",
"Höhe (S 6316/1)",
"Höhe (S 6316/2)",
"Höhe (S 6316/3)",
"Höhe (S 6316/4)",
"Höhe (S 6316/5)",
"Höhe (S 6418a)",
"Höhe (aufgeklappt)",
"Höhe (S 6419a)",
"Höhe (a)",
"Höhe (a mit b)",
"Höhe (S 6519/1)",
"Höhe (S 6530/1)",
"Höhe (S 6542/1)",
"Höhe (S 6549/1-3)",
"Höhe (S 6552/1-5)",
"Höhe (je Band)",
"Höhe (ohne Schnur)",
"Höhe (S 6560/1a-c =)",
"Höhe (S 6561/10 = größter)",
"Höhe (S 6561/13, andere)",
"Höhe (S 6561/18,)",
"Höhe (Nadel auf Papier)",
"Höhe (Hose in Ver-)",
"Höhe (einzelnes Tütchen)",
"Höhe (1)",
"Höhe (a-c)",
"Höhe (Kanne)",
"Höhe (S 6832/1)",
"Höhe (a und b)",
"Höhe (je Bild)",
"Höhe (S 6844/1)",
"Höhe (S 6844/2)",
"Höhe (je Liste)",
"Höhe (je Plan außer 3b)",
"Höhe (Platte in Hülle)",
"Höhe (S 6852/1)",
"Höhe (Druckstock)",
"Höhe (Blatt/Platte)",
"Höhe (ausgeklappt)",
@@ -245,16 +293,143 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
'Höhe (Einleger 22)',
'Höhe (Einleger 23)',
'Höhe (Einleger 24)',
"Höhe (S 6530/2)",
"Höhe (S 6542/2)",
"Höhe (S 6549/4-5)",
"Höhe (S 6552/6)",
"Höhe (S 6832/2)",
"Höhe (S 6845/3b)",
"Höhe (S 6852/2a-b)",
"Höhe (S 6877/3)",
"Höhe (S 6914/2)",
"Höhe (S 6931/2)",
"Höhe (S 6941/2)",
"Höhe (S 6962/7)",
"Höhe (S 7083/2)",
"Höhe (S 7135/1b)",
"Höhe (5)",
"Höhe (S 6561/11)",
"Höhe (S 6542/5)",
"Höhe (S 7135/3)",
"Höhe (S 7141/2)",
"Höhe (Springerle in Tüte)",
"Höhe (b)",
"Höhe (e und f)",
"Höhe (eine Glühbirne)",
"Höhe (gesamter Stapel)",
"Höhe (gesamter Stapel)[67/4521]",
"Höhe (S 6877/1 u. 2)",
"Höhe (je Album)",
"Höhe (1)",
"Höhe (Griff, beide Hälften)",
"Höhe (1)",
"Höhe (S 6914/1)",
"Höhe (gesamter Bogen)",
"Höhe (Springerle)",
"Höhe (S 6931/1)",
"Höhe (S 6941/1)",
"Höhe (S 6962/1-6, je)",
"Höhe (a mit b)",
"Höhe (je Ziegel)",
"Höhe (S 6519/7)",
"Höhe (S 6519/8)",
"Höhe (S 6519/9)",
"Höhe (1-4)",
"Höhe (je)",
"Höhe (Tafel)",
"Höhe (Plakette)",
"Höhe (a)",
"Höhe (Insgesamt)",
"Höhe (S 7083/1)",
"Höhe (Stich ohne Rahmen)",
"Höhe (pro Plombe)",
"Höhe (3)",
"Höhe (3-4)",
"Höhe (Haube)",
"Höhe (S 6519/4)",
"Höhe (S 6542/4)",
"Höhe (S 7135/2)",
"Höhe (d)",
"Höhe (a-b)",
"Höhe (1)",
"Höhe (1)",
"Höhe (je Tuch)",
"Höhe (a)",
"Höhe (1 und 2, je a-b)",
"Höhe (S 7135/1a)",
"Höhe (S 7141/1)",
"Höhe (je Vierer-Bogen)",
"Höhe (a und b)",
"Höhe (a)",
"Höhe (b und d)",
"Höhe (S 7408/2)",
"Höhe (je Teller)",
"Höhe (a)",
"Höhe (a und c)",
"Höhe (Eimerchen)",
"Höhe (S 7408/1)",
"Höhe (a mit b)",
"Höhe (m. Rahmeninkl.Aufhä.)",
"Höhe (a)",
"Höhe (a mit b)",
'Höhe (Passepartout)',
'Höhe (Unterlage)',
'Höhe (Buch)',
'Höhe (Jeder Druck)',
'Höhe (Gesamthöhe)',
"Höhe (1 Tassengedeck)",
"Höhe (1 und 2, je c-e)",
"Höhe (2)",
"Höhe (5-6)",
"Höhe (Nadeln in Verpack.)",
"Höhe (S 6418b)",
"Höhe (S 6419b)",
"Höhe (S 6542/3)",
"Höhe (S 6877/4)",
"Höhe (S 6914/3)",
"Höhe (S 6962/8)",
"Höhe (S 7083/3)",
"Höhe (S 7135/1c)",
"Höhe (Höhe)",
"Höhe (Mappe)",
"Höhe (c)",
"Höhe (g mit h)",
"Reliefhöhe" => MDMeasurementType::height,
"Länge",
"Länge OT",
"Länge H",
"Länge (1)",
"Länge (2)",
"Länge (3)",
"Länge (4)",
"Länge (5)",
"Länge (6)",
"Länge (7)",
"Länge (8)",
"Länge (a)",
"Länge (b)",
"Länge (c)",
"Länge (d)",
"Länge (e)",
"Länge (f)",
"Länge (g)",
"Länge (8)",
"Länge (1c)",
"Länge (Mappe)",
"Tiefe (Mappe)",
"Länge (S 6514/3)",
"Länge (S 6519/3)",
"Länge (S 7139/3)",
"Tiefe (S 6553/2)",
"Länge (S 6398/21)",
"Länge (S 6398/22)",
"Länge (1f)",
"Länge (S 6519/6)",
"Länge (S 7139/6)",
"Länge (S 7139/7)",
"Länge (S 7139/8)",
"Länge (S 7139/9)",
"Länge (ausgeklappt)",
"length",
"(Länge)",
@@ -276,6 +451,16 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"Außenmaß (Tiefe)",
"Teife",
"length",
"Länge (1b)",
"Länge (S 6424/4)",
"Länge (S 6514/2)",
"Länge (S 6519/2)",
"Länge (S 6795/2a und b)",
"Länge (S 7069b)",
"Länge (S 7081/3)",
"Länge (S 7139/2)",
"Tiefe (S 6553/1)",
"Tiefe (per Päckchen)",
"Bruttomass (Länge)",
"Bruttomass (Tiefe)",
"Kartierung (Länge)",
@@ -326,6 +511,25 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
'Tiefe (Buch)',
'Länge (Dose)',
'Tiefe (Dose)',
"Länge (1a)",
"Länge (S 7081/1-2)",
"Länge (S 7139/1)",
"Länge (S 6519/8a-e)",
"Länge (S 6514/1)",
"Länge (S 6424/3)",
"Länge (mit Kordel)",
"Länge (S 6795/1a und b)",
"Länge (1d)",
"Länge (S 6419c)",
"Länge (S 7139/4)",
"Länge (mit Handhabe)",
"Länge (1e)",
"Länge (S 6519/5)",
"Länge (S 6560/1b = Samtband)",
"Länge (S 7139/5)",
"Tiefe (kleinerer Größe)",
"Tiefe (etwas kleiner)",
"Tiefe (ähnlicher Größe)",
"depth",
"Dicke" => MDMeasurementType::length,
@@ -337,8 +541,11 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"Breite (Etui)",
"Breite (Heft)",
"Breite (netto)",
"Breite (Batt)",
"Breite (Foto)",
"Breite (a)",
"Breite (S 7069a)",
"Breite (aufgeschlagen)",
"Breite (S 6799/1)",
"Breite größtes Stück",
"Breite (gesamt)",
"Breite (Druckstock)",
@@ -351,7 +558,26 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"(Breite)",
"Lichtmass (Breite)",
" (Breite)",
"Breite (ein Nagel)",
"width",
"Breite (Breite)",
"Breite (Mappe)",
"Breite (S 6576/1)",
"Breite (mit Griffen)",
"Breite (mit Handhabe)",
"Breite (BH, S 6561/1 - 9 mit)",
"Breite (Ensemble im Kästchen)",
"Breite (Hüfthalter)",
"Breite (S 6561/19-20 mit)",
"Breite (S 6576/2a-b)",
"Breite (S 6799/2a-b)",
"Breite (S 7069a und b)",
"Breite (a-d)",
"Breite (b)",
"Breite (c)",
"Breite (gesamt mit Handhabe)",
"Breite (mit Henkel)",
"Breite (packung)",
"width (overall)",
"Breite (Griff)",
"Außenmaß (Breite)",
@@ -373,6 +599,8 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
'Breite (Buchblock mit Einabnd)',
'Breite (Stein)',
'Breite (Schuber)',
"Breite (S 6560/1a = Anhänger)",
"Breite (vergleichbarer od.)",
'Breite (Karton)',
'Breite (Einleger)',
'Breite (Einleger 1)',
@@ -414,6 +642,62 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"Mündung (Durchmesser)",
"Rahmenaußenmaß Durchmesser",
"diameter",
"Durchmesser (a)",
"Durchmesser (b)",
"Durchmesser (c)",
"Durchmesser (d)",
"Durchmesser (e)",
"Durchmesser (f)",
"Durchmesser (g)",
"Durchmesser (1)",
"Durchmesser (2)",
"Durchmesser (3)",
"Durchmesser (4)",
"Durchmesser (S 7133/1)",
"Durchmesser (S 7133/3)",
"Durchmesser (S 7133/4)",
"Durchmesser (S 7134/1)",
"Durchmesser (S 7139/10)",
"Durchmesser (S 7139/11)",
"Durchmesser (S 6406/9a)",
"Durchmesser (S 6406/10a)",
"Durchmesser (S 6406/11a)",
"Durchmesser (S 6406/12a)",
"Durchmesser (S 6406/13a)",
"Durchmesser (S 6406/14a)",
"Durchmesser (S 6406/15a)",
"Durchmesser (S 6406/16a)",
"Durchmesser (S 6406/17a)",
"Durchmesser (S 6406/10c)",
"Durchmesser (S 6406/11c)",
"Durchmesser (S 6406/12c)",
"Durchmesser (S 6406/13c)",
"Durchmesser (S 6406/14c)",
"Durchmesser (S 6406/15b)",
"Durchmesser (S 6406/16b)",
"Durchmesser (S 6406/17b)",
"Durchmesser (S 6406/9c)",
"Durchmesser (S 6406/9d)",
"Durchmesser (S 6406/9e)",
"Durchmesser (S 6406/9f)",
"Durchmesser (S 6406/9g)",
"Durchmesser (Haube)",
"Durchmesser (S 6406/10d)",
"Durchmesser (S 6406/11d)",
"Durchmesser (Stand)",
"Durchmesser (Fuß)",
"Durchmesser (Rand /2)",
"Durchmesser (S 6406/10b)",
"Durchmesser (S 6406/11b)",
"Durchmesser (S 6406/12b)",
"Durchmesser (S 6406/13b)",
"Durchmesser (S 6406/14b)",
"Durchmesser (S 6406/9b)",
"Durchmesser (S 7133/2)",
"Durchmesser (S 7133/5)",
"Durchmesser (oberer Rand)",
"Durchmesser (Rand /1)",
"Durchmesser (Foto)",
"Außenmaß (Durchmesser)",
"Durchmesser in Richtung Bohrung",
"Durchmesser quer zur Bohrung",
@@ -424,7 +708,6 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"Durchmesser (Höhe)",
"Durchmesser (Breite)",
"Durchmesser (Länge)",
"Durchmesser (Länge)",
"Durchmesser (Dose)",
"Objektmaß (Durchmesser)",
"Objektmass (Durchmesser)",
@@ -456,6 +739,7 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"Breite (Blatt)",
"Blattmaß (Breite)",
"Breite (Batt)",
"Breite (Blatt/Platte)",
"Breite (Blattplatte)",
"Breite (Blatt (mittig gefalzt))",
@@ -472,10 +756,18 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"Höhe (Darsetllung)",
"Höhe (Blatt/Darstellung)",
"Bildmaß (Höhe)",
"Höhe (Grafik ohne Pass.)",
"Höhe (Grafik ohne Pass.)",
"Höhe (Grafik ohne Pass.)",
"Höhe (Grafik ohne Pass.)",
"Höhe (Grafik ohne Pass.)",
"Höhe (Grafik ohne Passep.)",
"Höhe (Grafik ohne Passep.)",
"Höhe (Platte/Bild)",
"Höhe (Druckstock/Bild)",
"Höhe max (Darstellung)",
"Höhe (Chine collé)",
"Höhe (Batt)",
"Bildmass (Höhe)" => MDMeasurementType::height_image_size,
"Breite (Bild)",
@@ -608,9 +900,16 @@ final class MDConcMeasurementTypes implements MDImporterConcordanceListInterface
"Bodendurchmesser",
"Durchmesser (Boden)" => MDMeasurementType::diameter_of_base,
default => throw new MDImporterMissingConcordance("Unmapped specific measurement type: " . $input),
default => null,
};
if ($output === null) {
MDImporterMissingConcordance::throw("measurements", $input);
return MDMeasurementType::diameter_of_base; // Return default in dry-run mode
}
return $output;
}
}

View File

@@ -26,7 +26,8 @@ final class MDConcObjectForms implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):string {
if (!isset(self::FORMS_LIST[$input])) {
throw new MDImporterMissingConcordance("Unknown form type: " . $input);
MDImporterMissingConcordance::throw("form/shape", $input);
return 'cube'; // Return default in dry-run mode
}
return self::FORMS_LIST[$input];

View File

@@ -24,21 +24,40 @@ final class MDConcObjectTagRelTypes implements MDImporterConcordanceListInterfac
'Druckvorlage' => 'tag',
'emotion' => 'tag',
'atmosphäre' => 'tag',
'Objektart' => 'tag',
'objektart' => 'tag',
'schwarz-grau' => 'tag',
'schwarzgrau' => 'tag',
'schwarz' => 'tag',
'hellbraun' => 'tag',
'schwarz-grau fleckig' => 'tag',
'schwarzbraun' => 'tag',
'rötlich' => 'tag',
'graubraun' => 'tag',
'schlagwort hist.ereignis' => 'tag',
'schlagwort thema' => 'tag',
'Objektart' => 'object_type',
'objektart' => 'object_type',
'object_type' => 'object_type',
"motive" => "display_subject",
"motiv" => "display_subject",
"display" => "display_subject",
"Bildelement" => "display_subject",
"display_subject" => "display_subject",
"material" => "material",
"technique" => "technique",
"technik" => "technique",
'thema' => 'topic',
'topic' => 'topic',
'erwähnt' => 'mentioned',
'mentioned' => 'mentioned',
'taxon' => 'taxon',
];
// Maps to event type
@@ -63,7 +82,8 @@ final class MDConcObjectTagRelTypes implements MDImporterConcordanceListInterfac
return self::RELATION_TYPES_MAPPED_TO_EVENTS[strtolower($input)];
}
throw new MDImporterMissingConcordance("Unknown object-tag relationship type: " . $input);
MDImporterMissingConcordance::throw("object-tag relationship", $input);
return ['event_type' => 24, 'target_section' => 'time'];
}
@@ -87,7 +107,8 @@ final class MDConcObjectTagRelTypes implements MDImporterConcordanceListInterfac
throw new MDImporterTagRelationTypeIsEventType("Tag-object relationship type is signifies not tags, but an event component.");
}
throw new MDImporterMissingConcordance("Unknown object-tag relationship type: '" . $input . "'");
MDImporterMissingConcordance::throw("object-tag relationship", $input);
return 'tag'; // Return default in dry-run mode
}
}

View File

@@ -65,7 +65,8 @@ final class MDConcOwnershipStatus implements MDImporterConcordanceListInterface
if (isset(self::OWNERSHIP_TYPES_VERBOSE[trim($input)])) {
return self::OWNERSHIP_TYPES_VERBOSE[trim($input)];
}
throw new MDImporterMissingConcordance("Unknown ownership type: " . $input);
MDImporterMissingConcordance::throw("ownership", $input);
return 'deaccessed'; // Return default in dry-run mode
}
return self::OWNERSHIP_TYPES_VERBOSE[$input];

View File

@@ -108,7 +108,8 @@ final class MDConcPlace implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):int {
if (!isset(self::PLACE_ROLES_TO_EVENT_TYPE[$input])) {
throw new MDImporterMissingConcordance("Unknown place type: " . $input);
MDImporterMissingConcordance::throw("place (in event)", $input);
return 1; // Return default in dry-run mode
}
return self::PLACE_ROLES_TO_EVENT_TYPE[$input];

View File

@@ -13,6 +13,7 @@ final class MDConcSex implements MDImporterConcordanceListInterface {
private const SEXES_LIST = [
'Männlich' => 'male',
'Weiblich' => 'female',
'diverse' => 'other',
];
@@ -26,7 +27,8 @@ final class MDConcSex implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):string {
if (!isset(self::SEXES_LIST[$input])) {
throw new MDImporterMissingConcordance("Unknown sex type: " . $input);
MDImporterMissingConcordance::throw("sex", $input);
return 'other'; // Return default in dry-run mode
}
return self::SEXES_LIST[$input];

View File

@@ -21,10 +21,34 @@ final class MDConcSourceTypes implements MDImporterConcordanceListInterface {
"buch" => "book",
"literatur" => "book",
"document]book" => "book",
'Buchpublikation' => 'book', // Book
'Produkthandbuch' => 'book', // Book
'Produkthandbuch/ Zusatzmaterial??' => 'book', // Book
'Produkthandbuch ' => 'book', // Book
'Buchpublikation ' => 'book', // Book
'Produkthandbuch (Objektart Missing)' => 'book', // Book
'Ausstellungskatalog' => 'book', // Book
'Comicbuch' => 'book', // Book
'Katalog' => 'book', // Book
// Misc
"Weiteres" => "misc",
"document]avm" => "misc",
'Keine Angabe' => 'misc', // Miscelaneous
'Handschriften' => 'misc', // Miscelaneous
'Divers' => 'misc', // Miscelaneous
'Handschrift' => 'misc', // Miscelaneous
'Flyer/Poster' => 'misc', // Miscelaneous
'Comic' => 'misc', // Miscelaneous
'Ordner' => 'misc', // Miscelaneous
'Diskette' => 'misc', // Miscelaneous
'Wissenschaftliche Hausarbeit' => 'misc', // Miscelaneous
// Periodical
'Magazin' => 'periodical', // Periodical
// Proceedings
'Tagungsunterlagen' => 'proceedings', // Proceedings
];
@@ -44,7 +68,8 @@ final class MDConcSourceTypes implements MDImporterConcordanceListInterface {
return self::SOURCE_TYPES[strtolower($input)];
}
throw new MDImporterMissingConcordance("Unknown source type: " . $input);
MDImporterMissingConcordance::throw("source", $input);
return 'proceedings'; // Return default in dry-run mode
}
}

View File

@@ -54,7 +54,8 @@ final class MDConcTime implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):int {
if (!isset(self::TIME_ROLES_TO_EVENT_TYPE[$input])) {
throw new MDImporterMissingConcordance("Unknown time type: " . $input);
MDImporterMissingConcordance::throw("time (in event)", $input);
return 1; // Return default in dry-run mode
}
return self::TIME_ROLES_TO_EVENT_TYPE[$input];

View File

@@ -45,7 +45,8 @@ final class MDConcTitleTypes implements MDImporterConcordanceListInterface {
public static function getConcordanceTarget(string $input):string {
if (!isset(self::TITLE_TYPES[$input])) {
throw new MDImporterMissingConcordance("Unknown title type: " . $input);
MDImporterMissingConcordance::throw("title", $input);
return "Dialect"; // Return default in dry-run mode
}
return self::TITLE_TYPES[$input];