RASON OData Endpoints
In RASON V2020 and later, when the REST API endpoint POST rason.net/api/model/{nameorid}/solve is used to solve a decision flow or model (of any type), an OData endpoint is
automatically created. This new OData endpoint for the RASON Rest Server enables users to retrieve (read) the results of a given RASON decision flow or model, persisted on
Azure Storage, as an OData feed with query support. The OData Web API does not interact with the existing REST Web API on the server. The implementation relies on ASP.NET
OData Web API for OData 4 standards and Entity Framework. Three data storage layers are supported for RASON Workflows for OData endpoints: JSON, memory and file. Results
and behavior are the same for all three types of storage.
RASON Workflows Model Response
The response of each RASON workflow or model execution is a JSON object – a collection of requested evaluations represented as DataFrames. If the data storage layer is
set to JSON, then each resulting dataframe is serialized into JSON format and provided with the response file. If data storage layer is memory (DB_Memory) or file (DB_FILE),
then the JSON response file does not contain the actual data, but rather serves as the metadata that stores and provides only the SQLite table names, which are stored in the
separate SQLite DB file.
Entity Data Models (EDM)
Navigating to the Service Root URL results in the following response, illustrating a simplified view of OData service metadata.
{
"@odata.context": "https://rason.net/odata/$metadata",
"value": [
{
"name": "Result",
"kind": "EntitySet",
"url": "Result"
},
{
"name": "DataInstance",
"kind": "EntitySet",
"url": "DataInstance"
}
]
}
This is the representation of a single RASON decision flow or model result through the Entity Data Models.
Result Entity Set represents a single named results within the model response. It is a structured Entity Type with two elements and can be viewed
as a named Dataframe.
- Name: STRING [key, required]
- Data: Collection DataInstance.[required]
DataInstance Entity Set represents a single entity within the result. It's an Open Entity Type, since it defines the dynamic properties that are undeclared and are not fixed in advance. It has two elements and can be viewed as a single row of an arbitrary Dataframe, defined by Result.Data.
- _ID: int [key, required]
- Properties: dynamic
Dynamic properties represent the named colunns of the Dataframe and are not known in advance since the schema of RASON Workflows results/evaluations are not fixed.
Note: Dataframes may not be accessed directly since the RASON server relies on the ASP.NET LINQ provider to implement the IQueryable interface which enables the translation and execution of the OData queries on Entity Data Models internally, using Entity Framework functionality.
See the following pages for complete description of each endpoint.
|