QuerySpec
Some Management APIs include the ability to use a so-called QuerySpec to restrict the returns of the API. Certain settings can be made via parameters so that the result is limited and more specific.
Supported Management APIs
The following Management-APIs support using the QuerySpec, for example:
/assets/request/policydefinitions/request/contractdefinitions/request/contractagreements/request/transferprocesses/request/catalog/request
These APIs either have the QuerySpec as a complete body or the QuerySpec is part of the body. The structure looks like this:
{
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"offset": 0,
"limit": 100,
"sortOrder": "DESC",
"sortField": "fieldName",
"filterExpression": [
{
"operandLeft": "assetId",
"operator": "=",
"operandRight": "test"
}
]
}For example, pagination can be enabled by changing the number of returned data records using the limit parameter and setting the starting point using the offset or more specific filtering can be done using the filterExpression array.
Advanced Example: Custom Asset Property
POST {{Management-API}}/v3/assets/request
{
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"offset": 0,
"limit": 100,
"filterExpression": [
{
"operandLeft": "asset:prop:type",
"operator": "=",
"operandRight": "data.core.digitalTwinRegistry"
}
]
}The POST body should of course be adapted to the specific situation as needed.
Advanced Example: All Data-Offers for specific Asset
POST {{Management-API}}/v3/contractdefinitions/request
{
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"offset": 0,
"limit": 100,
"filterExpression": [
{
"operandLeft": "assetsSelector.operandRight",
"operator": "=",
"operandRight": "abc123"
}
]
}The POST body should of course be adapted to the specific situation as needed where operandRight is in this example the assetId.
FAQ
Last updated
Was this helpful?
