NASA-PDS / pds-api

PDS web APIs specifications and user's manual
http://nasa-pds.github.io/pds-api
Other
5 stars 3 forks source link

Get investigation area/targets/instruments from external ids #52

Closed tloubrieu-jpl closed 3 years ago

tloubrieu-jpl commented 3 years ago

As a user, I want to get a product description as follow, regarding the links to investigation area, target and instruments:

{
“investigations”: [ {
“id”: “urn:nasa:pds:context:investigation:mission.orex”,
“href”: “{baseUrl}/products/urn:nasa:pds:context:investigation:mission.orex”
} ],
observing_system_components: {
[
{
“id”: “urn:nasa:pds:context:instrument_host:spacecraft.orex”,
“href”: “{baseUrl}/products/urn:nasa:pds:context:instrument_host:spacecraft.orex”
},
{
“id”: “urn:nasa:pds:context:instrument:ocams.orex”,
“href”: {baseUrl}/products/urn:nasa:pds:context:instrument:ocams.orex”
},
]
},

Acceptance criteria: Check that target,instruments and investigation area are available in reference implementation https://github.com/NASA-PDS/registry-api-service and deployed on pds-gamma (https://pds-gamma.jpl.nasa.gov/api/swagger-ui.html)

al-niessner commented 3 years ago

I take it that I need to do the elastic search or are they buried in the EntityProduct

al-niessner commented 3 years ago

It seems that this block needs to be un-commented out (along with some get/set stuff as well) to retrieve the information needed for creating the href later. Am I way off base or is that about it?

tloubrieu-jpl commented 3 years ago

Actually yes, the code used to be able to pull this information from the elasticsearch object so you will be able to uncomment stuff to make that work.

The issue I had was that i was pulling the name, type from elasticsearch as well and not only the info is not reliable but the structure is not appropriate, so while you uncomment stuff, you need to only pull the id and type and not populate the name/type/description info in the API output.

al-niessner commented 3 years ago

Am I using old software somewhere? When I query elastic search, the JSON objects it returns does not contain Internal_Reference (from your original post) at all anywhere. However there are these 3 items that would make it much simpler:

"ref_lid_instrument":["urn:nasa:pds:context:instrument:grs.mess",
                      "urn:nasa:pds:context:instrument:mascs.mess",
                      "urn:nasa:pds:context:instrument:ns.mess"]
"ref_lid_investigation":"urn:nasa:pds:context:investigation:mission.messenger"
"ref_lid_target":"urn:nasa:pds:context:target:planet.mercury"

However, these are not all arrays like what the Java is expecting. If the JSON snippet above in this comment is correct, then I can adjust the Java to match and make it all work. If the snippet is wrong, then what new version of pds-registry-app and/or other software do I need?