openphacts / GLOBAL

Global project issues [private for now. owner lee harland]
3 stars 0 forks source link

interaction count for genes does not have a useful primary topic _about #403

Open egonw opened 6 years ago

egonw commented 6 years ago

When I ask for the number of interaction for some gene IRI (e.g. https://beta.openphacts.org/2.2/pathways/interactions/byEntity/count?uri=http%3A%2F%2Fidentifiers.org%2Fensembl%2FENSG00000105221&app_id=91f5d4d0&app_key=1af5086da757e57c553bfa1351708d5f) then the results has an primary topic _about from which I cannot recover the gene IRI. This causes problems if I want to link the count back to the gene (common with call backs). This is the resulting JSON for the above query:

{
  "format": "linked-data-api",
  "version": "2.2",
  "result": {
    "_about": "http://beta.openphacts.org:3002/2.2/pathways/interactions/byEntity/count?uri=http%3A%2F%2Fidentifiers.org%2Fensembl%2FENSG00000105221&app_id=91f5d4d0&app_key=1af5086da757e57c553bfa1351708d5f",
    "definition": "http://beta.openphacts.org:3002/api-config",
    "extendedMetadataVersion": "http://beta.openphacts.org:3002/2.2/pathways/interactions/byEntity/count?uri=http%3A%2F%2Fidentifiers.org%2Fensembl%2FENSG00000105221&app_id=91f5d4d0&app_key=1af5086da757e57c553bfa1351708d5f&_metadata=all%2Cviews%2Cformats%2Cexecution%2Cbindings%2Csite",
    "linkPredicate": "http://www.w3.org/2004/02/skos/core#exactMatch",
    "activeLens": "Default",
    "primaryTopic": {
      "_about": "http://www.wikipathways.org",
      "interactions_count": 2,
      "isPrimaryTopicOf": "http://beta.openphacts.org:3002/2.2/pathways/interactions/byEntity/count?uri=http%3A%2F%2Fidentifiers.org%2Fensembl%2FENSG00000105221&app_id=91f5d4d0&app_key=1af5086da757e57c553bfa1351708d5f"
    }
  }
}
ianwdunlop commented 6 years ago

Do you mean this "_about": "http://www.wikipathways.org", is "wrong"? What would you expect to be there instead? The ensembl gene URI http://identifiers.org/ensembl/ENSG00000105221

egonw commented 6 years ago

Yes, most API calls use "_about" for the entity for which information was requested, indeed that Ensembl IRI in this case...

ianwdunlop commented 6 years ago

Probably something wrong in the template defining this API call.

egonw commented 6 years ago

Yes, I think so too, but could not work out how to change the specification for the better. I think the JSON reply should look like this (snippet only):

    "primaryTopic": {
      "_about": "http://identifiers.org/ensembl/ENSG00000105221",
      "interactions_count": 2,
      "isPrimaryTopicOf": "http://beta.openphacts.org:3002/2.2/pathways/interactions/byEntity/count?uri=http%3A%2F%2Fidentifiers.org%2Fensembl%2FENSG00000105221&app_id=91f5d4d0&app_key=1af5086da757e57c553bfa1351708d5f"
    }
egonw commented 6 years ago

But I think you already fixed this with https://github.com/openphacts/OPS_LinkedDataApi/commit/3c97eed074209b81754e13e66242f272e6732af3, right?

ianwdunlop commented 6 years ago

Yes, fixed but not deployed. I think most of the pathway calls have the same issue.