From 42bdcbcb2b623c1d09a792d10d80aeecaa08faac Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Wed, 10 Jul 2024 14:25:16 +0200 Subject: [PATCH] Extract `string_object` definition from candidate `name` (#138) And use for candidate `description` --- .../valid/example-full.json | 24 ++++++++-- draft/index.html | 17 +++++-- .../schemas/reconciliation-result-batch.json | 44 +++++++++++-------- 3 files changed, 60 insertions(+), 25 deletions(-) diff --git a/draft/examples/reconciliation-result-batch/valid/example-full.json b/draft/examples/reconciliation-result-batch/valid/example-full.json index e421f3b..1c7f001 100644 --- a/draft/examples/reconciliation-result-batch/valid/example-full.json +++ b/draft/examples/reconciliation-result-batch/valid/example-full.json @@ -11,7 +11,11 @@ "dir": "auto" } ], - "description": "1969-| Diss. Fachbereich Mathematik", + "description": [ + { + "str": "1969-| Diss. Fachbereich Mathematik" + } + ], "score": 53.015232, "match": false, "features": [ @@ -56,7 +60,11 @@ "dir": "auto" } ], - "description": "Universität Wrocław, Niederlandestudien", + "description": [ + { + "str": "Universität Wrocław, Niederlandestudien" + } + ], "score": 52.357353, "match": false, "type": [ @@ -83,7 +91,11 @@ "dir": "auto" } ], - "description": "1948-| Mitglied des Deutschen Bundestages, SPD (1993)", + "description": [ + { + "str": "1948-| Mitglied des Deutschen Bundestages, SPD (1993)" + } + ], "score": 86.43497, "features": [ { @@ -128,7 +140,11 @@ "dir": "auto" } ], - "description": "Dissertation Potsdam, Universität, Mathematik-Naturwissenschaftliche Fakultät, 2017", + "description": [ + { + "str": "Dissertation Potsdam, Universität, Mathematik-Naturwissenschaftliche Fakultät, 2017" + } + ], "score": 62.04763, "match": false, "type": [ diff --git a/draft/index.html b/draft/index.html index ef090f5..f056527 100644 --- a/draft/index.html +++ b/draft/index.html @@ -242,7 +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
  • +
  • Change candidate name and description from string to array of objects with required str, optional lang and dir fields
  • @@ -567,9 +567,9 @@

    Reconciliation Query Responses

    id
    The identifier of the candidate entity;
    name
    -
    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;
    +
    An array of string objects with names for the candidate entity;
    description
    -
    The entity description MAY optionally be included;
    +
    An optional array of string objects with descriptions for the candidate entity;
    type
    The types of the candidate entity;
    score
    @@ -580,6 +580,17 @@

    Reconciliation Query Responses

    A boolean matching decision, which indicates whether the service considers this candidate good enough to be chosen as a correct match.

    +

    + A string object contains the following fields: +

    +
    str
    +
    The string value;
    +
    lang
    +
    Optionally, the text-processing language of the string;
    +
    dir
    +
    Optionally, the text direction of the string.
    +
    +

    A matching feature is a numerical or boolean value which can be used to determine how likely it is for the candidate to be the correct entity. It contains the following fields:

    diff --git a/draft/schemas/reconciliation-result-batch.json b/draft/schemas/reconciliation-result-batch.json index 1baf46c..cd9c839 100644 --- a/draft/schemas/reconciliation-result-batch.json +++ b/draft/schemas/reconciliation-result-batch.json @@ -3,6 +3,26 @@ "$id": "https://reconciliation-api.github.io/specs/draft/schemas/reconciliation-result-batch.json", "type": "object", "description": "This schema can be used to validate the JSON serialization of any reconciliation result batch.", + "definitions": { + "string_object": { + "type": "object", + "properties": { + "str": { + "type": "string" + }, + "lang": { + "type": "string" + }, + "dir": { + "type": "string" + } + }, + "required": [ + "str" + ], + "additionalProperties": false + } + }, "required": [ "results" ], @@ -26,27 +46,15 @@ "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 + "$ref": "#/definitions/string_object" } }, "description": { - "type": "string", - "description": "Optional description of the candidate entity" + "type": "array", + "description": "Optional descriptions of the candidate entity", + "items": { + "$ref": "#/definitions/string_object" + } }, "score": { "type": "number",