Last active
January 6, 2020 16:18
-
-
Save knudmoeller/e1008f1898ecb4f53eb6361f21324197 to your computer and use it in GitHub Desktop.
bash command to retrieve index of last page for DCAT catalog endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl ${BASE_URI}/catalog.jsonld | jq -r '.[] | select(."@id" | endswith("/catalog.jsonld?page=1")) | ."http://www.w3.org/ns/hydra/core#lastPage" | .[0]."@value" | split("=") | .[1]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Under the assumption that there is only one element selected by
select(."@id" | endswith("/catalog.jsonld?page=1"))
.