BlueBrain / nexus-forge

Building and Using Knowledge Graphs made easy
https://nexus-forge.readthedocs.io
GNU Lesser General Public License v3.0
38 stars 19 forks source link

Rm metadata fetch when forge.retrieve #376

Closed ssssarah closed 7 months ago

ssssarah commented 8 months ago

Use annotate=True when retrieving a resource's original payload, to get the metadata with it https://bluebrainnexus.io//docs/delta/api/resources-api.html#fetch-original-payload

Use the metadata included in the response when retrieving a resource with /fetch https://bluebrainnexus.io//docs/delta/api/resources-api.html#fetch

Removes the second api call for metadata

codecov-commenter commented 8 months ago

Codecov Report

Attention: 42 lines in your changes are missing coverage. Please review.

Comparison is base (46f06eb) 74.66% compared to head (ee95349) 74.67%.

Files Patch % Lines
kgforge/specializations/stores/bluebrain_nexus.py 6.66% 42 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #376 +/- ## ======================================= Coverage 74.66% 74.67% ======================================= Files 101 101 Lines 6415 6417 +2 ======================================= + Hits 4790 4792 +2 Misses 1625 1625 ``` | [Flag](https://app.codecov.io/gh/BlueBrain/nexus-forge/pull/376/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BlueBrain) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/BlueBrain/nexus-forge/pull/376/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BlueBrain) | `74.67% <6.66%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BlueBrain#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ssssarah commented 8 months ago

Looks like retrieving using resolvers and /source doesn't support annotate=True, https://bluebrainnexus.io//docs/delta/api/resolvers-api.html#fetch-original-resource-payload-using-resolvers

So there is still one use case where a separate call for metadata is necessary. I just requested the feature https://github.com/BlueBrain/nexus/issues/4717