Skip to content

Instantly share code, notes, and snippets.

@knudmoeller
Last active January 6, 2020 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knudmoeller/e1008f1898ecb4f53eb6361f21324197 to your computer and use it in GitHub Desktop.
Save knudmoeller/e1008f1898ecb4f53eb6361f21324197 to your computer and use it in GitHub Desktop.
bash command to retrieve index of last page for DCAT catalog endpoint
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]'
@knudmoeller
Copy link
Author

Under the assumption that there is only one element selected by select(."@id" | endswith("/catalog.jsonld?page=1")).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment