Page 1 of 1

News on API to get all concepts in one go?

Posted: Tue Jun 15, 2021 11:29 pm America/New_York
by rwalker
Re the thread at wiki.earthdata.nasa.gov/pages/viewpage.action?pageId=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.

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

Posted: Wed Jun 16, 2021 6:04 pm America/New_York
by GCMD - sritz
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