Skip to content

Instantly share code, notes, and snippets.

@felixlohmeier
Last active August 19, 2019 13:13
Show Gist options
  • Save felixlohmeier/065727cffeafb216c24f730c40f3b1f6 to your computer and use it in GitHub Desktop.
Save felixlohmeier/065727cffeafb216c24f730c40f3b1f6 to your computer and use it in GitHub Desktop.
Automate GND reconciliation for OpenRefine
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 1 column, instead of 2. in line 2.
name;beruf;ort
J. Weizenbaum;Informatiker;Berlin
Twain, Mark;Schriftsteller;
Kumar, Lalit;;
Jemand;;
[
{
"op": "core/recon",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "name",
"config": {
"mode": "standard-service",
"service": "https://lobid.org/gnd/reconcile",
"identifierSpace": "https://lobid.org/gnd",
"schemaSpace": "https://lobid.org/gnd",
"type": {
"id": "Person",
"name": "Person"
},
"autoMatch": true,
"columnDetails": [
{
"column": "beruf",
"propertyName": "Beruf oder Beschäftigung (Literal)",
"propertyID": "professionOrOccupationAsLiteral"
}
],
"limit": 0
},
"description": "Reconcile cells in column name to type Person"
},
{
"op": "core/extend-reconciled-data",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "name",
"endpoint": "https://lobid.org/gnd/reconcile",
"identifierSpace": "https://lobid.org/gnd",
"schemaSpace": "https://lobid.org/gnd",
"extension": {
"properties": [
{
"id": "professionOrOccupation",
"name": "Beruf oder Beschäftigung"
},
{
"id": "placeOfBirth",
"name": "Geburtsort"
},
{
"id": "placeOfDeath",
"name": "Sterbeort"
},
{
"id": "geographicAreaCode",
"name": "Ländercode"
}
]
},
"columnInsertIndex": 1,
"description": "Extend data at index 1 based on column name"
},
{
"op": "core/row-removal",
"engineConfig": {
"facets": [
{
"type": "list",
"name": "name: judgment",
"expression": "forNonBlank(cell.recon.judgment, v, v, if(isNonBlank(value), \"(unreconciled)\", \"(blank)\"))",
"columnName": "name",
"invert": false,
"omitBlank": false,
"omitError": false,
"selection": [
{
"v": {
"v": "none",
"l": "none"
}
}
],
"selectBlank": false,
"selectError": false
}
],
"mode": "row-based"
},
"description": "Remove rows"
},
{
"op": "core/column-removal",
"columnName": "beruf",
"description": "Remove column beruf"
},
{
"op": "core/column-removal",
"columnName": "ort",
"description": "Remove column ort"
}
]
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment