Uploaded image for project: 'OASIS Classification of Everyday Living (COEL) TC'
  1. OASIS Classification of Everyday Living (COEL) TC
  2. COEL-140

Structure of QueryResult in PQI is unclear

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None

      Description

      When a data engine returns 200 from a query operation, the body contains the result of the query. I think this should take one of two forms:

      1) When the query does NOT contain an Aggregate clause, the result is an array of Atoms.
      2) When the query contains an Aggregate clause, the result is a table of data (like the output from a typical SQL query).

      For example, if we issued a query that included the aggregate clause:

      { …
      "Aggregate": {
      "Columns": [

      {"ColName": "WHEN_DURATION", "Aggregator": "SUM"}

      ,

      {"ColName": "HOW_RELIABILITY", "Aggregator": "AVG"}

      ],
      "GroupBy": ["WHAT_ELEMENT","WHAT_SUBCLASS"]}
      "Project" :

      { "Include": ["WHAT_CLUSTER", "WHAT_CLASS"] }

      }

      == SELECT SUM(Duration, AVG(Reliability), Cluster, Class, Groupby Element, Subclass

      then the output is a table of values with four columns and could be represented in a number of ways:

      {"QueryResult": {
      "Table": [
      [

      {"ColName": "WHEN_DURATION", "Aggregator": "SUM","Value": 127.3}

      ,

      {"ColName": "HOW_RELIABILITY","Aggregator": "AVG","Value": 83}

      ,

      {"ColName": "WHAT_CLUSTER", "Value": 12}

      ,

      {"ColName": "WHAT_CLASS", "Value": 23}

      ,

      {"ColName": "WHAT_ELEMENT", "Value": 2031}

      ,

      {"ColName": "WHAT_SUBCLASS", "Value": 1256}

      ],[

      {"ColName": "WHEN_DURATION", "Aggregator": "SUM","Value": 993}

      ,

      {"ColName": "HOW_RELIABILITY","Aggregator": "AVG","Value": 12}

      ,

      {"ColName": "WHAT_CLUSTER", "Value": 12}

      ,

      {"ColName": "WHAT_CLASS", "Value": 23}

      ,

      {"ColName": "WHAT_ELEMENT", "Value": 2037}

      ,

      {"ColName": "WHAT_SUBCLASS", "Value": 1334}

      ] ] }}

      or

      {"QueryResult": {
      "Table": [

      {"SUM(WHEN_DURATION)": 127.3, "AVG(HOW_RELIABILITY)": 83, "WHAT_CLUSTER ": 12, "WHAT_CLASS": 23 , "WHAT_ELEMENT": 2031, "WHAT_SUBCLASS": 1256}

      ,

      {"SUM(WHEN_DURATION)": 127.3, "AVG(HOW_RELIABILITY)": 83, "WHAT_CLUSTER ": 12, "WHAT_CLASS": 23 , "WHAT_ELEMENT": 2031, "WHAT_SUBCLASS": 1256}

      ]}}

        Attachments

          Activity

            People

            • Assignee:
              dsnelling David Snelling
              Reporter:
              paul.bruton Paul Bruton [X] (Inactive)
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: