menu

API

General Concepts

The API of the Data-Centric Design Hub relies on three main concepts:

  • A Person represents a physical person, signed up on the hub. It can own, share and have access to Things. A person has:

    • a email address (its unique identifier),
    • a name
    • a password (at least 8 characters)
  • A Thing represents a physical or virtual component collecting data. For example, a phone which collects acceleration, a website recording number of page views. A Thing has:

    • an unique identifier (or id), automatically generated by the hub
    • a name
    • a type (optional), to give a type to the Thing (e.g. Phone, Wheelchair, Website)
    • a description (optional)
    • a list of properties (optional) which values change over time
  • A Property represents a Thing property

    • an unique identifier (or id), automatically generated by the hub
    • a name
    • a type, which characterise the nature of the property and its number of dimensions (See Property Types)
    • a list of dimensions
    • a 2-dimension list of values, starting with a UNIX TIMESTAMP and followed by the value of each dimension. All values MUST be numbers.
[
  ["UNIX timestamp", "value-dimension-1", "value-dimension-2"],
  ["UNIX timestamp", "value-dimension-1", "value-dimension-2"]
]
  • a list of classes (optional): if the property type is ‘CLASS’, you can associate text to the values. This is useful when using a property as data label.

Sign up

We now want to register an account for a cloud service. We will use the prototype from TU Delft IDE’s Faculty of the Data-Centric Design Hub. Go to https://dwd.tudelft.nl/subject

Flowchart Push Button

Sign up as a group with an email address, a name and a password.

Flowchart Push Button

The sign up process creates an account, then the standard OAuth2 process starts with a consent: you need to let the manager access your Things, so that it can help you manage them. To do so click “Allow access”.

Flowchart Push Button

Once the consent succeeded, you can click on ‘+’ button and create a first one.

drawing

For example with the name ‘my wheelchair’, type ‘Wheelchair’, and a description ‘An Internet-connected wheelchair’.

drawing

The process may take a few seconds, as the hub generates an access token for your Thing.

drawing

COPY AND SAVE THIS TOKEN in a text file, it will be shown only once and enables your wheelchair to communicate with the hub. You can also save the thing id, but you can always go back to the manager to retrieve this id.

Property Types

{
  ACCELEROMETER: {
    name: "Accelerometer",
    description:
      "Acceleration force that is applied to a device on all three physical axes x, y and z, including the force of gravity.",
    dimensions: [
      {
        name: "x",
        description:
          "Acceleration force that is applied to a device on physical axe x, including the force of gravity.",
        unit: "m/s2"
      },
      {
        name: "y",
        description:
          "Acceleration force that is applied to a device on physical axe y, including the force of gravity.",
        unit: "m/s2"
      },
      {
        name: "z",
        description:
          "Acceleration force that is applied to a device on physical axe z, including the force of gravity.",
        unit: "m/s2"
      }
    ]
  },
  GYROSCOPE: {
    name: "Gyroscope",
    description: "Rate of rotation around the three axis x, y and z.",
    dimensions: [
      {
        name: "x",
        description: "Rate of rotation around the x axis.",
        unit: "rad/s"
      },
      {
        name: "y",
        description: "Rate of rotation around the y axis.",
        unit: "rad/s"
      },
      {
        name: "z",
        description: "Rate of rotation around the z axis.",
        unit: "rad/s"
      }
    ]
  },
  BINARY: {
    name: "Binary",
    description: "Can take value 0 or 1.",
    dimensions: [{ name: "state", description: "Binary State", unit: "" }]
  },
  MAGNETIC_FIELD: {
    name: "Magnetic Field",
    description: "Geomagnetic field strength along the x, y and z axis.",
    dimensions: [
      {
        name: "x",
        description: "Geomagnetic field strength along the x axis.",
        unit: "uT"
      },
      {
        name: "y",
        description: "Geomagnetic field strength along the y axis.",
        unit: "uT"
      },
      {
        name: "z",
        description: "Geomagnetic field strength along the z axis.",
        unit: "uT"
      }
    ]
  },
  GRAVITY: {
    name: "Gravity",
    description: "Force of gravity along x, y and z axis.",
    dimensions: [
      {
        name: "x",
        description: "Force of gravity along the x axis.",
        unit: "m/s2"
      },
      {
        name: "y",
        description: "Force of gravity along the y axis.",
        unit: "m/s2"
      },
      {
        name: "z",
        description: "Force of gravity along the z axis.",
        unit: "m/s2"
      }
    ]
  },
  ROTATION_VECTOR: {
    name: "Rotation Vector",
    description: "",
    dimensions: [
      {
        name: "x",
        description:
          "Rotation vector component along the x axis (x * sin(theta/2)).",
        unit: ""
      },
      {
        name: "y",
        description:
          "Rotation vector component along the y axis (y * sin(theta/2)).",
        unit: ""
      },
      {
        name: "z",
        description:
          "Rotation vector component along the z axis (z * sin(theta/2)).",
        unit: ""
      }
    ]
  },
  LIGHT: {
    name: "Light",
    description: "Light level",
    dimensions: [
      {
        name: "Illuminance",
        description: "",
        unit: "lx"
      }
    ]
  },
  LOCATION: {
    name: "Location",
    description: "Longitude and latitude in degrees",
    dimensions: [
      {
        name: "Longitude",
        description: "",
        unit: "°"
      },
      {
        name: "Latitude",
        description: "",
        unit: "°"
      }
    ]
  },
  ALTITUDE: {
    name: "Altitude",
    description: "Altitude in meters above the WGS 84 reference ellipsoid.",
    dimensions: [
      {
        name: "Altitude",
        description: "",
        unit: "m"
      }
    ]
  },
  BEARING: {
    name: "Bearing",
    description: "Bearing in degrees",
    dimensions: [
      {
        name: "Bearing",
        description: "",
        unit: "°"
      }
    ]
  },
  SPEED: {
    name: "Speed",
    description: "",
    dimensions: [
      {
        name: "Speed",
        description: "",
        unit: ""
      }
    ]
  },
  PRESSURE: {
    name: "Pressure",
    description: "Atmospheric pressure in hPa (millibar)",
    dimensions: [
      {
        name: "Pressure",
        description: "",
        unit: "hPa"
      }
    ]
  },
  PROXIMITY: {
    name: "Proximity",
    description: "Proximity from object (binary or in cm)",
    dimensions: [
      {
        name: "Proximity",
        description: "",
        unit: "cm"
      }
    ]
  },
  RELATIVE_HUMIDITY: {
    name: "Relative Humidity",
    description: "Relative ambient air humidity in percent",
    dimensions: [
      {
        name: "Relative Humidity",
        description: "",
        unit: "H%"
      }
    ]
  },
  COUNT: {
    name: "Count",
    description: "",
    dimensions: [
      {
        name: "Count",
        description: "",
        unit: ""
      }
    ]
  },
  FORCE: {
    name: "Force",
    description: "",
    dimensions: [
      {
        name: "Force",
        description: "",
        unit: "kg"
      }
    ]
  },
  TEMPERATURE: {
    name: "Temperature",
    description: "",
    dimensions: [
      {
        name: "Temperature",
        description: "",
        unit: "°C"
      }
    ]
  },
  STATE: {
    name: "State",
    description: "",
    dimensions: [
      {
        name: "Value",
        description: "",
        unit: ""
      }
    ]
  },
  CLASS: {
    name: "Class",
    description: "",
    dimensions: [
      {
        name: "Class",
        description:
          "Values of this dimension represents the classes of the property",
        unit: ""
      }
    ]
  },
  VIDEO: {
    name: "Video",
    description: "",
    dimensions: [
      {
        name: "Duration",
        description: "Duration of the video record.",
        unit: "ms"
      }
    ]
  },
  HEART_RATE: {
    name: "Heart Rate",
    description: "Heart Rate Measurement (HRM)",
    dimensions: [
      {
        name: "Heart Rate",
        description: "Heart rate in beats per minutes",
        unit: "BPM"
      },
      {
        name: "RR-Interval",
        description: "RR-Interval in seconds",
        unit: "s"
      }
    ]
  },
  ONE_DIMENSION: {
    name: "1 Dimension",
    description: "",
    dimensions: [
      {
        name: "Value",
        description: "",
        unit: ""
      }
    ]
  },
  TWO_DIMENSIONS: {
    name: "2 Dimensions",
    description: "",
    dimensions: [
      {
        name: "Value1",
        description: "",
        unit: ""
      },
      {
        name: "Value2",
        description: "",
        unit: ""
      }
    ]
  },
  THREE_DIMENSIONS: {
    name: "3 Dimensions",
    description: "",
    dimensions: [
      {
        name: "Value1",
        description: "",
        unit: ""
      },
      {
        name: "Value2",
        description: "",
        unit: ""
      },
      {
        name: "Value3",
        description: "",
        unit: ""
      }
    ]
  },
  FOUR_DIMENSIONS: {
    name: "4 Dimensions",
    description: "",
    dimensions: [
      {
        name: "Value1",
        description: "",
        unit: ""
      },
      {
        name: "Value2",
        description: "",
        unit: ""
      },
      {
        name: "Value3",
        description: "",
        unit: ""
      },
      {
        name: "Value4",
        description: "",
        unit: ""
      }
    ]
  },
  FIVE_DIMENSIONS: {
    name: "5 Dimensions",
    description: "",
    dimensions: [
      {
        name: "Value1",
        description: "",
        unit: ""
      },
      {
        name: "Value2",
        description: "",
        unit: ""
      },
      {
        name: "Value3",
        description: "",
        unit: ""
      },
      {
        name: "Value4",
        description: "",
        unit: ""
      },
      {
        name: "Value5",
        description: "",
        unit: ""
      }
    ]
  },
  SIX_DIMENSIONS: {
    name: "6 Dimensions",
    description: "",
    dimensions: [
      {
        name: "Value1",
        description: "",
        unit: ""
      },
      {
        name: "Value2",
        description: "",
        unit: ""
      },
      {
        name: "Value3",
        description: "",
        unit: ""
      },
      {
        name: "Value4",
        description: "",
        unit: ""
      },
      {
        name: "Value5",
        description: "",
        unit: ""
      },
      {
        name: "Value6",
        description: "",
        unit: ""
      }
    ]
  },
  NINE_DIMENSIONS: {
    name: "9 Dimensions",
    description: "",
    dimensions: [
      {
        name: "Value1",
        description: "",
        unit: ""
      },
      {
        name: "Value2",
        description: "",
        unit: ""
      },
      {
        name: "Value3",
        description: "",
        unit: ""
      },
      {
        name: "Value4",
        description: "",
        unit: ""
      },
      {
        name: "Value5",
        description: "",
        unit: ""
      },
      {
        name: "Value6",
        description: "",
        unit: ""
      },
      {
        name: "Value7",
        description: "",
        unit: ""
      },
      {
        name: "Value8",
        description: "",
        unit: ""
      },
      {
        name: "Value9",
        description: "",
        unit: ""
      }
    ]
  },
  TEN_DIMENSIONS: {
    name: "10 Dimensions",
    description: "",
    dimensions: [
      {
        name: "Value1",
        description: "",
        unit: ""
      },
      {
        name: "Value2",
        description: "",
        unit: ""
      },
      {
        name: "Value3",
        description: "",
        unit: ""
      },
      {
        name: "Value4",
        description: "",
        unit: ""
      },
      {
        name: "Value5",
        description: "",
        unit: ""
      },
      {
        name: "Value6",
        description: "",
        unit: ""
      },
      {
        name: "Value7",
        description: "",
        unit: ""
      },
      {
        name: "Value8",
        description: "",
        unit: ""
      },
      {
        name: "Value9",
        description: "",
        unit: ""
      },
      {
        name: "Value10",
        description: "",
        unit: ""
      }
    ]
  },
  ELEVEN_DIMENSIONS: {
    name: "11 Dimensions",
    description: "",
    dimensions: [
      {
        name: "Value1",
        description: "",
        unit: ""
      },
      {
        name: "Value2",
        description: "",
        unit: ""
      },
      {
        name: "Value3",
        description: "",
        unit: ""
      },
      {
        name: "Value4",
        description: "",
        unit: ""
      },
      {
        name: "Value5",
        description: "",
        unit: ""
      },
      {
        name: "Value6",
        description: "",
        unit: ""
      },
      {
        name: "Value7",
        description: "",
        unit: ""
      },
      {
        name: "Value8",
        description: "",
        unit: ""
      },
      {
        name: "Value9",
        description: "",
        unit: ""
      },
      {
        name: "Value10",
        description: "",
        unit: ""
      },
      {
        name: "Value11",
        description: "",
        unit: ""
      }
    ]
  },
  TWELVE_DIMENSIONS: {
    name: "12 Dimensions",
    description: "",
    dimensions: [
      {
        name: "Value1",
        description: "",
        unit: ""
      },
      {
        name: "Value2",
        description: "",
        unit: ""
      },
      {
        name: "Value3",
        description: "",
        unit: ""
      },
      {
        name: "Value4",
        description: "",
        unit: ""
      },
      {
        name: "Value5",
        description: "",
        unit: ""
      },
      {
        name: "Value6",
        description: "",
        unit: ""
      },
      {
        name: "Value7",
        description: "",
        unit: ""
      },
      {
        name: "Value8",
        description: "",
        unit: ""
      },
      {
        name: "Value9",
        description: "",
        unit: ""
      },
      {
        name: "Value10",
        description: "",
        unit: ""
      },
      {
        name: "Value11",
        description: "",
        unit: ""
      },
      {
        name: "Value12",
        description: "",
        unit: ""
      }
    ]
  }