Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Europe PMC Publication annotations #233

Merged
merged 7 commits into from
Oct 12, 2021

Conversation

SandyRogers
Copy link
Member

This PR:

  • adds a detail action endpoint on Publications, to fetch and format Europe PMC paper annotations for the Publication.
  • does not add a Model (no annotations data is stored in MGnify db).
    • this means we should not expect to use/include annotations on a Publication list endpoint
    • this means if Europe PMC is down, our detail endpoint will 404 (but the main Publications list/detail endpoints will be fine)

TODO in future:

Action endpoints do not appear in the Browsable API / API schema currently. It would be nice if it were possible to add a model-less RelationshipViewSet to Publications, so that you'd get some JSON like:

"relationships": {
    "studies": {
        "links": {
            "related": "http://localhost:8000/v1/publications/29312205/studies"
        }
    },
    "samples": {
        "links": {
            "related": "http://localhost:8000/v1/publications/29312205/samples"
        }
    },
+  "annotations": {
+      "links": {
+          "related": "http://localhost:8000/v1/publications/29312205/annotations"
+      }
+  }
},

This isn't possible (I think it is this issue).

Another currently-impossible but nice way would be to use something like .../publications/<pubmedid>?include=annotations, with annotations as a calculated field. This is probably the thing to do, but first we need to change our DRFJA implementation.

emgapi/europe_pmc.py Outdated Show resolved Hide resolved
emgapi/europe_pmc.py Outdated Show resolved Hide resolved
Copy link
Member

@mberacochea mberacochea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good :). Only those comments/questions. I think we should deploy this in dev and give it a try

@SandyRogers SandyRogers merged commit 361a788 into develop Oct 12, 2021
@SandyRogers SandyRogers deleted the europe-pmc-publication-annotations branch October 12, 2021 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants