Return facet list for each page
anitacaron opened this issue · comments
The JSON result should have
{
"data": [{..}],
"pagination": {},
"facets": {
"mapping_justification": [],
"predicate_id": [],
"mapping_provider": [],
"object_source": [],
"confidence": [],
"mapping_set_title": []
}
}
- "mapping_justification"
- Return values as curie - blocked by mapping-commons/sssom-py#381
- "predicate_id"
- Return values as curie
- "mapping_provider"
- Return values as curie
- "object_source"
- Return values as curie
- "confidence"
- Return min and max values
- "mapping_set_title"
The facets don't have a label for the UI. How to deal with it?
This is how it's returned:
"facets": {
"mapping_justification": [
"https://w3id.org/semapv/LogicalReasoning",
"https://w3id.org/semapv/LexicalMatching"
],
"predicate": [
"http://www.w3.org/2004/02/skos/core#closeMatch",
"http://www.w3.org/2004/02/skos/core#exactMatch"
],
"mapping_provider": null,
"object_source": null
}
One option is to have a SEMPAV endpoint embedded in the API. This would allow to do things like returning SEMAPV vocabulary metadata that could be displayed in tooltips in the likes.
Can you give a link to the SEMPAV endpoint? I couldn't find it.
No no, there is no SEMAPV endpoint - only the vocabulary https://github.com/mapping-commons/semantic-mapping-vocabulary/blob/main/semapv.owl
Basically we have two options:
- We have the UI depend on OLS for obtaining labels for sempav, and make a semapv OLS endpoint mandatory when configuring the UI (this could be ok because we can simply link the public OLS endpoint for this purpose)
- We add a very basic
/terminology
endpoint to the SSSOM API to request labels and definitions for semapv / sssom vocabulary. Input: ID (CURIE), output: Label, Definition
I personally prefer the second because this is self contained, but you may want to check with @udp for which solution is advidable.
I looked into the vocabulary file semapv.owl
, and it seems they have different IRIs used for the mapping_justification values.
The IRI I have when generating SSSOM:
https://w3id.org/semapv/LexicalMatching
The IRI in the semapv.owl file:
https://w3id.org/semapv/vocab/LexicalMatching
Which one is not up to date?
https://w3id.org/semapv/vocab/LexicalMatching
Is correct.
I had already fixed that in bioregistry: https://bioregistry.io/registry/semapv
Made an issue in sssom py to fix this: mapping-commons/sssom-py#362