Skip to content

Commit

Permalink
Reuse existing prefLabels for sidecar approach
Browse files Browse the repository at this point in the history
- if a prefLabel is found do not wrap it to an array
  • Loading branch information
jschnasse authored and dr0i committed Jan 4, 2017
1 parent 1c86cdc commit 1a5d3aa
Show file tree
Hide file tree
Showing 144 changed files with 242 additions and 457 deletions.
4 changes: 3 additions & 1 deletion src/main/java/de/hbz/lobid/helper/JsonConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ private Map<String, Object> createObjectWithoutId(String uri) {
private void createObject(String uri, Map<String, Object> newObject) {
for (Statement s : find(uri)) {
Etikett e = etikette.getEtikett(s.getPredicate().stringValue());
if (s.getObject() instanceof org.openrdf.model.Literal) {
if (labelKey.equals(e.name)) {
newObject.put(e.name, s.getObject().stringValue());
} else if (s.getObject() instanceof org.openrdf.model.Literal) {
if (newObject.containsKey(e.name)) {
Object existingValue = newObject.get(e.name);
if (existingValue instanceof String) {
Expand Down
10 changes: 5 additions & 5 deletions src/test/resources/hbz01.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"agent" : {
"altLabel" : [ "Schierbaum, Ursula Clemens-", "Schierbaum, Ursula C.-", "Clemens, Ursula" ],
"id" : "http://d-nb.info/gnd/172845785",
"label" : [ "Clemens-Schierbaum, Ursula", "http://d-nb.info/gnd" ],
"label" : "Clemens-Schierbaum, Ursula",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -20,7 +20,7 @@
"agent" : {
"altLabel" : [ "Pfarrei Sankt Joseph und Sankt Antonius Bergisch Gladbach", "Katholische Kirchengemeinde St. Joseph und St. Antonius Bergisch Gladbach", "Katholische Kirchengemeinde Sankt Joseph und Sankt Antonius Bergisch Gladbach" ],
"id" : "http://d-nb.info/gnd/1060772442",
"label" : [ "http://d-nb.info/gnd", "Pfarrei St. Joseph und St. Antonius Bergisch Gladbach" ],
"label" : "Pfarrei St. Joseph und St. Antonius Bergisch Gladbach",
"type" : [ "CorporateBody" ]
},
"role" : [ {
Expand All @@ -32,7 +32,7 @@
"agent" : {
"altLabel" : [ "Pfarrgemeinderat Sankt Antonius Abbas Herkenrath", "Pfarrei Sankt Antonius Abbas Herkenrath", "Pfarrgemeinderat", "Pfarrei St. Antonius Abbas Herkenrath", "Pfarrei Sankt Antonius Abbas Bergisch Gladbach- Herkenrath" ],
"id" : "http://d-nb.info/gnd/2175350-7",
"label" : [ "Pfarrei Sankt Antonius Abbas Herkenrath", "http://d-nb.info/gnd" ],
"label" : "Pfarrei Sankt Antonius Abbas Herkenrath",
"type" : [ "CorporateBody" ]
},
"role" : [ {
Expand Down Expand Up @@ -110,12 +110,12 @@
"subject" : [ {
"altLabel" : [ "Pfarrei Sankt Joseph und Sankt Antonius Bergisch Gladbach", "Katholische Kirchengemeinde St. Joseph und St. Antonius Bergisch Gladbach", "Katholische Kirchengemeinde Sankt Joseph und Sankt Antonius Bergisch Gladbach" ],
"id" : "http://d-nb.info/gnd/1060772442",
"label" : [ "http://d-nb.info/gnd", "Pfarrei St. Joseph und St. Antonius Bergisch Gladbach" ],
"label" : "Pfarrei St. Joseph und St. Antonius Bergisch Gladbach",
"type" : [ "CorporateBody" ]
}, {
"altLabel" : [ "Pfarrgemeinderat Sankt Antonius Abbas Herkenrath", "Pfarrei Sankt Antonius Abbas Herkenrath", "Pfarrgemeinderat", "Pfarrei St. Antonius Abbas Herkenrath", "Pfarrei Sankt Antonius Abbas Bergisch Gladbach- Herkenrath" ],
"id" : "http://d-nb.info/gnd/2175350-7",
"label" : [ "Pfarrei Sankt Antonius Abbas Herkenrath", "http://d-nb.info/gnd" ],
"label" : "Pfarrei Sankt Antonius Abbas Herkenrath",
"type" : [ "CorporateBody" ]
}, {
"label" : "Geschichte",
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/output/json/00000/BT000002852.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"contribution" : [ {
"agent" : {
"id" : "http://d-nb.info/gnd/4018466-3",
"label" : [ "http://d-nb.info/gnd", "Freudenberg, Kreis Siegen-Wittgenstein" ],
"label" : "Freudenberg, Kreis Siegen-Wittgenstein",
"type" : [ "PlaceOrGeographicName" ]
},
"role" : [ {
Expand Down Expand Up @@ -51,11 +51,11 @@
"statementOfResponsibility" : "[Hrsg.: Stadt Freudenberg, Der Stadtdirektor]",
"subject" : [ {
"id" : "http://d-nb.info/gnd/4018466-3",
"label" : [ "http://d-nb.info/gnd", "Freudenberg, Kreis Siegen-Wittgenstein" ],
"label" : "Freudenberg, Kreis Siegen-Wittgenstein",
"type" : [ "PlaceOrGeographicName" ]
}, {
"id" : "http://d-nb.info/gnd/4020517-4",
"label" : [ "http://d-nb.info/gnd", "Geschichte" ],
"label" : "Geschichte",
"type" : [ "SubjectHeading" ]
} ],
"subjectChain" : [ "Freudenberg, Kreis Siegen-Wittgenstein | Geschichte" ],
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/output/json/00000/BT000003404.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
} ],
"subject" : [ {
"id" : "http://d-nb.info/gnd/4042570-8",
"label" : [ "http://d-nb.info/gnd", "Nordrhein-Westfalen" ],
"label" : "Nordrhein-Westfalen",
"type" : [ "PlaceOrGeographicName" ]
}, {
"label" : "Karte",
"type" : [ "SubjectHeading" ]
}, {
"id" : "http://d-nb.info/gnd/4115393-5",
"label" : [ "Niedersachsen, Süd", "http://d-nb.info/gnd" ],
"label" : "Niedersachsen, Süd",
"type" : [ "PlaceOrGeographicName", "SubjectHeading" ]
}, {
"label" : "Karte",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/output/json/00000/HT000009600.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"agent" : {
"altLabel" : [ "Angestellten-Gewerkschaft", "DAG", "Deutsche Angestellten-Gewerkschaft", "Gewerkschaft der Deutschen Angestellten" ],
"id" : "http://d-nb.info/gnd/37043-5",
"label" : [ "http://d-nb.info/gnd", "Deutsche Angestellten-Gewerkschaft" ],
"label" : "Deutsche Angestellten-Gewerkschaft",
"type" : [ "CorporateBody" ]
},
"role" : [ {
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/output/json/00004/BT000040377.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"contribution" : [ {
"agent" : {
"id" : "http://d-nb.info/gnd/105745944",
"label" : [ "http://d-nb.info/gnd", "Schmidt, Eckhard" ],
"label" : "Schmidt, Eckhard",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/output/json/00004/BT000041593.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"contribution" : [ {
"agent" : {
"id" : "http://d-nb.info/gnd/10880724X",
"label" : [ "http://d-nb.info/gnd", "Altekamp, Heinrich" ],
"label" : "Altekamp, Heinrich",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/output/json/00006/BT000067443.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"contribution" : [ {
"agent" : {
"id" : "http://d-nb.info/gnd/118033948",
"label" : [ "http://d-nb.info/gnd", "Meier, Elmar" ],
"label" : "Meier, Elmar",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down
14 changes: 7 additions & 7 deletions src/test/resources/output/json/00007/TT000075751.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"agent" : {
"altLabel" : [ "Britten, Edward B.", "Britten, Edward Benjamin", "Britten, ..." ],
"id" : "http://d-nb.info/gnd/118515527",
"label" : [ "Britten, Benjamin", "http://d-nb.info/gnd" ],
"label" : "Britten, Benjamin",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -15,7 +15,7 @@
}, {
"agent" : {
"id" : "http://d-nb.info/gnd/13482167X",
"label" : [ "http://d-nb.info/gnd", "Anderson, Lorna" ],
"label" : "Anderson, Lorna",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -26,7 +26,7 @@
}, {
"agent" : {
"id" : "http://d-nb.info/gnd/134926285",
"label" : [ "Nathan, Regina", "http://d-nb.info/gnd" ],
"label" : "Nathan, Regina",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -37,7 +37,7 @@
}, {
"agent" : {
"id" : "http://d-nb.info/gnd/134769236",
"label" : [ "Martineau, Malcolm", "http://d-nb.info/gnd" ],
"label" : "Martineau, Malcolm",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -49,7 +49,7 @@
"agent" : {
"altLabel" : [ "McDougall, Jamie", "Mac Dougall, Jamie" ],
"id" : "http://d-nb.info/gnd/134782852",
"label" : [ "http://d-nb.info/gnd", "MacDougall, Jamie" ],
"label" : "MacDougall, Jamie",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -60,7 +60,7 @@
}, {
"agent" : {
"id" : "http://d-nb.info/gnd/134845323",
"label" : [ "http://d-nb.info/gnd", "Lewis, Bryn" ],
"label" : "Lewis, Bryn",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -71,7 +71,7 @@
}, {
"agent" : {
"id" : "http://d-nb.info/gnd/134926277",
"label" : [ "http://d-nb.info/gnd", "Ogden, Craig" ],
"label" : "Ogden, Craig",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/output/json/00012/BT000128754.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"contribution" : [ {
"agent" : {
"id" : "http://d-nb.info/gnd/174423330",
"label" : [ "Job, Bertram", "http://d-nb.info/gnd" ],
"label" : "Job, Bertram",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down Expand Up @@ -59,14 +59,14 @@
} ],
"subject" : [ {
"id" : "http://d-nb.info/gnd/2050419-6",
"label" : [ "http://d-nb.info/gnd", "1. Fußball-Club Köln 01/07" ],
"label" : "1. Fußball-Club Köln 01/07",
"type" : [ "CorporateBody" ]
}, {
"label" : "Geschichte",
"type" : [ "SubjectHeading" ]
}, {
"id" : "http://d-nb.info/gnd/2041907-7",
"label" : [ "http://d-nb.info/gnd", "Verein für Leibesübungen Borussia 1900 Mönchengladbach" ],
"label" : "Verein für Leibesübungen Borussia 1900 Mönchengladbach",
"type" : [ "CorporateBody" ]
}, {
"label" : "Geschichte",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/output/json/00029/HT000290078.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"contribution" : [ {
"agent" : {
"id" : "http://d-nb.info/gnd/174737203",
"label" : [ "Aigner, Johann", "http://d-nb.info/gnd" ],
"label" : "Aigner, Johann",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/output/json/00121/TT001210514.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"agent" : {
"altLabel" : [ "Hitler, Adolfo", "Xitler, Adolf", "Hitorâ, Adorufu", "Hitler, Adolphe", "Hitlar", "Hitlers, Adolphs", "Gitler, Adol'f", "Gitler, ...", "Hitler, Adolph", "Hitler, ...", "Chitler, Adolphu", "Hitlers, Ādolfs", "Hitlar, Adūlf", "Chitler, Adolf" ],
"id" : "http://d-nb.info/gnd/118551655",
"label" : [ "Hitler, Adolf", "http://d-nb.info/gnd" ],
"label" : "Hitler, Adolf",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/output/json/00123/TT001230001.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"agent" : {
"altLabel" : [ "Fredericus, Germania, Imperator", "Federico, Germania, Imperatore", "Phreiderikos, Heiliges Römisches Reich, Kaiser", "Fridericus, Germania, Imperator", "Federico, di Svevia", "Frédéric, Allemagne, Empereur", "Federico, Sicilia, Re", "Friedrich, Deutschland, Kaiser", "Frédéric, Sicile, Roi", "Fridericus, Imperium Romanum-Germanicum, Imperator", "Friedrich II., Kaiser", "Fridericus, Sicilia, Rex", "Friedrich, Sizilien, König", "Friedrich, von Hohenstaufen", "Friderichus, Imperator", "Friderichus secundus, Imperator", "Federico, Sicilia, Rex", "Frédéric, Roger", "Federicus, Germania, Imperator", "Fridericus, Imperator", "Stupor mundi", "Frederick, Germany, Emperor" ],
"id" : "http://d-nb.info/gnd/118535765",
"label" : [ "http://d-nb.info/gnd", "Friedrich, II., Heiliges Römisches Reich, Kaiser" ],
"label" : "Friedrich, II., Heiliges Römisches Reich, Kaiser",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -16,7 +16,7 @@
"agent" : {
"altLabel" : [ "Manfred, Sicile, Roi", "Manfred, Tarent, Fürst", "Manfred, Sizilien, König", "Manfredi, Naples, King", "Manfredi, Sicily, King", "Manfred, Sicily, King", "Manfredo, Sicilia, Re", "Manfred, Naples, King", "Manfred, Tarente, Prince", "Manfred, Sicilia, Re", "Manfredus, Sicilia, Rex", "Manfred, von Sizilien", "Manfred, von Tarent" ],
"id" : "http://d-nb.info/gnd/118577018",
"label" : [ "Manfredi, Sicilia, Re", "http://d-nb.info/gnd" ],
"label" : "Manfredi, Sicilia, Re",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -28,7 +28,7 @@
"agent" : {
"altLabel" : [ "Alberto, Magno", "Albertus, Lauingensis", "Albert, le Grand", "Albertus, Colonus", "Albertus, Teutonicus", "Petrus, Theoctonicus", "Albert, von Bollstädt", "Albert, der Große", "Ps.-Albertus, Magnus", "Magnus, Albertus", "Albert, der Grosse", "Albertus, Grotus", "Albertus, Alemannus", "Albertus, Bolstadius", "Albertus Magnus", "Albertus, Parvus Lucius", "Albertus, de Colonia", "Bolstadius, Albertus", "Albert, the Great", "Petrus, Teutonicus", "Pseudo-Albertus, Magnus", "Albertus, de Bollstadt", "Albertus, de Lauging" ],
"id" : "http://d-nb.info/gnd/118637649",
"label" : [ "http://d-nb.info/gnd", "Albertus, Magnus" ],
"label" : "Albertus, Magnus",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/output/json/00131/HT001310215.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"contribution" : [ {
"agent" : {
"id" : "http://d-nb.info/gnd/177572388",
"label" : [ "SCHOLLE, ROGER H.", "http://d-nb.info/gnd" ],
"label" : "SCHOLLE, ROGER H.",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -15,7 +15,7 @@
"agent" : {
"altLabel" : [ "Dental Association", "ADA" ],
"id" : "http://d-nb.info/gnd/37460-X",
"label" : [ "http://d-nb.info/gnd", "American Dental Association" ],
"label" : "American Dental Association",
"type" : [ "CorporateBody" ]
},
"role" : [ {
Expand Down
8 changes: 4 additions & 4 deletions src/test/resources/output/json/00167/TT001671747.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"agent" : {
"altLabel" : "Mayr, A.",
"id" : "http://d-nb.info/gnd/137082479",
"label" : [ "http://d-nb.info/gnd", "Mayr, Alois" ],
"label" : "Mayr, Alois",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -16,7 +16,7 @@
"agent" : {
"altLabel" : [ "Geographische Kommission für Westfalen", "Provinzialinstitut für Westfälische Landes- und Volksforschung" ],
"id" : "http://d-nb.info/gnd/2056181-7",
"label" : [ "Provinzialinstitut für Westfälische Landes- und Volksforschung. Geographische Kommission für Westfalen", "http://d-nb.info/gnd" ],
"label" : "Provinzialinstitut für Westfälische Landes- und Volksforschung. Geographische Kommission für Westfalen",
"type" : [ "CorporateBody" ]
},
"role" : [ {
Expand Down Expand Up @@ -168,11 +168,11 @@
"statementOfResponsibility" : "hrsg. durch den Landschaftsverband Westfalen-Lippe, Geographische Kommission für Westfalen. Atlasred., wiss. und kartograph. Betreuung: Alois Mayr ...",
"subject" : [ {
"id" : "http://d-nb.info/gnd/4065781-4",
"label" : [ "http://d-nb.info/gnd", "Westfalen" ],
"label" : "Westfalen",
"type" : [ "PlaceOrGeographicName" ]
}, {
"id" : "http://d-nb.info/gnd/4073972-7",
"label" : [ "http://d-nb.info/gnd", "Landeskunde" ],
"label" : "Landeskunde",
"type" : [ "SubjectHeading" ]
}, {
"label" : "Atlas",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/output/json/00172/TT001726537.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"agent" : {
"altLabel" : [ "Maimbourg, Lewis", "Maimburgo, Luigi", "Romain, François", "Maimburgius, Ludovicus", "Maimbourg, ...", "Maimburg, Ludwig", "Maimburgus, Ludovicus" ],
"id" : "http://d-nb.info/gnd/115541802",
"label" : [ "Maimbourg, Louis", "http://d-nb.info/gnd" ],
"label" : "Maimbourg, Louis",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down
8 changes: 4 additions & 4 deletions src/test/resources/output/json/00189/HT001898812.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"contribution" : [ {
"agent" : {
"id" : "http://d-nb.info/gnd/177005009",
"label" : [ "http://d-nb.info/gnd", "Piprek, Jan" ],
"label" : "Piprek, Jan",
"type" : [ "Person" ]
},
"role" : [ {
Expand All @@ -15,7 +15,7 @@
"agent" : {
"altLabel" : "Ippoldt, Juljusz",
"id" : "http://d-nb.info/gnd/124515312",
"label" : [ "http://d-nb.info/gnd", "Ippoldt, Juliusz" ],
"label" : "Ippoldt, Juliusz",
"type" : [ "Person" ]
},
"role" : [ {
Expand Down Expand Up @@ -319,14 +319,14 @@
"statementOfResponsibility" : "Jan Piprek ...",
"subject" : [ {
"id" : "http://d-nb.info/gnd/4120314-8",
"label" : [ "http://d-nb.info/gnd", "Polnisch" ],
"label" : "Polnisch",
"type" : [ "SubjectHeading" ]
}, {
"label" : "Wörterbuch",
"type" : [ "SubjectHeading" ]
}, {
"id" : "http://d-nb.info/gnd/4113292-0",
"label" : [ "Deutsch", "http://d-nb.info/gnd" ],
"label" : "Deutsch",
"type" : [ "SubjectHeading" ]
} ],
"subjectChain" : [ "Polnisch | Wörterbuch | Deutsch" ],
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/output/json/00223/TT002234459.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@
} ],
"subject" : [ {
"id" : "http://d-nb.info/gnd/4049787-2",
"label" : [ "http://d-nb.info/gnd", "Rhein-Lahn-Kreis" ],
"label" : "Rhein-Lahn-Kreis",
"type" : [ "PlaceOrGeographicName" ]
}, {
"id" : "http://d-nb.info/gnd/4114067-9",
"label" : [ "Jakobsweg", "http://d-nb.info/gnd" ],
"label" : "Jakobsweg",
"type" : [ "PlaceOrGeographicName" ]
}, {
"label" : "Karte",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/output/json/00223/TT002234858.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"agent" : {
"altLabel" : [ "Oberste Landesplanungsbehörde", "Landespressestelle", "Landesplanungsbehörde", "Staatskanzlei", "Rheinland-Pfalz" ],
"id" : "http://d-nb.info/gnd/2029758-0",
"label" : [ "http://d-nb.info/gnd", "Rheinland-Pfalz. Staatskanzlei" ],
"label" : "Rheinland-Pfalz. Staatskanzlei",
"type" : [ "CorporateBody" ]
},
"role" : [ {
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/output/json/00261/HT002619538.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"agent" : {
"altLabel" : [ "Ėkonomičeskaja Komissija dlja Evropy", "CEE", "Európai Gazdasági Bizottság", "ECE", "Vereinte Nationen", "Commission Economique pour l'Europe", "Wirtschaftskommission für Europa", "Economic Commission for Europe", "Evropejskaja Ėkonomičeskaja Komissija", "Wirtschaftsausschuss für Europa", "Europäische Wirtschaftskommission", "UNECE", "UN-ECE" ],
"id" : "http://d-nb.info/gnd/2023669-4",
"label" : [ "Vereinte Nationen. Economic Commission for Europe", "http://d-nb.info/gnd" ],
"label" : "Vereinte Nationen. Economic Commission for Europe",
"type" : [ "CorporateBody" ]
},
"role" : [ {
Expand Down
Loading

0 comments on commit 1a5d3aa

Please sign in to comment.