StatPro Revolution Web API


The Multiple OCP Time Series Resource


Overview

The Multiple OCP Time Series resource represents a number of Overall Custom Period (OCP) compounded time series (plural) for multiple segments, multiple time periods and (potentially) a large number of measures. The Time Series resource, by contrast, provides data for only one segment, one time period and a limited number of measures - in any one request.

The key to understanding the Multiple OCP Time Series resource is knowing what data can be included in any one request, and how to formulate a query for that data. To this end, please see the documentation for the multiple-ocp-time-series-query link relation, which contains the full details.

See the annotated representations below for details of how the requested information is contained in XML and JSON representations of the resource.


Media types

The Multiple OCP Time Series resource is exposed via XML and JSON representations, which have the following media type names:-

application/vnd.statpro.revolution.api.multiple-ocp-time-series+json

application/vnd.statpro.revolution.api.multiple-ocp-time-series+xml

When a response is received from the web service with status 200 (= OK), the fact that the response contains a Multiple OCP Time Series resource representation is indicated by the presence of one of these two response headers:-

Content-Type: application/vnd.statpro.revolution.api.multiple-ocp-time-series+json; charset=utf-8

Content-Type: application/vnd.statpro.revolution.api.multiple-ocp-time-series+xml; charset=utf-8


Related resources

The Multiple OCP Time Series resource links to the Service resource (and to itself). To do so, its resource representations use link relations:-

  • self
  • service

The self link relation identifies the Multiple OCP Time Series resource link, for the same analysis. Note that, unlike almost all other self links, the original query data is not contained in the link's URI. For a new request, the query data must be included in the POSTed entity body.

The service link relation identifies the Service resource link.


Comments

Looking at the JSON and XML resource representations below, there is seeming redundancy in that a time period's start and end dates are duplicated in its contained ocp element's s and e attributes (to use XML terminology). The reason for this is that the representations follow the convention used by the Time Series resource in which the time period's start and end dates are given, and the individual, periodic data points also have explicit start and end dates (as they must do). If the Multiple OCP Time Series resource representations look confusing, it is only because any given time period just has one periodic data point. When considering an ocp data point, the contents of its s and e attributes ('members' in JSON) must be considered to be definitive.


Update history

  • Initial Version - September 2014

Annotated Representation (JSON)

Legend

{
  "multipleOcpTimeSeries": {
    "links": {
      "service": {
        "rel": "service",
        "href": "...",
        "type": "application/vnd.statpro.revolution.api.service+json"
      },
      "self": {
        "rel": "self",
        "href": "...",
        "type": "application/vnd.statpro.revolution.api.multiple-ocp-time-series+json"
      }
    },
    "measures": [
      "Rp",
      "RelR",
      "Rfr",
      "ECompoundC"
    ],
    "segments": [
      {
        "id": 1,
        "name": "TOTAL",
        "timePeriods": [
          {
            "name": "2010",
            "start": "2010-01-03",
            "end": "2010-12-31",
            "ocp": {
              "s": "2010-01-03",
              "e": "2010-12-31",
              "m": [
                17.6858918206734,
                16.302134259612814,
                0.0,
                -1.105326920302923
              ]
            }
          },
          {
            "name": "2011",
            "start": "2011-01-03",
            "end": "2011-12-30",
            "ocp": {
              "s": "2011-01-03",
              "e": "2011-12-30",
              "m": [
                10.782619230892019,
                8.3492846081023817,
                0.0,
                -4.8936271802037821
              ]
            }
          }
        ]
      },
      {
        "id": 3,
        "name": "Energy",
        "timePeriods": [
          {
            "name": "2010",
            "start": "2010-01-03",
            "end": "2010-12-31",
            "ocp": {
              "s": "2010-01-03",
              "e": "2010-12-31",
              "m": [
                10.685891820673401,
                12.302134259612812,
                -2.182937485020974,
                3.105326920302923
              ]
            }
          },
          {
            "name": "2011",
            "start": "2011-01-03",
            "end": "2011-12-30",
            "ocp": {
              "s": "2011-01-03",
              "e": "2011-12-30",
              "m": [
                -3.7826192308920188,
                22.34928460810238,
                1.8273648261920119,
                7.7236112907343051
              ]
            }
          }
        ]
      }
    ]
  }
}


Annotated Representation (XML)

Legend

<?xml version="1.0" encoding="utf-8"?>
<multipleOcpTimeSeries xmlns="http://statpro.com/2012/Revolution">
  <link rel="service"
        href="..."
        type="application/vnd.statpro.revolution.api.service+xml" />
  <link rel="self"
        href="..."
        type="application/vnd.statpro.revolution.api.multiple-ocp-time-series+xml" />
  <measures>
    <measure>Rp</measure>
    <measure>RelR</measure>
    <measure>Rfr</measure>
    <measure>ECompoundC</measure>
  </measures>
  <segments>
    <segment>
      <id>1</id>
      <name>TOTAL</name>
      <timePeriods>
        <timePeriod>
          <name>2010</name>
          <start>2010-01-03</start>
          <end>2010-12-31</end>
          <ocp s="2010-01-03" e="2010-12-31">17.6858918206734, 16.302134259612814, 0, -1.105326920302923</ocp>
        </timePeriod>
        <timePeriod>
          <name>2011</name>
          <start>2011-01-03</start>
          <end>2011-12-30</end>
          <ocp s="2011-01-03" e="2011-12-30">10.782619230892019, 8.3492846081023817, 0, -4.8936271802037821</ocp>
        </timePeriod>
      </timePeriods>
    </segment>
    <segment>
      <id>3</id>
      <name>Energy</name>
      <timePeriods>
        <timePeriod>
          <name>2010</name>
          <start>2010-01-03</start>
          <end>2010-12-31</end>
          <ocp s="2010-01-03" e="2010-12-31">10.685891820673401, 12.302134259612812, -2.182937485020974, 3.105326920302923</ocp>
        </timePeriod>
        <timePeriod>
          <name>2011</name>
          <start>2011-01-03</start>
          <end>2011-12-30</end>
          <ocp s="2011-01-03" e="2011-12-30">-3.7826192308920188, 22.34928460810238, 1.8273648261920119, 7.7236112907343051</ocp>
        </timePeriod>
      </timePeriods>
    </segment>
  </segments>
</multipleOcpTimeSeries>


Last updated: September 2014


To Top