Skip to content

Specify some canonical API for possibleValuesFromApi #151

@Ostrzyciel

Description

@Ostrzyciel

In the nanopub vocabulary there is this property: https://peta-pico.github.io/npo/ntemplate/index-en.html#https://w3id.org/np/o/ntemplate/possibleValuesFromApi

It looks very useful, and I'd gladly use it with my application, but it's not clear at all what kind of API is expected here. I had a look at Nanodash's source code, and the best I've found is this: https://peta-pico.github.io/npo/ntemplate/index-en.html#https://w3id.org/np/o/ntemplate/possibleValuesFromApi

...which appears to be a series of hardcoded behaviors for different specific endpoints. This is obviously not very sustainable. The last block in the chain of else ifs seems to be the "default" behavior – something that I could potentially use. But the schema of this is not clear to me. I can of course reverse-engineer this, but then I still would have no guarantee that this behavior won't change in the near future.

My proposal here is to specify in the vocabulary what kind of API is expected, at least as a textual description, but of course, something like an OpenAPI spec would be better :) Then we would have some "canonical" behavior that Nanodash would implement by default, while maintaining its special cases that are already there.

For what it's worth, my use case is that I want to point Nanodash to get the list of possible values from static file published on GitHub Pages, published automatically by CI. This way the possible values in the Nanodash template would be automatically updated whenever I add/remove a term in my ontology. I could alternatively publish these terms in CI to a dedicated nanopub and use the possibleValuesFrom property, but it would be way more complex and I'd also need to update the template itself every time. Not very sustainable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions