Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Does Croissant support distributions where one API endpoint serves the Croissant JSON-LD, while another parameterized endpoint serves individual entries? #793

Open
blue-granite opened this issue Jan 17, 2025 · 0 comments

Comments

@blue-granite
Copy link

Does Croissant support distributions where one API endpoint serves the Croissant JSON-LD, while another parameterized endpoint provides (what is effectively) individual rows as JSON or GeoJSON?

Which, when combined with RecordSets, can be used to extract the relevant fields from the JSON or GeoJSON?

If an example helps, a very naive API definition:

www.myapi.com/some-api/items returns Coissant compliant JSON-LD
www.myapi.com/some-api/items/{id} returns JSON or GeoJSON (that contains the fields of interest)

{
  "a": "image name",
  "b": "image url"
  "c": "image type",
  "d": "image subject"
  "e": "etc"
}

What might the distribution look like?

"distribution": [
        {
            "@type": "cr:FileObject",
            "@id": "MYAPI",
            "name": "MYAPI",
            "description": "MYAPI",
            "contentUrl": "www.myapi.com/some-api/items/{id}",
            "encodingFormat": "application/ld+json",
            "sha256": "main"
        },
        {
            "@type": "cr:FileSet",
            "@id": "MYAPI ITEMS",
            "name": "MYAPI ITEMS",
            "description": "JSON ITEMS in MYAPI",
            "containedIn": {
                "@id": "MYAPI"
            },
            "encodingFormat": "application/json",
            "includes": "*"
        }
    ],

How would the parameter replacement for www.myapi.com/some-api/items/{id} be represented?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant