NatLibFi / Annif

Annif is a multi-algorithm automated subject indexing tool for libraries, archives and museums.
https://annif.org
Other
197 stars 41 forks source link

Add reconciliation API endpoint to REST API #734

Open UnniKohonen opened 1 year ago

UnniKohonen commented 1 year ago

This PR adds a Reconciliation Service API endpoint to REST API as mentioned in #338. It allows reconciling against a project using the /v1/projects/{project_id}/reconcile API method. It also includes a suggest service for entities with the /v1/projects/{project_id}/suggest/entity API method.

The main reconciliation endpoint accepts GET and POST requests:

Only the fields query and limit are supported in the queries objects. Reconciliation result objects contain the fields id, name, score and match. Reconciliation doesn't support types or properties for now.

The reconciliation API specification requires the usage of the identifierSpace field in the service manifest. Since Annif doesn't require entities to be in a specific URI space and doesn't have a way to extract this information from a project, the field is left empty for now.

The suggest service endpoint accepts GET requests and returns a suggest response. It supports the prefix and cursor parameters.

Closes #338

osma commented 1 year ago

Excellent work!

The reconciliation API specification requires the usage of the identifierSpace field in the service manifest. Since Annif doesn't require entities to be in a specific URI space and doesn't have a way to extract this infomation from a project, the field is left empty for now.

I opened an issue about this problem: https://github.com/reconciliation-api/specs/issues/139

I will soon provide more detailed comments about the code.

sonarcloud[bot] commented 10 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication