ga4gh / data-repository-service-schemas

A repository for the schemas used for the Data Repository Service.
Apache License 2.0
60 stars 53 forks source link

we need a JSON schema definition for DRS API available at a public, stable URL #346

Open briandoconnor opened 3 years ago

briandoconnor commented 3 years ago

Essentially a JSON schema version of this:

JSON schema: https://github.com/ga4gh/data-repository-service-schemas/blob/drs-1.1.0/openapi/data_repository_service.swagger.yaml

at a versioned URL and also a "latest" URL

Look at making w3id.org permalink

stain commented 3 years ago

+1 - w3id permalinks are quite straight forward and can even be made with regular expressions to pass over the version.

The permalink should redirect probably to https://raw.githubusercontent.com/ga4gh/data-repository-service-schemas/drs-1.1.0/openapi/data_repository_service.swagger.yaml or github.io equivalent so the JSON Schema is resolvable directly.

briandoconnor commented 3 years ago

From @stain : "See https://opensource.ieee.org/2791-object/ieee-2791-schema/-/blob/master/2791object.json for example"

stain commented 3 years ago

Example from IEEE 2791 (BioCompute Object)

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://w3id.org/ieee/ieee-2791-schema/error_domain.json",
    "type": "object",
    "title": "Error Domain",
    "description": "Fields in the Error Domain are open-ended and not restricted nor defined by the IEEE-2791 standard. It is RECOMMENDED that the keys directly under empirical_error and algorithmic_error use a full URI. Resolving the URI SHOULD give a JSON Schema or textual definition of the field. Other keys are not allowed error_domain",
    "additionalProperties": false,
    "required": [
        "empirical_error",
        "algorithmic_error"
    ],
    "properties": {
        "empirical_error": {
            "type": "object",
            "title": "Empirical Error",
            "description": "empirically determined values such as limits of detectability, false positives, false negatives, statistical confidence of outcomes, etc. This can be measured by running the algorithm on multiple data samples of the usability domain or through the use of carefully designed in-silico data."
        },
        "algorithmic_error": {
            "type": "object",
            "title": "Algorithmic Error",
            "description": "descriptive of errors that originate by fuzziness of the algorithms, driven by stochastic processes, in dynamically parallelized multi-threaded executions, or in machine learning methodologies where the state of the machine can affect the outcome."
        }
    }
}

Note unlike that standard I agree with @briandoconnor that the version number should be baked in to the permalink (or at least major.minor part of it) because it's a reference to a particular JSON Schema definition, not the generic type (which should also have permalink referred to from the schema)