Assume that the example PSI service offers the ability to select folds in a data set. The form of these queries is given by the querySchema property in the relation and its attributes. Below is the result of getting the relation’s representation (as before), but with all properties other than querySchema hidden:

GET http://example.org/data/iris
200 OK
{
    ...
    "querySchema": {
        "description": "Select subset 'fold' of 'numfolds' total subsets of instances. Use 'invert=true' to select every other fold.",
        "/fold":     { "$integer": { "min": 1, "title": "Fold number", "description": "≤ number of folds" } },
        "/numfolds": { "$integer": { "min": 1, "title": "Total folds" } },
        "?invert":   { "$boolean": { "title": "Invert selection"} }
    }
}

This schema includes information about valid values for the query arguments fold, numfolds and invert as well as field titles and descriptions that could be used to “decorate” user controls in client software. Based on this schema, a description of the second of five folds can be requested:

GET http://example.org/data/iris?fold=2&numfolds=5
200 OK
{
    "psiType":           "relation",
    "uri":               "http://example.org/data/iris",
    "description":       "The iris data set, courtesy of Sir R. A. Fisher (fold 2 of 5)",
    "size":              30,
    "defaultAttribute":  "http://example.org/data/iris/flower?fold=2&numfolds=5",
    "attributes":        [
        "http://example.org/data/iris/flower?fold=2&numfolds=5"
        "http://example.org/data/iris/features?fold=2&numfolds=5"
        "http://example.org/data/iris/image?fold=2&numfolds=5"
    ],
    "querySchema": { ... }
}

Note that this derived relation contains only 30 instances instead of 150 and reports a different URI for its attributes (the same query schema can be used to construct these URIs directly). Requesting the value of the queried default attribute applied to instance 1 produces the following:

GET http://example.org/view/iris/flower?fold=2&numfolds=5&instance=1
200 OK
{
    "psiType":  "value",
    "value":    {
        "sepal": { "length": 4.9, "width": 3.0 },
        "petal": { "length": 1.4, "width": 0.2 },
        "species": "setosa"
    }
}

Because of the way the folds are selected, instance 1 from this relation is not the same as that from the original relation at http://example.org/data/iris.

Next steps

Now we can view all or selected instances, it’s time to discover what learning algorithms are available. Note that we could also transform the data to derive new information (such as the average value of a feature) or to produce derived features for learning.

Examining a relation and its attributes Discovering available learning algorithms