RealtimeScore Service REST: modelUri parameter and pmml models
I want to send a webrequest to the RealtimeScore service of Thingworx (Analytics).
My model is a simple XOR (exclusive or) model.
My POST request body looks like this:
{
"jobName": "PostmanJobRealtimeScore",
"description": "descipritonPostmanRealtimeScore",
"datasetRef": {
"dataShape": {
"fieldDefinitions": {
"datasetUri": {
"name": "datasetUri",
"description": "Location of the data",
"baseType": "STRING",
"ordinal": 0,
"aspects": {}
},
"format": {
"name": "format",
"description": "Structure of the data (CSV,PARQUET,CLQUET)",
"baseType": "STRING",
"ordinal": 0,
"aspects": {}
},
"filter": {
"name": "filter",
"description": "SQL WHERE clause to refine the dataset",
"baseType": "STRING",
"ordinal": 0,
"aspects": {}
},
"exclusions": {
"name": "exclusions",
"description": "Fields to remove from the dataset",
"baseType": "INFOTABLE",
"ordinal": 0,
"aspects": {
"dataShape": "GenericStringList"
}
},
"data": {
"name": "data",
"description": "An infotable of data (must be flat. for providing data as part of request)",
"baseType": "INFOTABLE",
"ordinal": 0,
"aspects": {}
},
"metadata": {
"name": "metadata",
"description": "Metadata of the dataset (for providing data as part of request)",
"baseType": "INFOTABLE",
"ordinal": 0,
"aspects": {
"dataShape": "AnalyticsDatasetMetadata"
}
}
}
},
"rows": [
{
"datasetUri": "body:/",
"format": "CSV",
"metadata": {
"dataShape": {
"fieldDefinitions": {
"fieldName": {
"name": "fieldName",
"baseType": "STRING",
"ordinal": 0
},
"values": {
"name": "values",
"baseType": "INFOTABLE",
"ordinal": 0
},
"isStatic": {
"name": "isStatic",
"baseType": "BOOLEAN",
"ordinal": 0
},
"min": {
"name": "min",
"description": "Minimum observed value for Continuous fields",
"baseType": "NUMBER",
"ordinal": 0
},
"max": {
"name": "max",
"description": "Maximum observed value for Continuous fields",
"baseType": "NUMBER",
"ordinal": 0
},
"dataType": {
"name": "dataType",
"baseType": "STRING",
"ordinal": 0
},
"opType": {
"name": "opType",
"baseType": "STRING",
"ordinal": 0
},
"timeSamplingInterval": {
"name": "timeSamplingInterval",
"baseType": "STRING",
"ordinal": 0
}
}
},
"rows": [
{
"fieldName": "x1",
"dataType": "STRING",
"opType": "ORDINAL",
"values": {
"dataShape": {
"fieldDefinitions": {
"item": {
"name": "item",
"baseType": "STRING",
"ordinal": 0
}
}
},
"rows": [
{
"item": "0"
},
{
"item": "1"
}
]
}
},
{
"fieldName": "x2",
"dataType": "STRING",
"opType": "ORDINAL",
"values": {
"dataShape": {
"fieldDefinitions": {
"item": {
"name": "item",
"baseType": "STRING",
"ordinal": 0
}
}
},
"rows": [
{
"item": "0"
},
{
"item": "1"
}
]
}
},
{
"fieldName": "y",
"dataType": "STRING",
"opType": "ORDINAL",
"values": {
"dataShape": {
"fieldDefinitions": {
"item": {
"name": "item",
"baseType": "STRING",
"ordinal": 0
}
}
},
"rows": [
{
"item": "0"
},
{
"item": "1"
}
]
}
}
]
},
"data": {
"dataShape": {
"fieldDefinitions": {
"x1": {
"name": "x1",
"baseType": "STRING",
"ordinal": 0
},
"x2": {
"name": "x2",
"baseType": "STRING",
"ordinal": 0
},
"y": {
"name": "y",
"baseType": "STRING",
"ordinal": 0
}
}
},
"rows": [
{
"x1": "1",
"x2": "1",
"y": ""
}
]
}
}
]
},
"goalField": "y",
"modelUri": "thingworx://repository/TW.AnalysisServices.ModelRepository/Provider/mlp_xor.pmml",
"importantFieldCount": "0",
"causalTechnique": "FULL_RANGE"
}
But I get an error message when I want to pass my pmml file in the modelUri parameter:
Unable to Invoke Service RealtimeScore on AnalyticsServer_1_PredictionThing : Could not process request: [There is no result source registered for this scheme: thingworx [refer to logs for more details
]
]
How can I pass a pmml model to the modelUri parameter so that my webrequest works?
Also if that is not possible how can I get the guid of uploaded pmml models in the analytics manager?

