hbz / lobid-gnd

UI and API to the Integrated Authority File (Gemeinsame Normdatei, GND)
http://lobid.org/gnd
Eclipse Public License 2.0
25 stars 5 forks source link

Reconcilation Service don't return right Types. #211

Closed boerni667 closed 5 years ago

boerni667 commented 5 years ago

When i've tried out your reconcilation service, it always returned for every hit a list of types, but all types which are supported by your reconcilation services and not the specific type of the hit.

Shouldn't the given example just return the object for "Work" as the type of the first hit in the result array?

e.g. curl --data 'queries={"q1":{"query":"Goethe"}}' http://lobid.org/gnd/reconcile returns

{
  "q1": {
    "result": [
      {
        "id": "1154419746",
        "name": "Goethe",
        "score": 25.306683,
        "match": true,
        "type": [
          {
            "id": "AuthorityResource",
            "name": "Normdatenressource"
          },
          {
            "id": "CorporateBody",
            "name": "K��rperschaft"
          },
          {
            "id": "ConferenceOrEvent",
            "name": "Konferenz oder Veranstaltung"
          },
          {
            "id": "SubjectHeading",
            "name": "Schlagwort"
          },
          {
            "id": "Work",
            "name": "Werk"
          },
          {
            "id": "PlaceOrGeographicName",
            "name": "Geografikum"
          },
          {
            "id": "DifferentiatedPerson",
            "name": "Individualisierte Person"
          },
          {
            "id": "Family",
            "name": "Familie"
          }
        ]
      },
...
]}}
acka47 commented 5 years ago

Thanks for the report. I am not very familiar with the API and @fsteeg, who implemented the API, is currently on vacation so that we won't be able to take a deeper look into this until next week.

@boerni667, how are you using the reconciliation service? With the OpenRefine client or in another way?

Trying this out by myself with the OpenRefine client (version 3.1), I get the expected result (i.e. only type that apply not all top types) when reconciling some strings against GND and a) restricting reconciliation on a specific type or b) adding the type of reconciled entries afterwards via "Edit column" --> "Add columns from reconciled values...". Thus, I am not sure whether this really is a bug.

fsteeg commented 5 years ago

@boerni667 Thanks for finding and reporting this issue, it is now fixed in production, see https://lobid.org/gnd/reconcile?queries={"q0":{"query":"Goethe"}}

The effect is that in the reconciliation dialog (after selecting the service), only types are suggested that are actually in the results for the values we are reconciling.

boerni667 commented 5 years ago

Yes i've experienced this same issue (only types are suggested which are in the first batch of result after selecting) also when i was developing our openrefine reconcilation API for our very own LOD service API. I think this is an bug in openrefine, they should suggest all the defaultTypes defined in the service metadata.

fsteeg commented 5 years ago

Hm, I thought of it as a feature, since it only suggests types that will actually yield results.