Skip to content

Fix OntoPortal response format #1

@Imene-Amirat

Description

@Imene-Amirat

When calling the api-gateway /search endpoint with targetDbSchema=ontoportal, the response does not match the native OntoPortal /search format.

Missing fields

Field Expected Current
matchType "prefLabel", "synonym", "definition" null
ontologyType "ONTOLOGY", "THESAURUS" null
@id concept IRI absent
@type "http://www.w3.org/2002/07/owl#Class" absent
totalCount real value (35475) limited to 100
pageCount real value (710) 2 (based on limited totalCount)

Example

Raw gateway response: /search?query=water&database=ontoportal&targetDbSchema=ontoportal

{
  "pageCount": 1,
  "nextPage": null,
  "prevPage": null,
  "links": {
      "nextPage": null,
      "prevPage": null
  },
  "page": 1,
  "collection": [
      {
          "iri": "https://w3id.org/ozcar-theia/c_bee9796f",
          "backend_type": "ontoportal",
          "@type": "THEIA_THES",
          "prefLabel": "Water",
          "short_form": "c_bee9796f",
          "source": "https://data.earthportal.eu",
          "type": "http://www.w3.org/2002/07/owl#Class"
      },
   ]
}
                                         
                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                  
Expected OntoPortal response:
{
  "totalCount": 35475,       
  "collection": {                                                                                                                                                                                                                    
    "@id": "https://w3id.org/ozcar-theia/c_bee9796f",
    "@type": "http://www.w3.org/2002/07/owl#Class",  
    "prefLabel": "Water",                                                                                                                                                                                                           
    "matchType": "prefLabel",                 
    "ontologyType": "ONTOLOGY",                                                                                                                                                                                                                                                                                                                                                                                                      
}                                           
  • Increase pagesize to 150 on the OntoPortal /search endpoint — the current default returns just 100 results compared to what OntoPortal itself exposes.
  • Replace the alphabetical sort with cosine-similarity ranking or Lucene

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions