News on API to get all concepts in one go?

Please enter here to ask a question about any NASA Science related topics!
Post Reply
rwalker
Posts: 2
Joined: Fri May 21, 2021 12:06 am America/New_York

News on API to get all concepts in one go?

by rwalker » Tue Jun 15, 2021 11:29 pm America/New_York

Re the thread at https://wiki.earthdata.nasa.gov/pages/v ... =182296115 :

The earlier comment:

'... please please please restore a means of getting all the RDF for a concept scheme in one go. It's indeed "very misleading" that the link "Science Keywords [as RDF]" from the static page https://gcmd.earthdata.nasa.gov/static/kms/ now returns only a subset of the keywords, without that page otherwise giving a warning.'

The reply at the time:

'We have a KMS API improvement ticket in to our development team to resolve this issue. If you are interested, you can track it at KMS-217'

Yeah, I can't track it, as I can't log in to that service. So, any news?

Richard.

Tags:

GCMD - sritz
User Services
User Services
Posts: 35
Joined: Tue Dec 03, 2019 3:31 pm America/New_York

Re: News on API to get all concepts in one go?

by GCMD - sritz » Wed Jun 16, 2021 6:04 pm America/New_York

Hi Richard, we implemented paging in the KMS API so you can call all pages for a scheme.

Retrieve Science Keywords Page 1 of 2:

Code: Select all

curl --location --request GET 'https://gcmd.earthdata.nasa.gov/kms/concepts/concept_scheme/sciencekeywords/?format=rdf&page_num=1' \
--header 'Content-Type: text/xml' > science_keywords_page1.xml
Retrieve Science Keywords Page 2 of 2:

Code: Select all

curl --location --request GET 'https://gcmd.earthdata.nasa.gov/kms/concepts/concept_scheme/sciencekeywords/?format=rdf&page_num=2' \
--header 'Content-Type: text/xml' > science_keywords_page2.xml
Retrieve All Pages in one query:

Code: Select all

curl --location --request GET 'https://gcmd.earthdata.nasa.gov/kms/concepts/concept_scheme/sciencekeywords/?format=rdf&page_num=[1-2]' \
--header 'Content-Type: text/xml' > all_science_keywords.xml
You can also limit the page size as well (2000 is the max)

Code: Select all

curl --location --request GET 'https://gcmd.earthdata.nasa.gov/kms/concepts/concept_scheme/sciencekeywords/?format=rdf&page_num=1&page_size=2000' \
--header 'Content-Type: text/xml' > all_science_keywords.xml

Post Reply