From 1e5ca4a2b347f66fa1d26b2916f79d3c026d2c85 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Wed, 10 Jul 2024 13:36:36 +0200 Subject: [PATCH] Change candidate `name` from string to array of objects (#138) With required `str`, optional `lang` and `dir` fields --- .../valid/example.json | 8 +++-- .../invalid/missing-id.json | 8 +++-- .../invalid/root-array.json | 14 ++++++-- .../valid/example-full.json | 34 ++++++++++++++++--- .../valid/minimal.json | 26 +++++++++++--- draft/index.html | 3 +- .../schemas/reconciliation-result-batch.json | 22 ++++++++++-- 7 files changed, 95 insertions(+), 20 deletions(-) diff --git a/draft/examples/reconciliation-candidate/valid/example.json b/draft/examples/reconciliation-candidate/valid/example.json index 7780809..7d1470d 100644 --- a/draft/examples/reconciliation-candidate/valid/example.json +++ b/draft/examples/reconciliation-candidate/valid/example.json @@ -1,6 +1,10 @@ { "id": "1117582299", - "name": "Urbaniak, Hans-Eberhard", + "name": [ + { + "str": "Urbaniak, Hans-Eberhard" + } + ], "score": 85.71888, "features": [ { @@ -41,4 +45,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/draft/examples/reconciliation-result-batch/invalid/missing-id.json b/draft/examples/reconciliation-result-batch/invalid/missing-id.json index f801187..e8b98ba 100644 --- a/draft/examples/reconciliation-result-batch/invalid/missing-id.json +++ b/draft/examples/reconciliation-result-batch/invalid/missing-id.json @@ -3,7 +3,11 @@ { "candidates": [ { - "name": "Urbaniak, Regina", + "name": [ + { + "str": "Urbaniak, Regina" + } + ], "score": 53.015232, "match": false, "type": [ @@ -20,4 +24,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/draft/examples/reconciliation-result-batch/invalid/root-array.json b/draft/examples/reconciliation-result-batch/invalid/root-array.json index c21935e..fd5419c 100644 --- a/draft/examples/reconciliation-result-batch/invalid/root-array.json +++ b/draft/examples/reconciliation-result-batch/invalid/root-array.json @@ -3,7 +3,11 @@ [ { "id": "120333937", - "name": "Urbaniak, Regina", + "name": [ + { + "str": "Urbaniak, Regina" + } + ], "score": 53.015232, "match": false, "type": [ @@ -19,7 +23,11 @@ }, { "id": "1127147390", - "name": "Urbaniak, Jan", + "name": [ + { + "str": "Urbaniak, Jan" + } + ], "score": 52.357353, "match": false, "type": [ @@ -35,4 +43,4 @@ } ] ] -} +} \ No newline at end of file diff --git a/draft/examples/reconciliation-result-batch/valid/example-full.json b/draft/examples/reconciliation-result-batch/valid/example-full.json index 4ec8ff6..e421f3b 100644 --- a/draft/examples/reconciliation-result-batch/valid/example-full.json +++ b/draft/examples/reconciliation-result-batch/valid/example-full.json @@ -4,7 +4,13 @@ "candidates": [ { "id": "120333937", - "name": "Urbaniak, Regina", + "name": [ + { + "str": "Urbaniak, Regina", + "lang": "de", + "dir": "auto" + } + ], "description": "1969-| Diss. Fachbereich Mathematik", "score": 53.015232, "match": false, @@ -43,7 +49,13 @@ }, { "id": "1127147390", - "name": "Urbaniak, Jan", + "name": [ + { + "str": "Urbaniak, Jan", + "lang": "de", + "dir": "auto" + } + ], "description": "Universität Wrocław, Niederlandestudien", "score": 52.357353, "match": false, @@ -64,7 +76,13 @@ "candidates": [ { "id": "123064325", - "name": "Schwanhold, Ernst", + "name": [ + { + "str": "Schwanhold, Ernst", + "lang": "de", + "dir": "auto" + } + ], "description": "1948-| Mitglied des Deutschen Bundestages, SPD (1993)", "score": 86.43497, "features": [ @@ -103,7 +121,13 @@ }, { "id": "116362988X", - "name": "Schwanhold, Nadine", + "name": [ + { + "str": "Schwanhold, Nadine", + "lang": "de", + "dir": "auto" + } + ], "description": "Dissertation Potsdam, Universität, Mathematik-Naturwissenschaftliche Fakultät, 2017", "score": 62.04763, "match": false, @@ -121,4 +145,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/draft/examples/reconciliation-result-batch/valid/minimal.json b/draft/examples/reconciliation-result-batch/valid/minimal.json index 703bd9a..6791630 100644 --- a/draft/examples/reconciliation-result-batch/valid/minimal.json +++ b/draft/examples/reconciliation-result-batch/valid/minimal.json @@ -4,11 +4,19 @@ "candidates": [ { "id": "120333937", - "name": "Urbaniak, Regina" + "name": [ + { + "str": "Urbaniak, Regina" + } + ] }, { "id": "1127147390", - "name": "Urbaniak, Jan" + "name": [ + { + "str": "Urbaniak, Jan" + } + ] } ] }, @@ -16,13 +24,21 @@ "candidates": [ { "id": "123064325", - "name": "Schwanhold, Ernst" + "name": [ + { + "str": "Schwanhold, Ernst" + } + ] }, { "id": "116362988X", - "name": "Schwanhold, Nadine" + "name": [ + { + "str": "Schwanhold, Nadine" + } + ] } ] } ] -} +} \ No newline at end of file diff --git a/draft/index.html b/draft/index.html index 3180dde..ef090f5 100644 --- a/draft/index.html +++ b/draft/index.html @@ -242,6 +242,7 @@

This Draft

  • Move the query field of reconciliation queries inside properties to allow for queries which do not provide entity names
  • Add optional standardizedScore field to the manifest
  • Unify naming to camelCase convention
  • +
  • Change candidate name from string to array of objects with required str, optional lang and dir fields
  • @@ -566,7 +567,7 @@

    Reconciliation Query Responses

    id
    The identifier of the candidate entity;
    name
    -
    The name of the candidate entity;
    +
    An array of objects representing names for the candidate entity. Each object MUST contain a string value in its str field, and MAY contain additional lang and dir fields;
    description
    The entity description MAY optionally be included;
    type
    diff --git a/draft/schemas/reconciliation-result-batch.json b/draft/schemas/reconciliation-result-batch.json index dd023fe..1baf46c 100644 --- a/draft/schemas/reconciliation-result-batch.json +++ b/draft/schemas/reconciliation-result-batch.json @@ -23,8 +23,26 @@ "description": "Entity identifier of the candidate" }, "name": { - "type": "string", - "description": "Entity name of the candidate" + "type": "array", + "description": "Names for the candidate entity", + "items": { + "type": "object", + "properties": { + "str": { + "type": "string" + }, + "lang": { + "type": "string" + }, + "dir": { + "type": "string" + } + }, + "required": [ + "str" + ], + "additionalProperties": false + } }, "description": { "type": "string",