Skip to content

Hydra paging in hub-repo#

The listDataset enpoint has an optional prameter hydra which will add HYDRA paging to the dataset list. The HYDRA graph will look like this:

{
            "@id": "http://piveau.io/datasets/?valueType=metadata&hydra=true&limit=3&offset=0",
            "@graph": [
                {
                    "@id": "http://piveau.io/datasets/?valueType=metadata&hydra=true&limit=3&offset=0",
                    "@type": "http://www.w3.org/ns/hydra/core#PagedCollection",
                    "http://www.w3.org/ns/hydra/core#totalItems": {
                        "@value": "0",
                        "@type": "http://www.w3.org/2001/XMLSchema#int"
                    },
                    "http://www.w3.org/ns/hydra/core#next": "http://piveau.io/datasets/?valueType=metadata&hydra=true&limit=3&offset=3",
                    "http://www.w3.org/ns/hydra/core#first": "http://piveau.io/datasets/?valueType=metadata&hydra=true&limit=3&offset=0",
                    "http://www.w3.org/ns/hydra/core#last": "http://piveau.io/datasets/?valueType=metadata&hydra=true&limit=3&offset=0",
                    "http://www.w3.org/ns/hydra/core#member": ["https://piveau.io/set/data/125", "https://piveau.io/set/data/101", "https://piveau.io/set/data/217"]
                }
            ]
        }

If this service is behind a proxy that rewrites the URI, wrong URIs might show up. To fix this, you can configure your proxy to send the correct current absolute URI in the X-Original-URI header and this will be used. For a kubernetes ingress you might want to set it like this:

    nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header X-Original-URI $scheme://$host$request_uri;