mapping-commons / sssom-api

Apache License 2.0
7 stars 0 forks source link

Add facets to each page #53

Closed anitacaron closed 1 year ago

anitacaron commented 1 year ago

Related to #51

At the moment it's returning mapping_justification and predicate_id that are part of the mapping model.

The mapping_set_title is part of the mapping set and need extra work to get them.

Facets object shows the list of values for each facet and the total number in total items:

"facets": {
    "mapping_justification": {
      "https://w3id.org/semapv/LexicalMatching": 185,
      "https://w3id.org/semapv/LogicalReasoning": 115,
      "https://w3id.org/semapv/ManualMappingCuration": 1092,
      "https://w3id.org/semapv/UnspecifiedMatching": 6740
    },
    "predicate": {
      "http://www.w3.org/2004/02/skos/core#closeMatch": 347,
      "http://www.w3.org/2004/02/skos/core#exactMatch": 665,
      "http://www.w3.org/2004/02/skos/core#narrowMatch": 155,
      "http://www.w3.org/2002/07/owl#equivalentClass": 6740,
      "http://www.w3.org/2004/02/skos/core#relatedMatch": 105,
      "http://www.w3.org/2004/02/skos/core#broadMatch": 120
    }
  }
anitacaron commented 1 year ago

@serjoshua, is this what you expect?

anitacaron commented 1 year ago

Thank you, @pkalita-lbl. I'll try to use this countby method.

serjoshua commented 1 year ago

Looks good to me. Thanks!